コード例 #1
0
        private void ChangePropertyName(DataStorePropertyEntry entry)
        {
            SampleProperty dataSetProperty = entry.DataSetProperty;

            entry.ValidatePropertyName();
            if (string.IsNullOrEmpty(entry.PropertyName))
            {
                return;
            }
            dataSetProperty.Rename(entry.PropertyName);
        }
コード例 #2
0
 public DataStorePropertyEntry(SampleDataSet dataStore, IProperty property, IList <DataStorePropertyEntry> properties)
 {
     this.dataStore             = dataStore;
     this.property              = property;
     this.stringValue           = dataStore.RootNode.GetValue <string>((IPropertyId)this.property);
     this.type                  = DataStorePropertyEntry.DataStoreTypeFromSampleProperty(dataStore.RootType.GetSampleProperty(property.Name));
     this.dirtyState            = DataStorePropertyEntryDirtyStates.None;
     this.propertyName          = property.Name;
     this.cacheValue            = new Dictionary <DataStoreType, string>();
     this.cacheValue[this.type] = this.stringValue;
     this.properties            = properties;
 }
コード例 #3
0
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            DataStorePropertyEntry storePropertyEntry = item as DataStorePropertyEntry;

            if (storePropertyEntry == null)
            {
                return((DataTemplate)null);
            }
            if (storePropertyEntry.PropertyType != DataStoreType.Boolean)
            {
                return(this.TextEditingTemplate);
            }
            return(this.BoolEditingTemplate);
        }
コード例 #4
0
        private void ChangePropertyValue(DocumentCompositeNode rootNode, DataStorePropertyEntry entry)
        {
            switch (entry.PropertyType)
            {
            case DataStoreType.String:
                rootNode.Properties[(IPropertyId)entry.Property] = (DocumentNode)rootNode.Context.CreateNode(entry.PropertyValue);
                break;

            case DataStoreType.Number:
                rootNode.Properties[(IPropertyId)entry.Property] = rootNode.Context.CreateNode(typeof(double), (object)double.Parse(entry.PropertyValue, (IFormatProvider)CultureInfo.CurrentCulture));
                break;

            case DataStoreType.Boolean:
                rootNode.Properties[(IPropertyId)entry.Property] = rootNode.Context.CreateNode(typeof(bool), (object)(bool)(bool.Parse(entry.PropertyValue) ? true : false));
                break;
            }
        }
コード例 #5
0
 private void ChangePropertyType(DataStorePropertyEntry entry)
 {
     entry.DataSetProperty.ChangeType(DataStorePropertyEntry.SampleTypeFromDataStoreType(entry.PropertyType));
 }