Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
        //
        // 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;
        }
Ejemplo n.º 4
0
        public static string GetMergePolicyDisplayText(esriMergePolicyType mergePolicy)
        {
            switch (mergePolicy)
            {
            case esriMergePolicyType.esriMPTSumValues:
                return("Sum Values");

            case esriMergePolicyType.esriMPTAreaWeighted:
                return("Area-weighted Average");

            case esriMergePolicyType.esriMPTDefaultValue:
                return("Default Value");

            default:
                return(mergePolicy.ToString());
            }
        }
Ejemplo n.º 5
0
        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
            });
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        //
        // 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;
        }
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 9
0
 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);
 }