Пример #1
0
        /// <summary>
        /// Add a new User Data Field
        /// </summary>
        protected void AddUserDataField()
        {
            if (_activeItem != null)
            {
                UserDataCategory userDataCategory = _activeItem.Tag as UserDataCategory;
                UserDataField    field            = new UserDataField();
                field.Name        = "<new field>";
                field.ParentID    = userDataCategory.CategoryID;
                field.ParentScope = userDataCategory.Scope;

                // ...and display a foerm to create this new field
                FormUserDataField form = new FormUserDataField(userDataCategory, field, false);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    RefreshTab();
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Called to edit the currently selected user data field definition
        /// </summary>
        protected void EditUserDataField()
        {
            if (ulvUserData.SelectedItems.Count == 0)
            {
                return;
            }

            // Get the currently selected user data field
            if (_activeItem != null)
            {
                UserDataCategory  userDataCategory = _activeItem.Tag as UserDataCategory;
                UltraListViewItem lvi   = ulvUserData.SelectedItems[0];
                UserDataField     field = lvi.Tag as UserDataField;

                // ...and display it's properties
                FormUserDataField form = new FormUserDataField(userDataCategory, field, true);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    RefreshTab();
                }
            }
        }