示例#1
0
        public void EditKeyPropertyOperation_Test()
        {
            var vertex   = new DataVertex();
            var property = new PropertyViewmodel(1, "key", "value", vertex);

            vertex.AddProperty(property);
            var ekpo = new EditKeyPropertyOperation(property, "key changed");

            ekpo.Do();

            Assert.AreEqual(property.Key, "key changed");

            ekpo.UnDo();

            Assert.AreEqual(property.Key, "key");
        }
示例#2
0
        public PropertyViewmodel AddProperty(PropertyViewmodel property = null)
        {
            if (Properties == null)
            {
                Properties = new ObservableCollection <PropertyViewmodel>();
            }

            if (property == null)
            {
                property = NewProperty();
            }

            Properties.Add(property);

            IsExpanded = true;
            DeleteCommand.RaiseCanExecuteChanged();

            return(property);
        }
 public EditKeyPropertyOperation(PropertyViewmodel property = null, string key = "")
     : base(null, property)
 {
     base.Sammary = "Edit Property Key";
     _key         = key;
 }
        public void EditValuePropertyOperation_Test()
        {
            var vertex = new DataVertex();
            var property = new PropertyViewmodel(1, "key", "value", vertex);
            vertex.AddProperty(property);
            var evpo = new EditValuePropertyOperation(property, "value changed");

            evpo.Do();

            Assert.AreEqual(property.Value, "value changed");

            evpo.UnDo();

            Assert.AreEqual(property.Value, "value");
        }
 public EditValuePropertyOperation(PropertyViewmodel property = null, string value = "")
     : base(null, property)
 {
     base.Sammary = "Edit Property Value";
     _value       = value;
 }
 public virtual void Dispose()
 {
     _property = null;
     _vertex   = null;
 }
 public PropertyOperation(DataVertex vertex, PropertyViewmodel property)
 {
     _property = property;
     _vertex   = vertex;
 }
示例#8
0
 public AddPropertyOperation(DataVertex vertex, PropertyViewmodel property = null)
     : base(vertex, property)
 {
     base.Sammary = "Add Property";
 }
示例#9
0
 private void Update(PropertyViewmodel vm)
 {
     Update(vm.OriginalKey, vm.Key, vm.Value);
 }
示例#10
0
        public PropertyViewmodel RemoveProperty(PropertyViewmodel property)
        {
            Properties.Remove(property);

            return(property);
        }
 public EditValuePropertyOperation(PropertyViewmodel property = null, string value = "")
     : base(null, property)
 {
     base.Sammary = "Edit Property Value";
     _value = value;
 }