public GSEditor_StrobLine(Canvas can, Strob strob, TextBox tbName, TextBox tbSdw, TextBox tbDlit) { try { TBName = tbName; TBSdw = tbSdw; TBSdw.PreviewTextInput += TBSdw_PreviewTextInput; TBSdw.TextChanged += TBSdw_TextChanged; TBDlit = tbDlit; TBDlit.PreviewTextInput += TBDlit_PreviewTextInput; TBDlit.TextChanged += TBDlit_TextChanged; Can = can; Can.Loaded += Can_Loaded; Can.MouseLeftButtonDown += Can_MouseLeftButtonDown; Can.MouseMove += Can_MouseMove; Can.MouseLeave += Can_MouseLeave; Can.ToolTip = TTCan; Strob = strob; ChType = Change.Zero; } catch (Exception Ex) { Error Err = new Error(0, FileNameForErr, ClassNameForErr, "GSEditor_StrobLine", Ex.ToString()); if (App.isDebugMode) MessageBox.Show(Err.ToString()); else Error.Add(Err); } }
// Creating new StrobLine void New_Strob(Strob Strob) { try { int ItemHeight = Settings_GenStrobEditor.ItemHeight; //------------ Название ---------------------------------------------------- TextBox TBStrobName = new TextBox { Text = Strob.Name, VerticalAlignment = VerticalAlignment.Center, ContextMenu = CMStrobs}; LBStrobName.Items.Add(new ListBoxItem { Height = ItemHeight, Content = TBStrobName, ContextMenu = CMStrobs, BorderBrush = Brushes.Gray }); //------------ Сдвиг ---------------------------------------------------- TextBox TBStrobSdw = new TextBox { Text = Strob.Sdw.ToString(), VerticalAlignment = VerticalAlignment.Center, ContextMenu = CMStrobs }; LBStrobSdw.Items.Add(new ListBoxItem { Height = ItemHeight, Content = TBStrobSdw, ContextMenu = CMStrobs, BorderBrush = Brushes.Gray }); //------------ Длительность ---------------------------------------------------- TextBox TBStrobDlit = new TextBox { Text = Strob.Dlit.ToString(), VerticalAlignment = VerticalAlignment.Center, ContextMenu = CMStrobs }; LBStrobDlit.Items.Add(new ListBoxItem { Height = ItemHeight, Content = TBStrobDlit, ContextMenu = CMStrobs, BorderBrush = Brushes.Gray }); //------------ Редактор ------------------------------------------------------- Canvas Can = new Canvas { Background = Brushes.Black, Height = ItemHeight - 3 }; LBStrobCans.Items.Add(new ListBoxItem { ContextMenu = CMCanvas, Height = ItemHeight, Content = Can }); StrobLines.Add(new GSEditor_StrobLine(Can, Strob, TBStrobName, TBStrobSdw, TBStrobDlit)); } catch (Exception Ex) { Error Err = new Error(0, FileNameForErr, ClassNameForErr, "New_Strob", Ex.ToString()); if (App.isDebugMode) System.Windows.MessageBox.Show(Err.ToString()); else Error.Add(Err); } }
public void Add(Strob Strob) { Strobs.Add(Strob); }