private PropertyOperation GetPropertyOperation()
        {
            var measures = GetMeasures();
            var updated  = Cluster.Create(txtPropertyValue.Text, measures);
            var cluster  = Cluster == null ? Operation <Cluster> .NewAdd(updated) : Operation <Cluster> .NewUpdate(Cluster, updated);

            var clusters = new List <Operation <Cluster> > {
                cluster
            };

            return(PropertyOperation.Create(txtPropertyName.Text, txtPropertyDescription.Text, chkDeprecated.IsChecked.GetValueOrDefault(), Epoch.UtcNow, clusters));
        }
Exemple #2
0
        public static PropertyOperation GetDeleteOperation(this Property property, HashSet <Measure> measures)
        {
            var removed = property.Clusters.FirstOrDefault(c => measures.SetEquals(c.Measures));

            if (removed == null)
            {
                return(null);
            }

            var cluster = Operation <Cluster> .NewRemove(removed);

            var clusters = new List <Operation <Cluster> > {
                cluster
            };

            return(PropertyOperation.Create(property.Key, property.Description, property.Deprecated, Epoch.UtcNow, clusters));
        }