Exemplo n.º 1
0
        private void EditOrAddItem(CustomPropertySchemaItem schemaItem)
        {
            bool isNewItem = false;

            if (schemaItem == null)
            {
                schemaItem      = new CustomPropertySchemaItem();
                schemaItem.Type = CustomPropertyType.Boolean;
                isNewItem       = true;
            }
            CustomPropertySchemaItemEditor itemEditor = new CustomPropertySchemaItemEditor(schemaItem, isNewItem);

            if (itemEditor.ShowDialog() == DialogResult.OK)
            {
                if (isNewItem)
                {
                    if (!IsThereACustomPropertyWithThisName(schemaItem.Name.ToLower()))
                    {
                        _schema.PropertyDefinitions.Add(schemaItem);
                    }
                }
                RepopulateListView();
            }
            itemEditor.Dispose();
        }
Exemplo n.º 2
0
 private void EditOrAddItem(CustomPropertySchemaItem schemaItem)
 {
     bool isNewItem = false;
     if (schemaItem == null) 
     {
         schemaItem = new CustomPropertySchemaItem();
         schemaItem.Type = CustomPropertyType.Boolean;
         isNewItem = true;
     }
     CustomPropertySchemaItemEditor itemEditor = new CustomPropertySchemaItemEditor(schemaItem, isNewItem);
     if (itemEditor.ShowDialog() == DialogResult.OK)
     {
         if (isNewItem)
         {
             if (!IsThereACustomPropertyWithThisName(schemaItem.Name.ToLower()))
             {
                 _schema.PropertyDefinitions.Add(schemaItem);
             }
         }
         RepopulateListView();
     }
     itemEditor.Dispose();
 }