private void EditMI_Click(object sender, EventArgs e)
        {
            try
            {
                Argument[] arguments = GetSelectedItems(typeof(Argument)) as Argument[];

                if (arguments == null || arguments.Length != 1)
                {
                    return;
                }

                object value = GuiUtils2.EditValue(m_session, arguments[0].Value, arguments[0].DataType, arguments[0].ValueRank);

                if (value != null)
                {
                    arguments[0].Value = value;
                }

                UpdateItem(ItemsLV.SelectedItems[0], arguments[0]);
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, System.Reflection.MethodBase.GetCurrentMethod(), exception);
            }
        }
        private void EditMI_Click(object sender, EventArgs e)
        {
            try
            {
                NodeField[] items = GetSelectedItems(typeof(NodeField)) as NodeField[];

                if (items != null && items.Length == 1)
                {
                    object value = GuiUtils2.EditValue(m_session, items[0].Value);

                    if (!m_readOnly)
                    {
                        if (value != null)
                        {
                            items[0].Value = value;
                            UpdateItem(ItemsLV.SelectedItems[0], items[0]);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
        private void EditValueMI_Click(object sender, EventArgs e)
        {
            try
            {
                WriteValue[] values = GetSelectedItems(typeof(WriteValue)) as WriteValue[];

                if (values == null || values.Length != 1)
                {
                    return;
                }

                NodeId datatypeId = Attributes.GetDataTypeId(values[0].AttributeId);
                int    valueRank  = Attributes.GetValueRank(values[0].AttributeId);

                if (values[0].AttributeId == Attributes.Value)
                {
                    VariableNode node = m_session.NodeCache.Find(values[0].NodeId) as VariableNode;

                    if (node != null)
                    {
                        datatypeId = node.DataType;
                        valueRank  = node.ValueRank;
                    }
                }

                object value = GuiUtils2.EditValue(m_session, values[0].Value.Value, datatypeId, valueRank);

                if (value != null)
                {
                    values[0].Value.Value           = value;
                    values[0].Value.StatusCode      = StatusCodes.Good;
                    values[0].Value.ServerTimestamp = DateTime.MinValue;
                    values[0].Value.SourceTimestamp = DateTime.MinValue;

                    UpdateItem(ItemsLV.SelectedItems[0], values[0]);

                    AdjustColumns();
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }