public Domain(Domain prototype) : base(prototype) { this._name = prototype.Name; this._fieldType = prototype.FieldType; this._mergePolicy = prototype.MergePolicy; this._splitPolicy = prototype.SplitPolicy; this._description = prototype.Description; this._owner = prototype.Owner; }
public Domain(SerializationInfo info, StreamingContext context) : base(info, context) { this._name = info.GetString(Domain.NAME); this._fieldType = (esriFieldType)Enum.Parse(typeof(esriFieldType), info.GetString(Domain.FIELDTYPE), true); this._mergePolicy = (esriMergePolicyType)Enum.Parse(typeof(esriMergePolicyType), info.GetString(Domain.MERGEPOLICYTYPE), true); this._splitPolicy = (esriSplitPolicyType)Enum.Parse(typeof(esriSplitPolicyType), info.GetString(Domain.SPLITPOLICYTYPE), true); this._description = info.GetString(Domain.DESCRIPTION); this._owner = info.GetString(Domain.OWNER); }
public static string GetSplitPolicyDisplayText(esriSplitPolicyType splitPolicy) { switch (splitPolicy) { case esriSplitPolicyType.esriSPTGeometryRatio: return("Geometry Ratio"); case esriSplitPolicyType.esriSPTDuplicate: return("Duplicate"); case esriSplitPolicyType.esriSPTDefaultValue: return("Default Value"); default: return(splitPolicy.ToString()); } }
public static IRangeDomain CreateRangeDomain([NotNull] string name, esriFieldType fieldType, [NotNull] object minValue, [NotNull] object maxValue, [CanBeNull] string description, esriSplitPolicyType splitPolicy, esriMergePolicyType mergePolicy) { Assert.ArgumentNotNullOrEmpty(name, nameof(name)); Assert.ArgumentNotNull(minValue, nameof(minValue)); Assert.ArgumentNotNull(maxValue, nameof(maxValue)); return(new RangeDomainClass { Name = name, FieldType = fieldType, Description = description, SplitPolicy = splitPolicy, MergePolicy = mergePolicy, MinValue = minValue, MaxValue = maxValue }); }
public static ICodedValueDomain CreateCodedValueDomain( [NotNull] string name, esriFieldType fieldType, [CanBeNull] string description, esriSplitPolicyType splitPolicy, esriMergePolicyType mergePolicy, params CodedValue[] values) { var result = new CodedValueDomainClass { Name = name, FieldType = fieldType, Description = description, SplitPolicy = splitPolicy, MergePolicy = mergePolicy }; foreach (CodedValue codedValue in values) { result.AddCode(codedValue.Value, codedValue.Name); } return(result); }
// // CONSTRUCTOR // public Domain(IXPathNavigable path) : base(path) { // Suspect Events this.SuspendEvents = true; XPathNavigator navigator = path.CreateNavigator(); XPathNodeIterator iterator = navigator.SelectChildren(XPathNodeType.Element); // <DomainName></DomainName> XPathNavigator navigatorDomainName = navigator.SelectSingleNode(Xml.DOMAINNAME); if (navigatorDomainName != null) { this._name = navigatorDomainName.Value; } // <FieldType></FieldType> XPathNavigator navigatorFieldType = navigator.SelectSingleNode(Xml.FIELDTYPE); if (navigatorFieldType != null) { this._fieldType = (esriFieldType)Enum.Parse(typeof(esriFieldType), navigatorFieldType.Value, true); } // <MergePolicy></MergePolicy> XPathNavigator navigatorMergePolicy = navigator.SelectSingleNode(Xml.MERGEPOLICY); if (navigatorMergePolicy != null) { this._mergePolicy = (esriMergePolicyType)Enum.Parse(typeof(esriMergePolicyType), navigatorMergePolicy.Value, true); } // <SplitPolicy></SplitPolicy> XPathNavigator navigatorSplitPolicy = navigator.SelectSingleNode(Xml.SPLITPOLICY); if (navigatorSplitPolicy != null) { this._splitPolicy = (esriSplitPolicyType)Enum.Parse(typeof(esriSplitPolicyType), navigatorSplitPolicy.Value, true); } // <Description></Description> XPathNavigator navigatorDescription = navigator.SelectSingleNode(Xml.DESCRIPTION); if (navigatorDescription != null) { this._description = navigatorDescription.Value; } // <Owner></Owner> XPathNavigator navigatorOwner = navigator.SelectSingleNode(Xml.OWNER); if (navigatorOwner != null) { this._owner = navigatorOwner.Value; } // Set Element this.Refresh(); // Resume Events this.SuspendEvents = false; }