SeconToolLibraryPage.xaml.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. using CollaborativePlatformMain.DFEntity.MessageSubUtil;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Shapes;
  15. namespace CollaborativePlatformMain.Form.MessageSubPage
  16. {
  17. /// <summary>
  18. /// SeconToolLibraryPage.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class SeconToolLibraryPage : Page
  21. {
  22. /// <summary>
  23. /// 块子功能
  24. /// </summary>
  25. public List<ToolFunctionEntity> BlockDatas = new List<ToolFunctionEntity>();
  26. /// <summary>
  27. /// 对比子功能
  28. /// </summary>
  29. public List<ToolFunctionEntity> ContrastDatas = new List<ToolFunctionEntity>();
  30. /// <summary>
  31. /// 二维子功能
  32. /// </summary>
  33. public List<ToolFunctionEntity> TwoDimDatas = new List<ToolFunctionEntity>();
  34. /// <summary>
  35. /// 文字子功能
  36. /// </summary>
  37. public List<ToolFunctionEntity> TextDatas = new List<ToolFunctionEntity>();
  38. public SeconToolLibraryPage()
  39. {
  40. InitializeComponent();
  41. }
  42. /// <summary>
  43. /// 窗体初始化
  44. /// </summary>
  45. /// <param name="sender"></param>
  46. /// <param name="e"></param>
  47. private void Window_Loaded(object sender, RoutedEventArgs e)
  48. {
  49. ToolFunctionEntity toolFunctionEntity1 = new ToolFunctionEntity("快速建块", @"/Image/folderImage.png", false);
  50. ToolFunctionEntity toolFunctionEntity2 = new ToolFunctionEntity("块分解", @"/Image/folderImage.png", false);
  51. ToolFunctionEntity toolFunctionEntity3 = new ToolFunctionEntity("块基点更改", @"/Image/folderImage.png", false);
  52. ToolFunctionEntity toolFunctionEntity4 = new ToolFunctionEntity("修改块颜色", @"/Image/folderImage.png", false);
  53. ToolFunctionEntity toolFunctionEntity11 = new ToolFunctionEntity("修改块名称", @"/Image/folderImage.png", false);
  54. BlockDatas = new List<ToolFunctionEntity>() { toolFunctionEntity1, toolFunctionEntity2, toolFunctionEntity3, toolFunctionEntity4, toolFunctionEntity11 };
  55. ToolFunctionEntity toolFunctionEntity5 = new ToolFunctionEntity("图纸对比", @"/Image/folderImage.png", false);
  56. ContrastDatas = new List<ToolFunctionEntity>() { toolFunctionEntity5 };
  57. ToolFunctionEntity toolFunctionEntity6 = new ToolFunctionEntity("二维审查", @"/Image/folderImage.png", false);
  58. TwoDimDatas = new List<ToolFunctionEntity>() { toolFunctionEntity6 };
  59. ToolFunctionEntity toolFunctionEntity7 = new ToolFunctionEntity("文字替换", @"/Image/folderImage.png", false);
  60. ToolFunctionEntity toolFunctionEntity8 = new ToolFunctionEntity("文字搜索", @"/Image/folderImage.png", false);
  61. ToolFunctionEntity toolFunctionEntity9 = new ToolFunctionEntity("文字合并", @"/Image/folderImage.png", false);
  62. ToolFunctionEntity toolFunctionEntity10 = new ToolFunctionEntity("文字样式补充", @"/Image/folderImage.png", false);
  63. TextDatas = new List<ToolFunctionEntity>() { toolFunctionEntity7, toolFunctionEntity8, toolFunctionEntity9, toolFunctionEntity10 };
  64. }
  65. /// <summary>
  66. /// 块处理
  67. /// </summary>
  68. /// <param name="sender"></param>
  69. /// <param name="e"></param>
  70. private void bt_bock_Click(object sender, RoutedEventArgs e)
  71. {
  72. sv_legend.ItemsSource = null;
  73. sv_legend.ItemsSource = BlockDatas;
  74. }
  75. /// <summary>
  76. /// 图纸对比
  77. /// </summary>
  78. /// <param name="sender"></param>
  79. /// <param name="e"></param>
  80. private void bt_Comparison_Click(object sender, RoutedEventArgs e)
  81. {
  82. sv_legend.ItemsSource = null;
  83. sv_legend.ItemsSource = ContrastDatas;
  84. }
  85. /// <summary>
  86. /// 二维审查
  87. /// </summary>
  88. /// <param name="sender"></param>
  89. /// <param name="e"></param>
  90. private void bt_twoReview_Click(object sender, RoutedEventArgs e)
  91. {
  92. sv_legend.ItemsSource = null;
  93. sv_legend.ItemsSource = TwoDimDatas;
  94. }
  95. /// <summary>
  96. /// 文字处理
  97. /// </summary>
  98. /// <param name="sender"></param>
  99. /// <param name="e"></param>
  100. private void bt_text_Click(object sender, RoutedEventArgs e)
  101. {
  102. sv_legend.ItemsSource = null;
  103. sv_legend.ItemsSource = TextDatas;
  104. }
  105. public SuspensionForm BaseForm = null;
  106. /// <summary>
  107. /// 添加漂浮工具
  108. /// </summary>
  109. /// <param name="sender"></param>
  110. /// <param name="e"></param>
  111. private void bt_addTools(object sender, RoutedEventArgs e)
  112. {
  113. List<ToolFunctionEntity> allToolEntitys = new List<ToolFunctionEntity>();
  114. allToolEntitys.AddRange(BlockDatas.Where(x => x.IsCheck));
  115. allToolEntitys.AddRange(ContrastDatas.Where(x => x.IsCheck));
  116. allToolEntitys.AddRange(TwoDimDatas.Where(x => x.IsCheck));
  117. allToolEntitys.AddRange(TextDatas.Where(x => x.IsCheck));
  118. if (BaseForm != null)
  119. {
  120. BaseForm.SetToolEntity(allToolEntitys);
  121. }
  122. else
  123. {
  124. BaseForm = new SuspensionForm(this, allToolEntitys);
  125. BaseForm.Show();
  126. }
  127. }
  128. private void Button_Click(object sender, RoutedEventArgs e)
  129. {
  130. }
  131. private void CheckBox_Click(object sender, RoutedEventArgs e)
  132. {
  133. }
  134. private void StackPanel_MouseDown(object sender, MouseButtonEventArgs e)
  135. {
  136. }
  137. }
  138. }