예제 #1
0
 public redactorPP(object parentF, object parentM, string namePort1, string namePort2)
 {
     parentManager = (cnManager)parentM;
     parent        = (connectFormPP)parentF;
     InitializeComponent();
     portName1.Text = namePort1;
     portName2.Text = namePort2;
     this.SetStyle(ControlStyles.OptimizedDoubleBuffer |
                   ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
     this.UpdateStyles();
 }
예제 #2
0
 public cnManager(Port port1, Port port2, System.Windows.Forms.UserControl parent)
 {
     this.parent = parent;
     assign      = new SortedList <int, int>();
     if (port1.bus)
     {
         if (port2.bus)
         {
             connectFormPP cf = new connectFormPP(port1, port2, this);
             cf.ShowDialog();
             if (assign.Count == 0)
             {
                 resultOk = false;
             }
         }
         else
         {
             connectForm1 cf = new connectForm1(port1.LeftBusBound, port1.RightBusBound, this, false);
             cf.ShowDialog();
             if (assign.Count == 0)
             {
                 resultOk = false;
             }
         }
     }
     else
     if (port2.bus)
     {
         connectForm1 cf = new connectForm1(port2.LeftBusBound, port2.RightBusBound, this, true);
         cf.ShowDialog();
         if (assign.Count == 0)
         {
             resultOk = false;
         }
     }
     else
     {
         assign.Add(0, 0);
         resultOk = true;
         if (assign.Count == 0)
         {
             resultOk = false;
         }
     }
 }