HomepageForm.xaml.cs 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997
  1. using CollaborativePlatformMain.DFEntity;
  2. using CollaborativePlatformMain.Form.UserControlForm;
  3. using CollaborativePlatformMain.Util;
  4. using HandyControl.Controls;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Collections.ObjectModel;
  8. using System.Diagnostics.Eventing.Reader;
  9. using System.Drawing.Printing;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using System.Windows;
  14. using System.Windows.Controls;
  15. using System.Windows.Data;
  16. using System.Windows.Documents;
  17. using System.Windows.Input;
  18. using System.Windows.Media;
  19. using System.Windows.Media.Imaging;
  20. using System.Windows.Shapes;
  21. using Window = System.Windows.Window;
  22. using MessageBox = System.Windows.MessageBox;
  23. using static System.Net.Mime.MediaTypeNames;
  24. using CollaborativePlatformMain.Form.MessageSubPage;
  25. using CollaborativePlatformMain.Form.MessageSubPage.CreatLevel;
  26. using CollaborativePlatformMain.Form.MessageSubPage.Project;
  27. using CollaborativePlatformMain.DFEntity.MessageSubUtil;
  28. namespace CollaborativePlatformMain.Form
  29. {
  30. /// <summary>
  31. /// HomepageForm.xaml 的交互逻辑
  32. /// </summary>
  33. public partial class HomepageForm : Window
  34. {
  35. public HomepageForm()
  36. {
  37. InitializeComponent();
  38. }
  39. #region 最左边消息
  40. /// <summary>
  41. /// 消息是否为初始化
  42. /// </summary>
  43. public bool IsSeconMessagePage = false;
  44. /// <summary>
  45. /// 消息窗体
  46. /// </summary>
  47. public SeconMessagePage SeconMessagePage = null;
  48. /// <summary>
  49. /// 消息
  50. /// </summary>
  51. /// <param name="sender"></param>
  52. /// <param name="e"></param>
  53. private void message_Click(object sender, MouseButtonEventArgs e)
  54. {
  55. MenuItem menuItem = sender as MenuItem;
  56. ModifyBackground(menuItem);
  57. dp_message.Visibility = Visibility.Visible;
  58. dp_project.Visibility = Visibility.Collapsed;
  59. dp_contacts.Visibility = Visibility.Collapsed;
  60. dp_gallery.Visibility = Visibility.Collapsed;
  61. dp_tools.Visibility = Visibility.Collapsed;
  62. dp_threetools.Visibility = Visibility.Collapsed;
  63. SeconMessagePage = new SeconMessagePage(this);
  64. seconMessagePage.Navigate(SeconMessagePage);
  65. IsSeconMessagePage = true;
  66. //SwitchMethod(sender as MenuItem, true);
  67. }
  68. /// <summary>
  69. /// 项目是否初始化
  70. /// </summary>
  71. public bool IsSeconProjectPageShow = false;
  72. /// <summary>
  73. /// 项目
  74. /// </summary>
  75. /// <param name="sender"></param>
  76. /// <param name="e"></param>
  77. private void project_Click(object sender, MouseButtonEventArgs e)
  78. {
  79. MenuItem menuItem = sender as MenuItem;
  80. ModifyBackground(menuItem);
  81. dp_message.Visibility = Visibility.Collapsed;
  82. dp_project.Visibility = Visibility.Visible;
  83. dp_contacts.Visibility = Visibility.Collapsed;
  84. dp_gallery.Visibility = Visibility.Collapsed;
  85. dp_tools.Visibility = Visibility.Collapsed;
  86. dp_threetools.Visibility = Visibility.Collapsed;
  87. if (!IsSeconProjectPageShow)
  88. {
  89. seconProjectPage.Navigate(new SeconProjectPage(this));
  90. IsSeconProjectPageShow = true;
  91. }
  92. }
  93. /// <summary>
  94. /// 联系人是否初始化
  95. /// </summary>
  96. public bool IsSeconContactsPage = false;
  97. /// <summary>
  98. /// 联系人
  99. /// </summary>
  100. /// <param name="sender"></param>
  101. /// <param name="e"></param>
  102. private void contacts_Click(object sender, MouseButtonEventArgs e)
  103. {
  104. MenuItem menuItem = sender as MenuItem;
  105. ModifyBackground(menuItem);
  106. dp_message.Visibility = Visibility.Collapsed;
  107. dp_project.Visibility = Visibility.Collapsed;
  108. dp_contacts.Visibility = Visibility.Visible;
  109. dp_gallery.Visibility = Visibility.Visible;
  110. dp_tools.Visibility = Visibility.Collapsed;
  111. dp_threetools.Visibility = Visibility.Collapsed;
  112. if (!IsSeconContactsPage)
  113. {
  114. seconContactsPage.Navigate(new SeconContactsPage(this));
  115. IsSeconContactsPage = true;
  116. }
  117. }
  118. /// <summary>
  119. /// 图库大样图是否初始化
  120. /// </summary>
  121. public bool IsSeconLegendPage = false;
  122. /// <summary>
  123. /// 图库大样图
  124. /// </summary>
  125. /// <param name="sender"></param>
  126. /// <param name="e"></param>
  127. private void gallery_Click(object sender, MouseButtonEventArgs e)
  128. {
  129. MenuItem menuItem = sender as MenuItem;
  130. ModifyBackground(menuItem);
  131. dp_message.Visibility = Visibility.Collapsed;
  132. dp_project.Visibility = Visibility.Collapsed;
  133. dp_contacts.Visibility = Visibility.Collapsed;
  134. dp_gallery.Visibility = Visibility.Visible;
  135. dp_tools.Visibility = Visibility.Collapsed;
  136. dp_threetools.Visibility = Visibility.Collapsed;
  137. if (!IsSeconLegendPage)
  138. {
  139. seconLegendPage.Navigate(new SeconLegendPage(this));
  140. IsSeconLegendPage = true;
  141. }
  142. }
  143. /// <summary>
  144. /// 工具库是否初始化
  145. /// </summary>
  146. public bool IsSeconToolLibraryPage = false;
  147. /// <summary>
  148. /// 工具库
  149. /// </summary>
  150. /// <param name="sender"></param>
  151. /// <param name="e"></param>
  152. private void tool_Click(object sender, MouseButtonEventArgs e)
  153. {
  154. MenuItem menuItem = sender as MenuItem;
  155. ModifyBackground(menuItem);
  156. dp_message.Visibility = Visibility.Collapsed;
  157. dp_project.Visibility = Visibility.Collapsed;
  158. dp_contacts.Visibility = Visibility.Collapsed;
  159. dp_gallery.Visibility = Visibility.Collapsed;
  160. dp_tools.Visibility = Visibility.Visible;
  161. dp_threetools.Visibility = Visibility.Collapsed;
  162. if (!IsSeconToolLibraryPage)
  163. {
  164. seconToolsPage.Navigate(new SeconToolLibraryPage());
  165. IsSeconToolLibraryPage = true;
  166. }
  167. }
  168. /// <summary>
  169. /// 三维是否初始化
  170. /// </summary>
  171. public bool IsSeconThreeDimensionalPage = false;
  172. /// <summary>
  173. /// 三维
  174. /// </summary>
  175. /// <param name="sender"></param>
  176. /// <param name="e"></param>
  177. private void three_Click(object sender, MouseButtonEventArgs e)
  178. {
  179. MenuItem menuItem = sender as MenuItem;
  180. ModifyBackground(menuItem);
  181. dp_message.Visibility = Visibility.Collapsed;
  182. dp_project.Visibility = Visibility.Collapsed;
  183. dp_contacts.Visibility = Visibility.Collapsed;
  184. dp_gallery.Visibility = Visibility.Collapsed;
  185. dp_tools.Visibility = Visibility.Collapsed;
  186. dp_threetools.Visibility = Visibility.Visible;
  187. if (!IsSeconThreeDimensionalPage)
  188. {
  189. seconThreeTools.Navigate(new SeconThreeDimensionalPage(this));
  190. IsSeconThreeDimensionalPage = true;
  191. }
  192. }
  193. /// <summary>
  194. /// 设置最左测导航的颜色
  195. /// </summary>
  196. /// <param name="menuItem"></param>
  197. /// <param name="isHoShow"></param>
  198. public void ModifyBackground(MenuItem menuItem)
  199. {
  200. List<MenuItem> allMenuItems = CollaborationUtil.GetChildObjects<System.Windows.Controls.MenuItem>(mu_leftMenu);
  201. foreach (var baseMenuItem in allMenuItems)
  202. {
  203. if (baseMenuItem.Header.ToString() == menuItem.Header.ToString())
  204. {
  205. baseMenuItem.Background = new SolidColorBrush(Colors.Beige);
  206. }
  207. else
  208. {
  209. baseMenuItem.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#1E9FFF"));
  210. }
  211. }
  212. }
  213. #endregion
  214. #region 工具中间按钮
  215. private ObservableCollection<CBButtonControlsData> ToolLists = new ObservableCollection<CBButtonControlsData>();
  216. /// <summary>
  217. /// 功能名字对应的功能数据
  218. /// </summary>
  219. private Dictionary<string, ObservableCollection<CBButtonControlsData>> ToolName_ToolDatas = new Dictionary<string, ObservableCollection<CBButtonControlsData>>()
  220. {
  221. {
  222. "平台图纸治理",new ObservableCollection<CBButtonControlsData>()
  223. {
  224. new CBButtonControlsData("功能1",false,""),
  225. new CBButtonControlsData("功能2",false,""),
  226. new CBButtonControlsData("功能3",false,""),
  227. new CBButtonControlsData("功能4",false,""),
  228. new CBButtonControlsData("功能5",false,""),
  229. new CBButtonControlsData("功能6",false,""),
  230. new CBButtonControlsData("功能7",false,""),
  231. new CBButtonControlsData("功能8",false,""),
  232. }
  233. },
  234. {
  235. "块处理",new ObservableCollection<CBButtonControlsData>()
  236. {
  237. new CBButtonControlsData("处理1",false,""),
  238. new CBButtonControlsData("处理2",false,""),
  239. new CBButtonControlsData("处理3",false,""),
  240. new CBButtonControlsData("处理4",false,""),
  241. new CBButtonControlsData("处理5",false,""),
  242. new CBButtonControlsData("处理6",false,""),
  243. new CBButtonControlsData("处理7",false,""),
  244. new CBButtonControlsData("处理8",false,""),
  245. }
  246. },
  247. {
  248. "大样处理",new ObservableCollection<CBButtonControlsData>()
  249. {
  250. new CBButtonControlsData("大样1",false,""),
  251. new CBButtonControlsData("大样2",false,""),
  252. new CBButtonControlsData("大样3",false,""),
  253. new CBButtonControlsData("大样4",false,""),
  254. new CBButtonControlsData("大样5",false,""),
  255. new CBButtonControlsData("大样6",false,""),
  256. new CBButtonControlsData("大样7",false,""),
  257. new CBButtonControlsData("大样8",false,""),
  258. }
  259. },
  260. {
  261. "图纸对比",new ObservableCollection<CBButtonControlsData>()
  262. {
  263. new CBButtonControlsData("图纸对比",false,"")
  264. }
  265. },
  266. {
  267. "二维审查",new ObservableCollection<CBButtonControlsData>()
  268. {
  269. new CBButtonControlsData("二维审查",false,"")
  270. }
  271. }, {
  272. "三维",new ObservableCollection<CBButtonControlsData>()
  273. {
  274. new CBButtonControlsData("三维",false,"")
  275. }
  276. },
  277. };
  278. private void toolnavigation_Click(object sender, RoutedEventArgs e)
  279. {
  280. //Button button = sender as Button;
  281. //if (button != null && ToolName_ToolDatas.ContainsKey(button.Content.ToString()))
  282. //{
  283. // ObservableCollection<CBButtonControlsData> cbButtonControls = ToolName_ToolDatas[button.Content.ToString()];
  284. // wp_tools.Children.Clear();
  285. // foreach (var cbButtonControl in cbButtonControls)
  286. // {
  287. // wp_tools.Children.Add(new CBButtonControls(cbButtonControl));
  288. // }
  289. //}
  290. }
  291. /// <summary>
  292. /// 添加漂浮工具
  293. /// </summary>
  294. /// <param name="sender"></param>
  295. /// <param name="e"></param>
  296. private void bt_addTools(object sender, RoutedEventArgs e)
  297. {
  298. foreach (var tool in ToolName_ToolDatas)
  299. {
  300. foreach (var value in tool.Value)
  301. {
  302. if (!value.CbIsCheck)
  303. {
  304. if (ToolLists.Where(x => x.Guid.Equals(value.Guid)).Count() > 0)
  305. {
  306. for (int i = 0; i < ToolLists.Count; i++)
  307. {
  308. if (ToolLists[i].Guid.Equals(value.Guid))
  309. {
  310. ToolLists.RemoveAt(i);
  311. i--;
  312. }
  313. }
  314. }
  315. }
  316. else
  317. {
  318. if (ToolLists.Where(x => x.Guid.Equals(value.Guid)).Count() > 0) continue;
  319. ToolLists.Add(value);
  320. }
  321. }
  322. }
  323. }
  324. /// <summary>
  325. /// 悬浮窗
  326. /// </summary>
  327. private ObservableCollection<LVProjectInfoEntity> ToolDatas = new ObservableCollection<LVProjectInfoEntity>()
  328. {
  329. new LVProjectInfoEntity("图纸对比", ""),
  330. new LVProjectInfoEntity("超模全解析", ""),
  331. new LVProjectInfoEntity("超模数字化建模", "")
  332. };
  333. #endregion
  334. #region 中间的按钮
  335. private void General_Click(object sender, MouseButtonEventArgs e)
  336. {
  337. }
  338. #endregion
  339. #region 横向通知消息栏
  340. private List<Button> menuItems = new List<Button>();
  341. /// <summary>
  342. /// 通知公告数据
  343. /// </summary>
  344. private List<NotificationAnnouncement> notificationDatas = new List<NotificationAnnouncement>();
  345. /// <summary>
  346. /// 通知公告
  347. /// </summary>
  348. /// <param name="sender"></param>
  349. /// <param name="e"></param>
  350. private void me_announcementClick(object sender, RoutedEventArgs e)
  351. {
  352. //notificationDatas = new List<NotificationAnnouncement>();
  353. //for (int i = 0; i < new List<string>() { "国博城项目建筑图纸更新", "北京大兴项目结构图纸更新", "绿地项目人防图纸更新" }.Count; i++)
  354. //{
  355. // NotificationAnnouncement notificationAnnouncement = new NotificationAnnouncement();
  356. // notificationAnnouncement.MessageCategory = "通知公告";
  357. // if (i == 0)
  358. // {
  359. // notificationAnnouncement.Content = "国博城项目总消息";
  360. // notificationAnnouncement.SpecificContent = "按甲方要求,国博城项目务必在4月15号之前完成报审版。";
  361. // }
  362. // else if (i == 1)
  363. // {
  364. // notificationAnnouncement.Content = "北京大兴项目总消息";
  365. // notificationAnnouncement.SpecificContent = "按甲方要求,北京大兴项目务必在4月22号之前完成报审版。";
  366. // }
  367. // else if (i == 2)
  368. // {
  369. // notificationAnnouncement.Content = "绿地项目总消息";
  370. // notificationAnnouncement.SpecificContent = "按甲方要求,绿地项目务必在4月30号之前完成报审版。";
  371. // }
  372. // notificationDatas.Add(notificationAnnouncement);
  373. //}
  374. //me_message.Children.Clear();
  375. //foreach (var notificationData in notificationDatas)
  376. //{
  377. // Button button = new Button();
  378. // button.Content = notificationData.Content;
  379. // button.BorderThickness = new Thickness(0);
  380. // button.Width = 180;
  381. // button.Height = 30;
  382. // button.Click += new RoutedEventHandler(messageBtnClick);
  383. // button.Tag = notificationData;
  384. // button.HorizontalContentAlignment = HorizontalAlignment.Left;
  385. // me_message.Children.Add(button);
  386. //}
  387. }
  388. /// <summary>
  389. /// 项目
  390. /// </summary>
  391. /// <param name="sender"></param>
  392. /// <param name="e"></param>
  393. private void me_projectClick(object sender, RoutedEventArgs e)
  394. {
  395. //notificationDatas = new List<NotificationAnnouncement>();
  396. //foreach (var xiangmu in new List<string>() { "国博城项目建筑图纸更新", "北京大兴项目结构图纸更新", "绿地项目人防图纸更新" })
  397. //{
  398. // NotificationAnnouncement notificationAnnouncement = new NotificationAnnouncement();
  399. // notificationAnnouncement.Content = xiangmu;
  400. // notificationAnnouncement.MessageCategory = "项目消息";
  401. // if (xiangmu.Equals("国博城项目建筑图纸更新"))
  402. // {
  403. // notificationAnnouncement.SpecificContent = "国博城项目建筑1#楼3层更新。";
  404. // }
  405. // else if (xiangmu.Equals("北京大兴项目结构图纸更新"))
  406. // {
  407. // notificationAnnouncement.SpecificContent = "北京大兴项目结构2#楼1层墙柱平法图更新。";
  408. // }
  409. // else if (xiangmu.Equals("绿地项目人防图纸更新"))
  410. // {
  411. // notificationAnnouncement.SpecificContent = "绿地项目地下人防图更新。";
  412. // }
  413. // notificationDatas.Add(notificationAnnouncement);
  414. //}
  415. //me_message.Children.Clear();
  416. //foreach (var notificationData in notificationDatas)
  417. //{
  418. // Button button = new Button();
  419. // button.Content = notificationData.Content;
  420. // button.BorderThickness = new Thickness(0);
  421. // button.Width = 180;
  422. // button.Height = 30;
  423. // button.Click += new RoutedEventHandler(messageBtnClick);
  424. // button.Tag = notificationData;
  425. // button.HorizontalContentAlignment = HorizontalAlignment.Left;
  426. // me_message.Children.Add(button);
  427. //}
  428. }
  429. /// <summary>
  430. /// 系统
  431. /// </summary>
  432. /// <param name="sender"></param>
  433. /// <param name="e"></param>
  434. private void me_systemClick(object sender, RoutedEventArgs e)
  435. {
  436. // NotificationAnnouncement notificationAnnouncement = new NotificationAnnouncement();
  437. // notificationAnnouncement.Content = "系统更新";
  438. // notificationAnnouncement.SpecificContent = "交互平台版本更新至2.0版本· 本次更新了:· 1.主界面消息分组。· 2.修改了登陆界面。· 请及时更新!!";
  439. // notificationAnnouncement.MessageCategory = "系统消息";
  440. // NotificationAnnouncement notificationAnnouncement2 = new NotificationAnnouncement();
  441. // notificationAnnouncement2.Content = "停服升级";
  442. // notificationAnnouncement2.SpecificContent = "交互平台版本将在4月13日8点20分至4月13日8点50分进行停服更新·本次停服更新不会导致您的数据丢失。";
  443. // notificationAnnouncement2.MessageCategory = "系统消息";
  444. // notificationDatas = new List<NotificationAnnouncement>()
  445. // {
  446. // notificationAnnouncement,
  447. // notificationAnnouncement2
  448. //};
  449. // me_message.Children.Clear();
  450. // foreach (var notificationData in notificationDatas)
  451. // {
  452. // Button button = new Button();
  453. // button.Content = notificationData.Content;
  454. // button.BorderThickness = new Thickness(0);
  455. // button.Width = 180;
  456. // button.Height = 30;
  457. // button.Click += new RoutedEventHandler(messageBtnClick);
  458. // button.Tag = notificationData;
  459. // button.HorizontalContentAlignment = HorizontalAlignment.Left;
  460. // me_message.Children.Add(button);
  461. // }
  462. }
  463. /// <summary>
  464. /// 具体消息按钮
  465. /// </summary>
  466. /// <param name="sender"></param>
  467. /// <param name="e"></param>
  468. private void messageBtnClick(object sender, RoutedEventArgs e)
  469. {
  470. //me_right.Children.Clear();
  471. //Button button = sender as Button;
  472. //NotificationAnnouncement announcement = button.Tag as NotificationAnnouncement;
  473. //List<string> specificContent = announcement.SpecificContent.Split('·').ToList();
  474. //foreach (var specificConten in specificContent)
  475. //{
  476. // TextBlock textBlock = new TextBlock();
  477. // textBlock.Text = specificConten;
  478. // textBlock.FontSize = 15;
  479. // textBlock.FontFamily = new FontFamily("黑体");
  480. // me_right.Children.Add(textBlock);
  481. //}
  482. //if (announcement.MessageCategory.Equals("项目消息"))
  483. //{
  484. // DockPanel dockPanel = new DockPanel();
  485. // dockPanel.Margin = new Thickness(0, 10, 30, 0);
  486. // dockPanel.HorizontalAlignment = HorizontalAlignment.Right;
  487. // TextBlock textBlock = new TextBlock();
  488. // textBlock.Text = "查看";
  489. // textBlock.FontSize = 13;
  490. // textBlock.Foreground = new SolidColorBrush(Colors.Green);
  491. // textBlock.TextDecorations = TextDecorations.Underline;
  492. // textBlock.Margin = new Thickness(0, 0, 10, 0);
  493. // textBlock.FontFamily = new FontFamily("黑体");
  494. // textBlock.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(Message_Look);
  495. // dockPanel.Children.Add(textBlock);
  496. // TextBlock textBlock2 = new TextBlock();
  497. // textBlock2.Text = "忽略";
  498. // textBlock2.FontSize = 13;
  499. // textBlock2.FontFamily = new FontFamily("黑体");
  500. // textBlock2.Foreground = new SolidColorBrush(Colors.Green);
  501. // textBlock2.TextDecorations = TextDecorations.Underline;
  502. // textBlock2.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(Message_Ignore);
  503. // dockPanel.Children.Add(textBlock2);
  504. // me_right.Children.Add(dockPanel);
  505. //}
  506. }
  507. /// <summary>
  508. /// 查看消息
  509. /// </summary>
  510. /// <param name="sender"></param>
  511. /// <param name="e"></param>
  512. public void Message_Look(object sender, RoutedEventArgs e)
  513. {
  514. MessageBox.Show("查看消息");
  515. }
  516. /// <summary>
  517. /// 忽略消息
  518. /// </summary>
  519. /// <param name="sender"></param>
  520. /// <param name="e"></param>
  521. public void Message_Ignore(object sender, RoutedEventArgs e)
  522. {
  523. MessageBox.Show("忽略消息");
  524. }
  525. #endregion
  526. #region 项目中间部分
  527. ///// <summary>
  528. ///// 项目信息示例
  529. ///// </summary>
  530. //private ObservableCollection<LVProjectInfoEntity> lvProjects = new ObservableCollection<LVProjectInfoEntity>()
  531. //{
  532. // new LVProjectInfoEntity("项目名称:", "北京大兴项目"),
  533. // new LVProjectInfoEntity("项目业态:", "住宅"),
  534. // new LVProjectInfoEntity("项目地址:", "山东省济南市"),
  535. // new LVProjectInfoEntity("项目团队:", "项目团队")
  536. //};
  537. ///// <summary>
  538. ///// 项目信息示例
  539. ///// </summary>
  540. //private ObservableCollection<LVTeamMembersEntity> lvTeamMemberss = new ObservableCollection<LVTeamMembersEntity>()
  541. //{
  542. // new LVTeamMembersEntity("主管:", "李明"),
  543. // new LVTeamMembersEntity("建筑组员:", "李明"),
  544. // new LVTeamMembersEntity("结构组员:", "张修"),
  545. // new LVTeamMembersEntity("给排水组员:", "邢华"),
  546. // new LVTeamMembersEntity("暖通组员:", "杨程"),
  547. // new LVTeamMembersEntity("电气组员:", "欧瑞"),
  548. //};
  549. ///// <summary>
  550. ///// 项目TreeView
  551. ///// </summary>
  552. ///// <param name="sender"></param>
  553. ///// <param name="e"></param>
  554. //private void tv_projectLeftButtonUp(object sender, MouseButtonEventArgs e)
  555. //{
  556. // #region 隐藏所有的无用控件
  557. // lv_projectInfo.Visibility = Visibility.Collapsed;
  558. // sp_info.Visibility = Visibility.Collapsed;
  559. // sp_work.Visibility = Visibility.Collapsed;
  560. // sp_addPro.Visibility = Visibility.Collapsed;
  561. // #endregion
  562. // TreeViewBind treeView = tr_vw.SelectedItem as TreeViewBind;
  563. // if (treeView == null) return;
  564. // string name = treeView.Name;
  565. // if (name.Equals("项目信息"))
  566. // {
  567. // sp_info.Visibility = Visibility.Visible;
  568. // lv_projectInfo.Visibility = Visibility.Visible;
  569. // lv_projectInfo.ItemsSource = null;
  570. // lv_projectInfo.ItemsSource = lvProjects;
  571. // }
  572. // else if (name.Equals("团队成员"))
  573. // {
  574. // sp_info.Visibility = Visibility.Visible;
  575. // lv_projectInfo.Visibility = Visibility.Visible;
  576. // lv_projectInfo.ItemsSource = null;
  577. // lv_projectInfo.ItemsSource = lvTeamMemberss;
  578. // }
  579. // else if (name.Equals("工作台"))
  580. // {
  581. // sp_work.Visibility = Visibility.Visible;
  582. // tr_is.ItemsSource = null;
  583. // if (!treeView.IsPro)
  584. // {
  585. // List<TreeViewBind> TreeViewDatas = new List<TreeViewBind>();
  586. // TreeViewDatas.Add(new TreeViewBind("小学项目", new List<TreeViewBind>() { new TreeViewBind("新建图纸") }));
  587. // this.tr_is.ItemsSource = TreeViewDatas;
  588. // }
  589. // else
  590. // {
  591. // this.tr_is.ItemsSource = TreeViewDatas;
  592. // }
  593. // }
  594. // else if (name.Equals("自定义"))
  595. // {
  596. // }
  597. //}
  598. ///// <summary>
  599. ///// lv内修改按钮
  600. ///// </summary>
  601. ///// <param name="sender"></param>
  602. ///// <param name="e"></param>
  603. //private void btn_lv_update(object sender, RoutedEventArgs e)
  604. //{
  605. // Button button = sender as Button;
  606. // LVProjectInfoEntity lvProjectInfo = button.Tag as LVProjectInfoEntity;
  607. // if (lvProjectInfo != null)
  608. // {
  609. // }
  610. //}
  611. ///// <summary>
  612. ///// 上传图纸
  613. ///// </summary>
  614. ///// <param name="sender"></param>
  615. ///// <param name="e"></param>
  616. //private void Button_Click(object sender, RoutedEventArgs e)
  617. //{
  618. // TreeViewBind treeViewBind = TreeViewDatas.First(s => s.Name.Equals("小学项目 一号楼"));
  619. // UploadDrawingForm upWindow = new UploadDrawingForm(TreeViewDatas);
  620. // foreach (var item in treeViewBind.Children)
  621. // {
  622. // if (item.Name.Equals("上传新图")) continue;
  623. // upWindow.str.Add(item.Name);
  624. // }
  625. // upWindow.ShowDialog();
  626. // this.tr_is.ItemsSource = null;
  627. // this.tr_is.ItemsSource = TreeViewDatas;
  628. //}
  629. //#region 工作台
  630. ///// <summary>
  631. ///// 工作台数据绑定
  632. ///// </summary>
  633. //public static ObservableCollection<TreeViewBind> TreeViewDatas = new ObservableCollection<TreeViewBind>()
  634. //{
  635. // new TreeViewBind("小学项目 一号楼",
  636. // new List<TreeViewBind>()
  637. // {
  638. // new TreeViewBind("上传图纸")
  639. // })
  640. //};
  641. ///// <summary>
  642. ///// 版本名称
  643. ///// </summary>
  644. //private List<string> ProVersions = new List<string>();
  645. ///// <summary>
  646. ///// 本专业
  647. ///// </summary>
  648. ///// <param name="sender"></param>
  649. ///// <param name="e"></param>
  650. //private void pre_Click(object sender, MouseButtonEventArgs e)
  651. //{
  652. // tr_all.Visibility = Visibility.Collapsed;
  653. // tr_is.Visibility = Visibility.Visible;
  654. // bt_proBig.Visibility = Visibility.Collapsed;
  655. //}
  656. ///// <summary>
  657. ///// 全专业
  658. ///// </summary>
  659. ///// <param name="sender"></param>
  660. ///// <param name="e"></param>
  661. //private void all_Click(object sender, MouseButtonEventArgs e)
  662. //{
  663. // tr_is.Visibility = Visibility.Collapsed;
  664. // tr_all.Visibility = Visibility.Visible;
  665. // tv_building.ItemsSource = null;
  666. // tv_building.ItemsSource = TreeViewDatas;
  667. // bt_proBig.Visibility = Visibility.Visible;
  668. //}
  669. ///// <summary>
  670. ///// treeview点击
  671. ///// </summary>
  672. ///// <param name="sender"></param>
  673. ///// <param name="e"></param>
  674. //private void tr_is_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  675. //{
  676. // TreeViewBind treeView = tr_is.SelectedItem as TreeViewBind;
  677. // //切换展开和下拉
  678. // if (treeView == null)
  679. // {
  680. // return;
  681. // }
  682. // if (tr_is.ItemContainerGenerator.ContainerFromItem(treeView) is TreeViewItem currentItem)
  683. // {
  684. // if (!currentItem.IsExpanded)
  685. // {
  686. // currentItem.IsExpanded = true;
  687. // }
  688. // else
  689. // {
  690. // currentItem.IsExpanded = false;
  691. // }
  692. // }
  693. // if (treeView.Name.Contains("更新图纸"))
  694. // {
  695. // TreeViewBind treeViewBind = TreeViewDatas.First(s => s.Name.Equals("小学项目 一号楼"));
  696. // UploadDrawingForm upWindow = new UploadDrawingForm(TreeViewDatas);
  697. // foreach (var item in treeViewBind.Children)
  698. // {
  699. // if (item.Name.Equals("治理图纸")) break;
  700. // upWindow.str.Add(item.Name);
  701. // }
  702. // upWindow.ShowDialog();
  703. // string t7 = DateTime.Now.ToShortTimeString();
  704. // string t3 = DateTime.Now.ToLongDateString() + t7;
  705. // string proVersion = "";
  706. // if (ProVersions.Contains(t3 + "版本"))
  707. // {
  708. // int proVersionIndex = 0;
  709. // for (int i = 0; i < 100; i++)
  710. // {
  711. // int j = i + 1;
  712. // if (ProVersions.Contains(t3 + "(" + j + ")" + "版本"))
  713. // {
  714. // continue;
  715. // }
  716. // else
  717. // {
  718. // proVersionIndex = i + 1;
  719. // break;
  720. // }
  721. // }
  722. // proVersion = t3 + "(" + proVersionIndex + ")" + "版本";
  723. // }
  724. // else
  725. // {
  726. // proVersion = t3 + "版本";
  727. // }
  728. // ProVersions.Add(proVersion);
  729. // TreeViewBind TreeViewBind1 = new TreeViewBind(proVersion, new List<TreeViewBind>()
  730. // {
  731. // new TreeViewBind("原图"),
  732. // new TreeViewBind("对比图"),
  733. // new TreeViewBind("治理图纸", new List<TreeViewBind>()
  734. // {
  735. // new TreeViewBind("F1"),
  736. // new TreeViewBind("F2",
  737. // new List<TreeViewBind>()
  738. // {
  739. // new TreeViewBind("墙柱"),
  740. // new TreeViewBind("门窗"),
  741. // new TreeViewBind("功能区标签"),
  742. // new TreeViewBind("未命名")
  743. // })
  744. // })
  745. // });
  746. // int index = CollaborationUtil.GetIndexByTreeView("更新图纸", TreeViewDatas.FirstOrDefault().Children);
  747. // TreeViewDatas.FirstOrDefault().Children.Insert(index, TreeViewBind1);
  748. // this.tr_is.ItemsSource = null;
  749. // this.tr_is.ItemsSource = TreeViewDatas;
  750. // }
  751. // else if (treeView.Name.Contains("上传图纸"))
  752. // {
  753. // string t7 = DateTime.Now.ToShortTimeString();
  754. // string t3 = DateTime.Now.ToLongDateString() + t7;
  755. // ProVersions.Add(t3 + "版本");
  756. // TreeViewBind TreeViewBind1 = new TreeViewBind(t3 + "版本", new List<TreeViewBind>()
  757. // {
  758. // new TreeViewBind("原图"),
  759. // new TreeViewBind("治理图纸", new List<TreeViewBind>()
  760. // {
  761. // new TreeViewBind("F1"),
  762. // new TreeViewBind("F2",
  763. // new List<TreeViewBind>()
  764. // {
  765. // new TreeViewBind("墙柱"),
  766. // new TreeViewBind("门窗"),
  767. // new TreeViewBind("功能区标签"),
  768. // new TreeViewBind("未命名")
  769. // })
  770. // })
  771. // });
  772. // TreeViewDatas.FirstOrDefault().Children.Insert(0, TreeViewBind1);
  773. // TreeViewDatas.FirstOrDefault().Children.Add(new TreeViewBind("更新图纸"));
  774. // for (int i = 0; i < TreeViewDatas.FirstOrDefault().Children.Count; i++)
  775. // {
  776. // if (TreeViewDatas.FirstOrDefault().Children[i].Name.Equals("上传图纸"))
  777. // {
  778. // TreeViewDatas.FirstOrDefault().Children.RemoveAt(i);
  779. // i--;
  780. // break;
  781. // }
  782. // }
  783. // tr_is.ItemsSource = null;
  784. // tr_is.ItemsSource = TreeViewDatas;
  785. // }
  786. //}
  787. ///// <summary>
  788. ///// 放大
  789. ///// </summary>
  790. ///// <param name="sender"></param>
  791. ///// <param name="e"></param>
  792. //private void bt_proBigClick(object sender, RoutedEventArgs e)
  793. //{
  794. // ProjectForm projectForm = new ProjectForm(this, TreeViewDatas);
  795. // this.Hide();
  796. // projectForm.ShowDialog();
  797. // this.Show();
  798. //}
  799. //#endregion
  800. //#region 新增项目
  801. //private void bt_addPro(object sender, RoutedEventArgs e)
  802. //{
  803. // #region 隐藏所有的无用控件
  804. // lv_projectInfo.Visibility = Visibility.Collapsed;
  805. // sp_info.Visibility = Visibility.Collapsed;
  806. // sp_work.Visibility = Visibility.Collapsed;
  807. // #endregion
  808. // sp_addPro.Visibility = Visibility.Visible;
  809. //}
  810. //private void close_Click(object sender, RoutedEventArgs e)
  811. //{
  812. // gd_top.Visibility = Visibility.Collapsed;
  813. //}
  814. //private void bd_Initialized(object sender, EventArgs e)
  815. //{
  816. //}
  817. //private void st_Initialized(object sender, EventArgs e)
  818. //{
  819. //}
  820. //private void wt_Initialized(object sender, EventArgs e)
  821. //{
  822. //}
  823. //private void wm_Initialized(object sender, EventArgs e)
  824. //{
  825. //}
  826. //private void ele_Initialized(object sender, EventArgs e)
  827. //{
  828. //}
  829. //private void submit_Click(object sender, RoutedEventArgs e)
  830. //{
  831. //}
  832. //private void saveFile_Click(object sender, RoutedEventArgs e)
  833. //{
  834. //}
  835. //private void savePage_Click(object sender, RoutedEventArgs e)
  836. //{
  837. //}
  838. //private void ele_Click(object sender, RoutedEventArgs e)
  839. //{
  840. //}
  841. //private void wm_Click(object sender, RoutedEventArgs e)
  842. //{
  843. //}
  844. //private void wt_Click(object sender, RoutedEventArgs e)
  845. //{
  846. //}
  847. //private void st_Click(object sender, RoutedEventArgs e)
  848. //{
  849. //}
  850. //private void bd_Click(object sender, RoutedEventArgs e)
  851. //{
  852. //}
  853. //#endregion
  854. #endregion
  855. /// <summary>
  856. /// 青蓝小助手
  857. /// </summary>
  858. /// <param name="sender"></param>
  859. /// <param name="e"></param>
  860. private void bt_qlxzs_Click(object sender, RoutedEventArgs e)
  861. {
  862. this.Visibility = Visibility.Collapsed;
  863. StandardizedAssistantForm assistantForm = new StandardizedAssistantForm(this);
  864. assistantForm.Show();
  865. }
  866. }
  867. }