Пример #1
0
        private void method_1()
        {
            this.bool_0        = false;
            this.txtAlias.Text = this.ifieldEdit_0.AliasName;
            this.cboAllowNull.SelectedIndex       = Convert.ToInt32(this.ifieldEdit_0.IsNullable);
            this.txtDefault.Text                  = this.ifieldEdit_0.DefaultValue.ToString();
            this.txtPrecision.Text                = this.ifieldEdit_0.Precision.ToString();
            this.txtDefault.Properties.ReadOnly   = this.bool_1;
            this.txtPrecision.Properties.ReadOnly = this.bool_1;
            this.cboAllowNull.Enabled             = !this.bool_1;
            if (ObjectClassShareData.m_IsShapeFile)
            {
                this.txtAlias.Enabled = false;
            }
            string name = "";
            int    num2 = -1;

            if (this.ifieldEdit_0.Domain != null)
            {
                name = this.ifieldEdit_0.Domain.Name;
            }
            else if (NewObjectClassHelper.m_pObjectClassHelper != null)
            {
                if (NewObjectClassHelper.m_pObjectClassHelper.FieldDomanIsExit(this.ifieldEdit_0))
                {
                    if (NewObjectClassHelper.m_pObjectClassHelper.FieldDomains[this.ifieldEdit_0] != null)
                    {
                        name = NewObjectClassHelper.m_pObjectClassHelper.FieldDomains[this.ifieldEdit_0].DomainID;
                    }
                }
                else if (NewObjectClassHelper.m_pObjectClassHelper.ObjectClass != null)
                {
                    string str2 = (NewObjectClassHelper.m_pObjectClassHelper.ObjectClass as IDataset).Name;
                    name = CodeDomainManage.GetDamainName(this.ifieldEdit_0.Name, str2);
                }
            }
            if (name.Length > 0)
            {
                for (int i = 0; i < this.cboDomain.Properties.Items.Count; i++)
                {
                    DomainWrap1 wrap = this.cboDomain.Properties.Items[i] as DomainWrap1;
                    if (this.ifieldEdit_0.Domain != null)
                    {
                        if ((wrap.Domain == null) || !(wrap.Domain.Name == name))
                        {
                            continue;
                        }
                        num2 = i;
                        break;
                    }
                    if ((wrap.DomainEx != null) && (wrap.DomainEx.DomainID == name))
                    {
                        num2 = i;
                        break;
                    }
                }
            }
            this.cboDomain.SelectedIndex = num2;
            this.bool_0 = true;
        }
Пример #2
0
        private void FieldTypeDateCtrl_Load(object sender, EventArgs e)
        {
            this.cboDomain.Properties.Items.Clear();
            try
            {
                int num = -1;
                this.cboDomain.Properties.Items.Add(new DomainWrap1());
                if (this.iworkspace_0 is IWorkspaceDomains)
                {
                    IEnumDomain domains = (this.iworkspace_0 as IWorkspaceDomains).Domains;
                    if (domains != null)
                    {
                        domains.Reset();
                        for (IDomain domain2 = domains.Next(); domain2 != null; domain2 = domains.Next())
                        {
                            if (domain2.FieldType == esriFieldType.esriFieldTypeDate)
                            {
                                this.cboDomain.Properties.Items.Add(new DomainWrap1(domain2));
                                if ((this.ifieldEdit_0.Domain != null) &&
                                    (this.ifieldEdit_0.Domain.Name == domain2.Name))
                                {
                                    num = this.cboDomain.Properties.Items.Count - 1;
                                }
                            }
                        }
                    }
                }
                string domainID = "";
                if (NewObjectClassHelper.m_pObjectClassHelper != null)
                {
                    if (NewObjectClassHelper.m_pObjectClassHelper.FieldDomains.ContainsKey(this.ifieldEdit_0))
                    {
                        if (NewObjectClassHelper.m_pObjectClassHelper.FieldDomains[this.ifieldEdit_0] != null)
                        {
                            domainID =
                                NewObjectClassHelper.m_pObjectClassHelper.FieldDomains[this.ifieldEdit_0].DomainID;
                        }
                    }
                    else if (NewObjectClassHelper.m_pObjectClassHelper.ObjectClass != null)
                    {
                        string name = (NewObjectClassHelper.m_pObjectClassHelper.ObjectClass as IDataset).Name;
                        domainID = CodeDomainManage.GetDamainName(this.ifieldEdit_0.Name, name);
                    }
                }
                using (List <CodeDomainEx> .Enumerator enumerator = CodeDomainManage.CodeDomainExs.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        CodeDomainEx current = enumerator.Current;
                        if (current.FieldType == esriFieldType.esriFieldTypeDate)
                        {
                            this.cboDomain.Properties.Items.Add(new DomainWrap1(current));
                            if (domainID == current.DomainID)
                            {
                                goto Label_01F7;
                            }
                        }
                    }
                    goto Label_021F;
Label_01F7:
                    num = this.cboDomain.Properties.Items.Count - 1;
                }
Label_021F:
                this.cboDomain.SelectedIndex = num;
            }
            catch
            {
                this.cboDomain.Enabled = false;
            }
            this.method_1();
        }
Пример #3
0
 private void FieldTypeTextCtrl_Load(object sender, EventArgs e)
 {
     this.cboDomain.Properties.Items.Clear();
     try
     {
         int num = -1;
         this.cboDomain.Properties.Items.Add(new DomainWrap1());
         if (this.iworkspace_0 is IWorkspaceDomains)
         {
             IEnumDomain domains = (this.iworkspace_0 as IWorkspaceDomains).Domains;
             if (domains != null)
             {
                 domains.Reset();
                 for (IDomain domain2 = domains.Next(); domain2 != null; domain2 = domains.Next())
                 {
                     if (domain2.FieldType == esriFieldType.esriFieldTypeString)
                     {
                         this.cboDomain.Properties.Items.Add(new DomainWrap1(domain2));
                         if ((this.ifieldEdit_0.Domain != null) &&
                             (this.ifieldEdit_0.Domain.Name == domain2.Name))
                         {
                             num = this.cboDomain.Properties.Items.Count - 1;
                         }
                     }
                 }
             }
         }
         string domainID = "";
         if (NewObjectClassHelper.m_pObjectClassHelper != null)
         {
             if (NewObjectClassHelper.m_pObjectClassHelper.FieldDomains.ContainsKey(this.ifieldEdit_0))
             {
                 if (NewObjectClassHelper.m_pObjectClassHelper.FieldDomains[this.ifieldEdit_0] != null)
                 {
                     domainID =
                         NewObjectClassHelper.m_pObjectClassHelper.FieldDomains[this.ifieldEdit_0].DomainID;
                 }
             }
             else if (NewObjectClassHelper.m_pObjectClassHelper.ObjectClass != null)
             {
                 string name = (NewObjectClassHelper.m_pObjectClassHelper.ObjectClass as IDataset).Name;
                 domainID = CodeDomainManage.GetDamainName(this.ifieldEdit_0.Name, name);
             }
         }
         foreach (CodeDomainEx ex in CodeDomainManage.CodeDomainExs)
         {
             if (ex.FieldType == esriFieldType.esriFieldTypeString)
             {
                 this.cboDomain.Properties.Items.Add(new DomainWrap1(ex));
                 if (domainID == ex.DomainID)
                 {
                     num = this.cboDomain.Properties.Items.Count - 1;
                 }
             }
         }
         this.cboDomain.SelectedIndex = num;
     }
     catch
     {
         this.cboDomain.Enabled = false;
     }
     this.method_1();
 }