public void ChangeTypeAndFormat(SampleType newType, string newFormat, string newFormatParameters) { newFormat = SampleDataFormatHelper.NormalizeFormat(this.PropertySampleType as SampleBasicType, newFormat, true); newFormatParameters = SampleDataFormatHelper.NormalizeFormatParameters(this.PropertySampleType as SampleBasicType, newFormatParameters, true); if (this.PropertySampleType == newType && this.Format == newFormat && this.FormatParameters == newFormatParameters) { return; } if (this.PropertySampleType != newType) { this.DeclaringDataSet.ThrowIfRecursiveRootType(newType); } SampleType propertySampleType = this.PropertySampleType; string format = this.Format; string formatParameters = this.FormatParameters; this.PropertySampleType = newType; this.Format = newFormat; this.FormatParameters = newFormatParameters; this.DeclaringDataSet.OnPropertyTypeOrFormatChanged(this, propertySampleType, format, formatParameters); }
public SampleProperty AddProperty(string name, SampleType sampleType) { if (sampleType == this.DeclaringDataSet.RootType) { throw new InvalidOperationException(string.Format((IFormatProvider)CultureInfo.InvariantCulture, ExceptionStringTable.RecursiveSampleDataRootTypeNotSupported, new object[1] { (object)this.DeclaringDataSet.RootType.Name })); } if (this.GetSampleProperty(name) != null) { throw new InvalidOperationException(string.Format((IFormatProvider)CultureInfo.InvariantCulture, ExceptionStringTable.NameIsAlreadyInUse, new object[1] { (object)name })); } SampleProperty sampleProperty = new SampleProperty(name, sampleType, this); this.sampleProperties.Add(sampleProperty); this.DeclaringDataSet.OnPropertyAdded(sampleProperty); return(sampleProperty); }
public bool PushCollectionItemType(SampleType itemType) { return(this.Push(itemType, string.Empty)); }
public BuildingItem(SampleType type, string identity) { this.Type = type; this.Identity = identity; }
public DocumentNode CreateNode(SampleType sampleType) { return(!sampleType.IsBasicType ? (DocumentNode)this.CreateCompositeNode((SampleNonBasicType)sampleType) : (DocumentNode)this.CreateBasicNode((SampleBasicType)sampleType, (string)null)); }
public DocumentNode GenerateValue(SampleType sampleType) { return(!sampleType.IsBasicType ? this.GenerateNonBasicValue((SampleNonBasicType)sampleType) : this.GenerateBasicValue((SampleBasicType)sampleType, (string)null, (string)null)); }
public string GetPropertyDefaultValue(SampleProperty sampleProperty) { SampleType propertySampleType = sampleProperty.PropertySampleType; return(!propertySampleType.IsBasicType ? this.NewInstanceFieldValue.Replace(SampleCodeGenerator.PropertyTypeTemplate, propertySampleType.Name) : this.BasicTypeValues[(SampleBasicType)propertySampleType]); }
public IType CreateCollectionType(string name, IType itemType) { SampleType itemType1 = this.FromType(itemType); return((IType)this.dataSet.CreateCollectionType(name, itemType1)); }