コード例 #1
0
        private void modifyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.ActiveControl == Schedule)   // In the Schedule List
            {
                // do not modify a Day Node
                if ((mySelectedScheduleNode != null) && (mySelectedScheduleNode.Parent != null))
                {
                    if (!mySelectedScheduleNode.IsEditing)
                    {
                        Schedule.LabelEdit = true;
                        mySelectedScheduleNode.BeginEdit();
                    }
                }
                else
                {
                    Schedule.LabelEdit = false;
                }
            }
            else
            {
                try
                {
                    EditPropertyObjectReference form = new EditPropertyObjectReference((BacnetDeviceObjectPropertyReference)listReferences.SelectedItems[0].Tag);
                    form.ShowDialog();
                    listReferences.SelectedItems[0].Tag = form.ObjRef;
                    int idx = listReferences.SelectedItems[0].Index;

                    if (form.RefModified == true)
                    {
                        AddPropertyRefentry(form.ObjRef, idx);
                    }
                }
                catch { }
            }
        }
コード例 #2
0
        // Add a new entry at the right place
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.ActiveControl == Schedule)   // In the Schedule List
            {
                AddScheduleNode(new String[] { "00:00:00 = 0" });
            }
            else
            {
                BacnetDeviceObjectPropertyReference newobj = new BacnetDeviceObjectPropertyReference(new BacnetObjectId(), BacnetPropertyIds.PROP_PRESENT_VALUE);

                EditPropertyObjectReference form = new EditPropertyObjectReference(newobj);
                form.ShowDialog();

                if (form.OutOK == true)
                {
                    AddPropertyRefentry(form.ObjRef, -1);
                }
            }
        }