Exemplo n.º 1
0
 public CustomToolStripMenuItem(Classes.IToolTipText toolTipText, FlowDrawPanel panel, ToolTip tooltip, string text)
     : base(text)
 {
     this.panel        = panel;
     this.toolTip      = tooltip;
     CustomToolTipText = toolTipText;
     Initialize();
 }
Exemplo n.º 2
0
 public CustomToolStripMenuItem(FlowSourceDumper dumper, FlowDrawPanel panel, ToolTip tooltip, string text)
     : base(text)
 {
     this.panel        = panel;
     this.toolTip      = tooltip;
     CustomToolTipText = dumper;
     Dumper            = dumper;
     Initialize();
 }
Exemplo n.º 3
0
 public void ChangeFlowSource(FlowDrawPanel flowDrawPanel, FlowSourceObjectBase source, Dictionary <string, string> data)
 {
     this.currentFlowDrawPanel = flowDrawPanel;
     try
     {
         while (dataGridView1.RowCount > 0)
         {
             if (dataGridView1[1, dataGridView1.RowCount - 1] is ExDataGridViewComboBoxCell exCell)
             {
                 exCell.ResetEvent();
             }
             dataGridView1.RowCount--;
         }
         if (flowDrawPanel != null && source != null && data != null)
         {
             foreach (CustomMemberInfo <PropertyInfo> propertyInfo in source.InProperties)
             {
                 var row  = new DataGridViewRow();
                 var cell = new DataGridViewTextBoxCell
                 {
                     Value       = propertyInfo.MemberInfo.Name,
                     ToolTipText = propertyInfo.ToolTipText
                 };
                 row.Cells.Add(cell);
                 var formatter          = TypeFormatterManager.GetFormatter(propertyInfo.MemberInfo.PropertyType);
                 DataGridViewCell cell2 = null;
                 if (formatter != null)
                 {
                     if (formatter.AllowedPropertyString != null && formatter.AllowedPropertyString.Length > 0)
                     {
                         var exCell = new ExDataGridViewComboBoxCell();
                         cell2 = exCell;
                         exCell.Items.AddRange(formatter.AllowedPropertyString);
                         exCell.Value = formatter.AllowedPropertyString[0];
                         row.Cells.Add(cell2);
                         this.dataGridView1.Rows.Add(row);
                         exCell.SetEvent();
                     }
                     else
                     {
                         if (CanValueButtonClick(source.Name, propertyInfo.MemberInfo.Name, propertyInfo.MemberInfo.PropertyType))
                         {
                             var buttonCell = new ButtonCell(source.Name, propertyInfo.MemberInfo.Name, propertyInfo.MemberInfo.PropertyType);
                             buttonCell.ButtonClick += buttonCell_ButtonClick;
                             cell2 = buttonCell;
                         }
                         else
                         {
                             cell2 = new DataGridViewTextBoxCell();
                         }
                         row.Cells.Add(cell2);
                         this.dataGridView1.Rows.Add(row);
                     }
                     if (data.ContainsKey(propertyInfo.MemberInfo.Name))
                     {
                         cell2.Value = data[propertyInfo.MemberInfo.Name];
                     }
                     cell2.ReadOnly = false;
                     cell2.Tag      = formatter;
                 }
                 else
                 {
                     cell2 = new DataGridViewTextBoxCell();
                     row.Cells.Add(cell2);
                     cell2.ReadOnly = true;
                     this.dataGridView1.Rows.Add(row);
                 }
             }
         }
     }
     catch (Exception)
     {
     }
 }