コード例 #1
0
        private void SetFilterValueMI_Click(object sender, EventArgs e)
        {
            try
            {
                if (EventFieldsLV.SelectedItems.Count != 1)
                {
                    return;
                }

                FilterItem field = EventFieldsLV.SelectedItems[0].Tag as FilterItem;

                if (field == null)
                {
                    return;
                }

                if (field.Declaration.InstanceDeclaration.ValueRank == ValueRanks.Scalar)
                {
                    Variant?value = new SetValueDlg().ShowDialog(field.FilterValue, field.Declaration.InstanceDeclaration.BuiltInType);

                    if (value != null)
                    {
                        field.FilterValue = value.Value;
                        EventFieldsLV.SelectedItems[0].SubItems[4].Text = value.Value.ToString();
                        EventFieldsLV.Columns[4].Width = -2;
                    }
                }
            }
            catch (Exception exception)
            {
                ClientUtils.HandleException(this.Text, exception);
            }
        }
コード例 #2
0
ファイル: ModifyFilterDlg.cs プロジェクト: yuriik83/UA-.NET
        private void SetFilterValueMI_Click(object sender, EventArgs e)
        {
            try
            {
                if (EventFieldsLV.SelectedItems.Count != 1)
                {
                    return;
                }

                FilterItem field = EventFieldsLV.SelectedItems[0].Tag as FilterItem;

                if (field == null)
                {
                    return;
                }

                if (field.Declaration.InstanceDeclaration.ValueRank == ValueRanks.Scalar)
                {
                    Variant? value = new SetValueDlg().ShowDialog(field.FilterValue, field.Declaration.InstanceDeclaration.BuiltInType);

                    if (value != null)
                    {
                        field.FilterValue = value.Value;
                        EventFieldsLV.SelectedItems[0].SubItems[4].Text = value.Value.ToString();
                        EventFieldsLV.Columns[4].Width = -2;
                    }
                }
            }
            catch (Exception exception)
            {
                ClientUtils.HandleException(this.Text, exception);
            }
        }