Beispiel #1
0
        private void lvwResults_DoubleClick(object sender, System.EventArgs e)
        {
            if (lvwResults.SelectedItems.Count == 1)
            {
                ListViewItem item = lvwResults.SelectedItems[0];

                // If there is an exception or extra information then show it.

                Result result = item.Tag as Result;
                if (result != null)
                {
                    if (result.Exception != null)
                    {
                        new ExceptionDialog(result.Exception, "The following exception has occurred:").ShowDialog();
                    }
                    else if (result.ExtraInfo != null)
                    {
                        EditorDialog dialog = new EditorDialog();
                        dialog.CurrentEditorType = typeof(BasicTypeEditor);
                        dialog.DisplayValue(result.ExtraInfo);
                        dialog.ShowDialog();
                    }
                }
            }
        }
Beispiel #2
0
        public override void OnDoubleClick(Object sender, EventArgs e)
        {
            DrawArea drawArea = (DrawArea)sender;
            EditorDialog dlg = new EditorDialog(_logicIDTail, this, "", drawArea.GraphicsList.BomVerify, DeviceTypeEnum.BOM, DeviceTypeEnum.BOM, drawArea.GraphicsList.IPVerify);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (this._tagIDBase != 0)
                {
                    drawArea.GraphicsList.BomVerify.Remove(_logicIDTail);
                }
                _logicIDTail = dlg.IDvalues;

                this.x_axis = dlg.X_axis;
                this.y_axis = dlg.Y_axis;
                this.width = dlg.RWidth;
                this.height = dlg.RHeight;
                RecID = dlg.RecID;
                DeviceID = dlg.DeviceID;
                DeviceName = dlg.DeviceName;
                IpAdd = dlg.IpAdd;
                this.Device_H = dlg.Device_H;
                this.Device_W = dlg.Device_W;
                if (_tagIDBase == 0)
                    _flag = _objIdInc++;
                if (drawArea.AddText(this))
                {
                    _tagIDBase = _flag;
                    this.SetRectangle(x_axis, y_axis, width, height);
                    drawArea.SetDirty();
                    drawArea.Refresh();
                }
            }
        }
        private void m_exploreButton_Click(object sender, System.EventArgs e)
        {
            EditorDialog dialog = new EditorDialog(m_collectonType, m_creator);

            dialog.JsonString = JsonValue;
            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                JsonValue = dialog.JsonString;
            }
        }
Beispiel #4
0
        public override void OnDoubleClick(Object sender, EventArgs e)
        {
            DrawArea     drawArea = (DrawArea)sender;
            EditorDialog dlg      = new EditorDialog(logicIDTail, this, "", drawArea.GraphicsList.TVMVerify, DeviceTypeEnum.TVM, DeviceTypeEnum.TVM, drawArea.GraphicsList.IPVerify);

            dlg.ArrayId = arrayId;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (this.TagIDBase != 0)
                {
                    drawArea.GraphicsList.TVMVerify.Remove(logicIDTail);
                }
                logicIDTail   = dlg.IDvalues;
                arrayId       = dlg.ArrayId;
                this.x_axis   = dlg.X_axis;
                this.y_axis   = dlg.Y_axis;
                this.width    = dlg.RWidth;
                this.height   = dlg.RHeight;
                RecID         = dlg.RecID;
                StationID     = dlg.StationID;
                DeviceID      = dlg.DeviceID;
                DeviceName    = dlg.DeviceName;
                IpAdd         = dlg.IpAdd;
                DeviceType    = dlg.DeviceType;
                DeviceSubType = dlg.DeviceSubType;
                GroupID       = dlg.GroupID;
                this.Device_H = dlg.Device_H;
                this.Device_W = dlg.Device_W;
                if (TagIDBase == 0)
                {
                    flag = objIdInc++;
                }
                if (drawArea.AddText(this))
                {
                    TagIDBase = flag;//与颜色变化有关

                    this.SetRectangle(x_axis, y_axis, width, height);
                    drawArea.SetDirty();
                    drawArea.SetDirty();
                }
            }
        }
Beispiel #5
0
        public override void OnDoubleClick(Object sender, EventArgs e)
        {
            string entryValue;

            if (_entry == EDirection.Left)
            {
                entryValue = "Left";
            }
            else if (_entry == EDirection.Right)
            {
                entryValue = "Right";
            }
            else if (_entry == EDirection.Up)
            {
                entryValue = "Up";
            }
            else
            {
                entryValue = "Down";
            }

            DrawArea drawArea = (DrawArea)sender;

            EditorDialog dlg = new EditorDialog(_logicIDTail, this, entryValue, drawArea.GraphicsList.AGMVerify, DeviceTypeEnum.AGM, DeviceTypeEnum.AGM_Sub_AGMChannelDual, drawArea.GraphicsList.IPVerify);

            // dlg.ArrayId = arrayId;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (this._tagIDBase != 0)
                {
                    drawArea.GraphicsList.AGMVerify.Remove(_logicIDTail);
                }
                _logicIDTail = dlg.IDvalues;
                arrayId      = dlg.ArrayId;
                this.x_axis  = dlg.X_axis;
                this.y_axis  = dlg.Y_axis;
                this.width   = dlg.RWidth;
                this.height  = dlg.RHeight;

                RecID         = dlg.RecID;
                StationID     = dlg.StationID;
                DeviceID      = dlg.DeviceID;
                DeviceName    = dlg.DeviceName;
                IpAdd         = dlg.IpAdd;
                DeviceType    = dlg.DeviceType;
                DeviceSubType = dlg.DeviceSubType;
                GroupID       = dlg.GroupID;
                this.Device_H = dlg.Device_H;
                this.Device_W = dlg.Device_W;

                if (dlg.Entryvalues == "Left")
                {
                    this.Entry = EDirection.Left;
                }
                else if (dlg.Entryvalues == "Right")
                {
                    this.Entry = EDirection.Right;
                }
                else if (dlg.Entryvalues == "Up")
                {
                    this.Entry = EDirection.Up;
                }
                else
                {
                    this.Entry = EDirection.Down;
                }

                if (_tagIDBase == 0)
                {
                    _flag = _objIdInc++;
                }
                if (drawArea.AddText(this))
                {
                    _tagIDBase = _flag;

                    this.SetRectangle(x_axis, y_axis, width, height);
                    drawArea.SetDirty();
                    drawArea.Refresh();
                }
            }
        }
        private void buttonAdd_Click(object sender, System.EventArgs e)
        {
            var tag = new Tag {HighlightColor = Color.Blue};
            using (var dialog = new EditorDialog<Tag>())
                dialog.ShowDialog(this, tag);

            if (string.IsNullOrEmpty(tag.Name)) Msg.Inform(this, "Tag name cannot be empty.", MsgSeverity.Warn);
            else if (TreeView.Nodes.Contains(tag.Name)) Msg.Inform(this, "Tag name already used.", MsgSeverity.Warn);
            else AddTag(tag);
        }