Exemplo n.º 1
0
        private void AssignNewValueForType()
        {
            string str = (string)null;

            if (this.cacheValue.TryGetValue(this.type, out str))
            {
                this.stringValue = str;
            }
            else
            {
                switch (this.type)
                {
                case DataStoreType.String:
                    this.stringValue = StringTable.DefaultValueDataStore;
                    break;

                case DataStoreType.Number:
                    this.stringValue = 0.ToString((IFormatProvider)CultureInfo.CurrentCulture);
                    break;

                case DataStoreType.Boolean:
                    this.stringValue = false.ToString((IFormatProvider)CultureInfo.CurrentCulture);
                    break;
                }
            }
            this.dirtyState |= DataStorePropertyEntryDirtyStates.DirtyValue;
        }
Exemplo n.º 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;
 }