示例#1
0
        private void LbRegister_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (Project == null)
                {
                    return;
                }
                SelectdRegister = null;

                if (lbRegister.Items.Count == 0)
                {
                    return;
                }

                int index = lbRegister.IndexFromPoint(e.X, e.Y);
                if (index > -1)
                {
                    string s = lbRegister.Items[index].ToString();
                    SelectdRegister = GetByString(s);

                    lbRegister.DoDragDrop(SelectdRegister, DragDropEffects.Move);
                }
            }
        }
示例#2
0
 private void Panel1_DragEnter(object senderInput, DragEventArgs e)
 {
     if ((e.AllowedEffect & DragDropEffects.Move) == 0)
     {
         // Not a Move. Do not allow it.
         e.Effect = DragDropEffects.None;
     }
     else
     {
         OIDRegister drag_item = (OIDRegister)e.Data.GetData(typeof(OIDRegister));
         if (drag_item != null)
         {
             // Allow it.
             e.Effect = DragDropEffects.Move;
             return;
         }
         string di = (string)e.Data.GetData(typeof(string));
         if (di != null)
         {
             // Allow it.
             e.Effect = DragDropEffects.Move;
             return;
         }
     }
 }
 private void DeleteRegister(OIDRegister oIDRegister)
 {
     foreach (var item in Project.nodeSetups)
     {
         var s     = typeof(RegisterNode).ToString();
         var token = item.Setup.Where(x => x.ContainsKey("MyType") && x["MyType"].ToString() == s)
                     .Where(y => y.ContainsKey("Register") && y["Register"].ToString() == oIDRegister.Name).ToList();
         for (int i = 0; i < token.Count; i++)
         {
             item.Setup.Remove(token[i]);
         }
     }
 }
 private void RenameRegister(OIDRegister old, OIDRegister newreg)
 {
     foreach (var item in Project.nodeSetups)
     {
         var s     = typeof(RegisterNode).ToString();
         var token = item.Setup.Where(x => x.ContainsKey("MyType") && x["MyType"].ToString() == s).ToList();
         foreach (var t in token)
         {
             if (t.ContainsKey("Register") && t["Register"].ToString() == old.Name)
             {
                 t["Register"] = newreg.Name;
             }
         }
     }
 }
示例#5
0
        private void Panel1_DragDrop(object sender, DragEventArgs e)
        {
            OIDRegister drag_item = (OIDRegister)e.Data.GetData(typeof(OIDRegister));

            if (drag_item != null)
            {
                AddNode(new RegisterNode(drag_item));
                RaiseUpdatePanelEvent(new EventArgs());
                return;
            }

            string di = (string)e.Data.GetData(typeof(string));

            if (di != null && Nodes.ContainsKey(di))
            {
                AddNode(GetInstance(Nodes[di]));
                RaiseUpdatePanelEvent(new EventArgs());
            }
        }
示例#6
0
        private void LbFunctions_MouseDown(object sender, MouseEventArgs e)
        {
            if (Project == null)
            {
                return;
            }
            SelectdRegister = null;

            if (lbFunctions.Items.Count == 0)
            {
                return;
            }

            int index = lbFunctions.IndexFromPoint(e.X, e.Y);

            if (index > -1)
            {
                string s = lbFunctions.Items[index].ToString();

                lbFunctions.DoDragDrop(s, DragDropEffects.Move);
            }
        }
示例#7
0
        public OIDTimer(OIDRegister sourceNode, ushort value)
        {
            SourceNode = sourceNode ?? throw new ArgumentNullException(nameof(sourceNode));

            Value = value;
        }
 public OIDConditionOID(OIDRegister sourceNode, BoolOperators @operator, OIDRegister value)
 {
     SourceNode = sourceNode ?? throw new ArgumentNullException(nameof(sourceNode));
     Operator   = @operator;
     Value      = value;
 }
 public OIDActionValue(OIDRegister sourceNode, MathOperators @operator, ushort value)
 {
     SourceNode = sourceNode ?? throw new ArgumentNullException(nameof(sourceNode));
     Operator   = @operator;
     Value      = value;
 }
示例#10
0
 public OIDNode(OIDRegister p)
 {
     OIDParent    = p.ToString();
     oIDSequences = new List <string>();
 }