Ejemplo n.º 1
0
        private void Create(NewAttributeWindow window, bool close = true)
        {
            try
            {
                this.attributesVM.CreateAttribute(this.Name, this.Type, this.IsMultivalued, this.Operation, this.IsIndexable, this.IsIndexed);

                if (close)
                {
                    window.Close();
                }
                else
                {
                    this.Name          = null;
                    this.Type          = ExtendedAttributeType.String;
                    this.IsIndexed     = false;
                    this.IsIndexable   = true;
                    this.IsMultivalued = false;
                    window.AttributeName.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Could not create the attribute\n\n" + ex.Message);
            }
        }
        public void AddAttribute()
        {
            NewAttributeWindow window          = new NewAttributeWindow();
            NewAcmaSchemaAttributeViewModel vm = new NewAcmaSchemaAttributeViewModel(window, this);

            window.DataContext = vm;
            window.ShowDialog();
        }
Ejemplo n.º 3
0
        public NewAcmaSchemaAttributeViewModel(NewAttributeWindow window, AcmaSchemaAttributesViewModel attributesVM)
            : base()
        {
            this.attributesVM = attributesVM;
            this.Name         = null;
            this.Commands.AddItem("Create", t => this.Create(window), t => this.CanCreate());
            this.Commands.AddItem("CreateAndAddNew", t => this.CreateAndAddNew(window), t => this.CanCreate());

            this.Type                 = ExtendedAttributeType.String;
            this.IsIndexable          = true;
            this.IsIndexableAllowed   = true;
            this.IsMultivaluedAllowed = true;
            this.ConfigureForAttributeType();
        }
Ejemplo n.º 4
0
 private void CreateAndAddNew(NewAttributeWindow window)
 {
     this.Create(window, false);
 }