示例#1
0
 private void method_19()
 {
     if (this.listView1.SelectedItems.Count > 0)
     {
         ListViewItem item = this.listView1.SelectedItems[0];
         IGxObject    tag  = item.Tag as IGxObject;
         if ((tag != null) && (this.igxObjectFilter_0 != null))
         {
             MyDoubleClickResult myDCRDefault = MyDoubleClickResult.myDCRDefault;
             this.igxObjectFilter_0.CanChooseObject(tag, ref myDCRDefault);
             if (myDCRDefault == MyDoubleClickResult.myDCRChooseAndDismiss)
             {
                 this.iarray_1.RemoveAll();
                 this.iarray_1.Add(tag);
                 this.ilist_0.Clear();
                 this.ilist_0.Add(tag);
                 base.DialogResult = DialogResult.OK;
                 ImageComboBoxItemEx selectedItem = this.imageComboBoxEdit1.SelectedItem as ImageComboBoxItemEx;
                 if (selectedItem.Tag != null)
                 {
                     m_pStartingLocation = (selectedItem.Tag as IGxObject).FullName;
                 }
                 base.Close();
             }
         }
     }
 }
示例#2
0
        private void method_4()
        {
            foreach (ListViewItem item in this.listView1.SelectedItems)
            {
                IGxObject tag = item.Tag as IGxObject;
                if (tag != null)
                {
                    this.iarray_1.Add(tag);
                    this.ilist_0.Add(tag);
                }
            }
            base.DialogResult = DialogResult.OK;
            ImageComboBoxItemEx selectedItem = this.imageComboBoxEdit1.SelectedItem as ImageComboBoxItemEx;

            this.igxObject_0    = selectedItem.Tag as IGxObject;
            m_pStartingLocation = this.igxObject_0.FullName;
            if (m_pStartingLocation != null)
            {
                StreamWriter writer = null;
                try
                {
                    writer = File.CreateText(this.string_1);
                    writer.WriteLine(m_pStartingLocation.ToString());
                    writer.Close();
                }
                catch (Exception)
                {
                }
            }
            base.Close();
        }
示例#3
0
        private void method_7(IGxObject igxObject_1)
        {
            ImageComboBoxItemEx ex;

            this.method_10(igxObject_1);
            this.bool_0 = false;
            if (igxObject_1.Parent is IGxCatalog)
            {
                for (int i = 0; i < this.imageComboBoxEdit1.Properties.Items.Count; i++)
                {
                    ex = this.imageComboBoxEdit1.Properties.Items[i] as ImageComboBoxItemEx;
                    if (ex.Tag == igxObject_1)
                    {
                        this.imageComboBoxEdit1.SelectedIndex = i;
                        break;
                    }
                }
            }
            else
            {
                ex =
                    this.imageComboBoxEdit1.Properties.Items[this.imageComboBoxEdit1.SelectedIndex] as
                    ImageComboBoxItemEx;
                int degree = ex.Degree;
                ex = new ImageComboBoxItemEx(igxObject_1.Name, igxObject_1.FullName, this.method_2(igxObject_1),
                                             degree + 1)
                {
                    Tag = igxObject_1
                };
                this.imageComboBoxEdit1.Properties.Items.Insert(this.imageComboBoxEdit1.SelectedIndex + 1, ex);
                this.imageComboBoxEdit1.SelectedIndex++;
            }
            this.bool_0 = true;
        }
示例#4
0
 private void CatalogView_Load(object sender, EventArgs e)
 {
     if (!base.DesignMode)
     {
         if (this.GxCatalog == null)
         {
             this.GxCatalog = new GxCatalog();
         }
         this.kTreeView1.GxCatalog = this.GxCatalog;
         this.kTreeView1.InitTreeView();
         string name = (this.GxCatalog as IGxObject).Name;
         this.imageComboBoxEdit1.Properties.SmallImages = this.imageList1;
         this.listView1.LargeImageList = this.imageList1;
         this.listView1.SmallImageList = this.imageList1;
         ImageComboBoxItemEx imageComboBoxItemEx = new ImageComboBoxItemEx(name, this.GxCatalog,
                                                                           this.GetImageIndex(this.GxCatalog as IGxObject), 0)
         {
             Tag = this.GxCatalog
         };
         this.imageComboBoxEdit1.Properties.Items.Add(imageComboBoxItemEx);
         IEnumGxObject children = (this.GxCatalog as IGxObjectContainer).Children;
         children.Reset();
         for (IGxObject i = children.Next(); i != null; i = children.Next())
         {
             imageComboBoxItemEx = new ImageComboBoxItemEx(i.Name, i.FullName, this.GetImageIndex(i), 1)
             {
                 Tag = i
             };
             this.imageComboBoxEdit1.Properties.Items.Add(imageComboBoxItemEx);
         }
         this.imageComboBoxEdit1.SelectedIndex = 0;
     }
 }
示例#5
0
        private void ComboBoxHandle()
        {
            ImageComboBoxItemEx item =
                this.imageComboBoxEdit1.Properties.Items[this.imageComboBoxEdit1.SelectedIndex] as ImageComboBoxItemEx;
            IGxObject tag = item.Tag as IGxObject;

            for (int i = this.imageComboBoxEdit1.Properties.Items.Count - 1; i > 0; i--)
            {
                item = this.imageComboBoxEdit1.Properties.Items[i] as ImageComboBoxItemEx;
                IGxObject gxObject = item.Tag as IGxObject;
                if (!(gxObject is IGxCatalog))
                {
                    if (!(gxObject.Parent is IGxCatalog))
                    {
                        if (gxObject != tag)
                        {
                            if (!this.IsAncestors(gxObject, tag))
                            {
                                this.imageComboBoxEdit1.Properties.Items.RemoveAt(i);
                            }
                        }
                    }
                }
            }
        }
示例#6
0
        private bool method_5(IGxObject igxObject_1)
        {
            ImageComboBoxItemEx ex;
            MyDoubleClickResult myDCRDefault = MyDoubleClickResult.myDCRDefault;

            if (this.igxObjectFilter_0 != null)
            {
                this.igxObjectFilter_0.CanChooseObject(igxObject_1, ref myDCRDefault);
                if (myDCRDefault == MyDoubleClickResult.myDCRChooseAndDismiss)
                {
                    return(false);
                }
            }
            else
            {
                for (int i = 0; i < this.iarray_0.Count; i++)
                {
                    (this.iarray_0.get_Element(i) as IGxObjectFilter).CanChooseObject(igxObject_1, ref myDCRDefault);
                    if (myDCRDefault == MyDoubleClickResult.myDCRChooseAndDismiss)
                    {
                        return(false);
                    }
                }
            }
            if (!(igxObject_1 is IGxObjectContainer))
            {
                return(false);
            }
            this.method_10(igxObject_1);
            this.bool_0 = false;
            if (igxObject_1.Parent is IGxCatalog)
            {
                for (int j = 0; j < this.imageComboBoxEdit1.Properties.Items.Count; j++)
                {
                    ex = this.imageComboBoxEdit1.Properties.Items[j] as ImageComboBoxItemEx;
                    if (ex.Tag == igxObject_1)
                    {
                        this.imageComboBoxEdit1.SelectedIndex = j;
                        break;
                    }
                }
            }
            else
            {
                ex =
                    this.imageComboBoxEdit1.Properties.Items[this.imageComboBoxEdit1.SelectedIndex] as
                    ImageComboBoxItemEx;
                int degree = ex.Degree;
                ex = new ImageComboBoxItemEx(igxObject_1.Name, igxObject_1.FullName, this.method_2(igxObject_1),
                                             degree + 1)
                {
                    Tag = igxObject_1
                };
                this.imageComboBoxEdit1.Properties.Items.Insert(this.imageComboBoxEdit1.SelectedIndex + 1, ex);
                this.imageComboBoxEdit1.SelectedIndex++;
            }
            this.bool_0 = true;
            return(true);
        }
示例#7
0
 private void imageComboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.bool_0)
     {
         System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
         ImageComboBoxItemEx ex =
             this.imageComboBoxEdit1.Properties.Items[this.imageComboBoxEdit1.SelectedIndex] as
             ImageComboBoxItemEx;
         IGxObject tag = ex.Tag as IGxObject;
         this.method_10(tag);
         this.method_12();
         System.Windows.Forms.Cursor.Current = Cursors.Default;
     }
 }
示例#8
0
        private void frmOpenFile_Load(object sender, EventArgs e)
        {
            if (this.igxCatalog_0 == null)
            {
                this.igxCatalog_0 = new GxCatalog();
            }
            ImageComboBoxItemEx item = new ImageComboBoxItemEx((this.igxCatalog_0 as IGxObject).Name, this.igxCatalog_0,
                                                               this.method_2(this.igxCatalog_0 as IGxObject), 0)
            {
                Tag = this.igxCatalog_0
            };

            this.imageComboBoxEdit1.Properties.Items.Add(item);
            IEnumGxObject children = (this.igxCatalog_0 as IGxObjectContainer).Children;

            children.Reset();
            for (IGxObject obj3 = children.Next(); obj3 != null; obj3 = children.Next())
            {
                item = new ImageComboBoxItemEx(obj3.Name, obj3.FullName, this.method_2(obj3), 1)
                {
                    Tag = obj3
                };
                this.imageComboBoxEdit1.Properties.Items.Add(item);
            }
            this.imageComboBoxEdit1.SelectedIndex = 0;
            this.iarray_1.RemoveAll();
            this.ilist_0.Clear();
            this.cboShowType.Properties.Items.Clear();
            for (int i = 0; i < this.iarray_0.Count; i++)
            {
                IGxObjectFilter filter = this.iarray_0.get_Element(i) as IGxObjectFilter;
                this.cboShowType.Properties.Items.Add(filter.Description);
                if (filter == this.igxObjectFilter_0)
                {
                    this.cboShowType.SelectedIndex = i;
                }
            }
            if ((this.int_0 == 0) && (this.iarray_0.Count > 1))
            {
                this.cboShowType.Properties.Items.Add("已列出的所有过滤条件");
            }
            if (this.cboShowType.SelectedIndex == -1)
            {
                this.cboShowType.SelectedIndex = this.cboShowType.Properties.Items.Count - 1;
            }
            if ((m_pStartingLocation != null) && (m_pStartingLocation is string))
            {
                this.method_3(m_pStartingLocation as string);
            }
        }
示例#9
0
        private void method_12()
        {
            ImageComboBoxItemEx ex =
                this.imageComboBoxEdit1.Properties.Items[this.imageComboBoxEdit1.SelectedIndex] as ImageComboBoxItemEx;
            IGxObject tag = ex.Tag as IGxObject;

            for (int i = this.imageComboBoxEdit1.Properties.Items.Count - 1; i > 0; i--)
            {
                ex = this.imageComboBoxEdit1.Properties.Items[i] as ImageComboBoxItemEx;
                IGxObject obj3 = ex.Tag as IGxObject;
                if ((!(obj3 is IGxCatalog) && !(obj3.Parent is IGxCatalog)) &&
                    ((obj3 != tag) && !this.method_11(obj3, tag)))
                {
                    this.imageComboBoxEdit1.Properties.Items.RemoveAt(i);
                }
            }
        }
示例#10
0
        private void cboShowType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cboShowType.SelectedIndex == this.iarray_0.Count)
            {
                this.igxObjectFilter_0 = null;
            }
            else
            {
                this.igxObjectFilter_0 = this.iarray_0.get_Element(this.cboShowType.SelectedIndex) as IGxObjectFilter;
            }
            this.method_8();
            ImageComboBoxItemEx ex =
                this.imageComboBoxEdit1.Properties.Items[this.imageComboBoxEdit1.SelectedIndex] as ImageComboBoxItemEx;
            IGxObject tag = ex.Tag as IGxObject;

            this.method_10(tag);
        }
示例#11
0
        private void btnUpper_Click(object sender, EventArgs e)
        {
            ImageComboBoxItemEx ex =
                this.imageComboBoxEdit1.Properties.Items[this.imageComboBoxEdit1.SelectedIndex] as ImageComboBoxItemEx;

            if (ex.Degree != 0)
            {
                if (ex.Degree == 1)
                {
                    this.imageComboBoxEdit1.SelectedIndex = 0;
                }
                else
                {
                    int num = this.imageComboBoxEdit1.SelectedIndex - 1;
                    this.imageComboBoxEdit1.SelectedIndex = num;
                }
            }
        }
示例#12
0
 private void method_18()
 {
     if (this.txtName.Text.Trim().Length > 0)
     {
         ImageComboBoxItemEx selectedItem = this.imageComboBoxEdit1.SelectedItem as ImageComboBoxItemEx;
         IGxObject           tag          = selectedItem.Tag as IGxObject;
         if ((tag != null) && (this.igxObjectFilter_0 != null))
         {
             bool   flag = false;
             string str  = this.txtName.Text.Trim();
             if (this.igxObjectFilter_0.CanSaveObject(tag, str, ref flag))
             {
                 this.igxObject_0 = tag;
                 this.iarray_1.RemoveAll();
                 this.ilist_0.Clear();
                 if (this.igxObjectFilter_0.Name == "GxFilterWorkspaces")
                 {
                     IWorkspaceName name = null;
                     IGxObject      unk  = null;
                     unk  = new GxDatabase();
                     name = new WorkspaceNameClass();
                     string path = (tag as IGxFile).Path + @"\" + str;
                     string str3 = System.IO.Path.GetExtension(path).ToLower();
                     if (str3 == ".mdb")
                     {
                         name.WorkspaceFactoryProgID = "esriDataSourcesGDB.AccessWorkspaceFactory";
                     }
                     else if ((str3 == ".sde") && flag)
                     {
                         name.WorkspaceFactoryProgID = "esriDataSourcesGDB.SdeWorkspaceFactory";
                     }
                     else
                     {
                         name.WorkspaceFactoryProgID = "esriDataSourcesFile.ShapefileWorkspaceFactory";
                     }
                     if (!flag)
                     {
                         if (str3 == ".mdb")
                         {
                             IWorkspaceFactory factory = new AccessWorkspaceFactory();
                             try
                             {
                                 factory.Create(System.IO.Path.GetDirectoryName(path),
                                                System.IO.Path.GetFileNameWithoutExtension(path), null, 0);
                             }
                             catch (Exception exception)
                             {
                                 MessageBox.Show(this, exception.Message);
                             }
                         }
                         else
                         {
                             Directory.CreateDirectory(path);
                         }
                     }
                     name.PathName = path;
                     (unk as IGxDatabase).WorkspaceName = name;
                     this.iarray_1.Add(unk);
                     this.ilist_0.Add(unk);
                 }
                 else
                 {
                     if (((tag is IGxFolder) || (tag is IGxDiskConnection)) || (tag is IGxDatabase))
                     {
                         this.iarray_1.Add(tag);
                         this.ilist_0.Add(tag);
                     }
                     else
                     {
                         if (!(tag is IGxDataset))
                         {
                             return;
                         }
                         if ((tag as IGxDataset).Type == esriDatasetType.esriDTFeatureDataset)
                         {
                             this.iarray_1.Add(tag);
                             this.ilist_0.Add(tag);
                         }
                     }
                     this.string_0 = this.method_17(str, this.igxObjectFilter_0);
                 }
                 base.DialogResult = DialogResult.OK;
                 if (selectedItem.Tag != null)
                 {
                     m_pStartingLocation = (selectedItem.Tag as IGxObject).FullName;
                 }
                 base.Close();
             }
         }
     }
 }
示例#13
0
 private void listView1_DoubleClick(object sender, EventArgs e)
 {
     if (this.listView1.SelectedItems.Count != 0)
     {
         MyDoubleClickResult myDCRShowChildren;
         IGxObject           tag = this.listView1.SelectedItems[0].Tag as IGxObject;
         if ((this.igxObjectFilter_0 != null) && (tag is IGxDatabase))
         {
             myDCRShowChildren = MyDoubleClickResult.myDCRShowChildren;
             this.igxObjectFilter_0.CanChooseObject(tag, ref myDCRShowChildren);
             if (myDCRShowChildren == MyDoubleClickResult.myDCRChooseAndDismiss)
             {
                 this.method_4();
                 return;
             }
         }
         if (!(tag is IGxObjectContainer))
         {
             if (tag is IGxNewDatabase)
             {
                 IWorkspaceName name;
                 IGxObject      obj3;
                 ListViewItem   item;
                 if (tag.FullName == "添加OLE DB连接")
                 {
                     try
                     {
                         string path = Environment.SystemDirectory.Substring(0, 2) +
                                       @"\Documents and Settings\Administrator\Application Data\ESRI\ArcCatalog\";
                         string str2 = path + "OLE DB Connection.odc";
                         if (Directory.Exists(path))
                         {
                             str2 = this.method_6(str2);
                             IWorkspaceFactory factory = new OLEDBWorkspaceFactoryClass();
                             name = factory.Create(path, System.IO.Path.GetFileName(str2), null, 0);
                             obj3 = new GxDatabase();
                             (obj3 as IGxDatabase).WorkspaceName = name;
                             obj3.Attach(tag.Parent, this.igxCatalog_0);
                             item = new ListViewItem(new string[] { obj3.Name, obj3.Category }, this.method_2(obj3))
                             {
                                 Tag = obj3
                             };
                             this.listView1.Items.Add(item);
                         }
                     }
                     catch (Exception exception)
                     {
                         exception.ToString();
                     }
                 }
                 else if (tag.FullName == "添加空间数据库连接")
                 {
                     frmCreateGDBConnection connection = new frmCreateGDBConnection
                     {
                         TopMost = true
                     };
                     if (connection.ShowDialog() == DialogResult.OK)
                     {
                         obj3 = new GxDatabase();
                         name = new WorkspaceNameClass
                         {
                             WorkspaceFactoryProgID = "esriDataSourcesGDB.SdeWorkspaceFactory",
                             PathName = connection.ConnectionPath
                         };
                         (obj3 as IGxDatabase).WorkspaceName = name;
                         obj3.Attach(tag.Parent, this.igxCatalog_0);
                         item = new ListViewItem(new string[] { obj3.Name, obj3.Category }, this.method_2(obj3))
                         {
                             Tag = obj3
                         };
                         this.listView1.Items.Add(item);
                     }
                 }
             }
             else
             {
                 this.method_4();
             }
         }
         else
         {
             ImageComboBoxItemEx ex;
             if (tag is IGxDataset)
             {
                 esriDatasetType type = (tag as IGxDataset).Type;
                 myDCRShowChildren = MyDoubleClickResult.myDCRShowChildren;
                 this.igxObjectFilter_0.CanChooseObject(tag, ref myDCRShowChildren);
                 if ((((type != esriDatasetType.esriDTFeatureDataset) &&
                       (type != esriDatasetType.esriDTContainer)) &&
                      ((type != esriDatasetType.esriDTRasterCatalog) &&
                       (type != esriDatasetType.esriDTCadDrawing))) &&
                     (type != esriDatasetType.esriDTRasterDataset))
                 {
                     this.method_4();
                     return;
                 }
             }
             this.method_10(tag);
             this.bool_0 = false;
             if (tag.Parent is IGxCatalog)
             {
                 for (int i = 0; i < this.imageComboBoxEdit1.Properties.Items.Count; i++)
                 {
                     ex = this.imageComboBoxEdit1.Properties.Items[i] as ImageComboBoxItemEx;
                     if (ex.Tag == tag)
                     {
                         this.imageComboBoxEdit1.SelectedIndex = i;
                         break;
                     }
                 }
             }
             else
             {
                 ex =
                     this.imageComboBoxEdit1.Properties.Items[this.imageComboBoxEdit1.SelectedIndex] as
                     ImageComboBoxItemEx;
                 int degree = ex.Degree;
                 ex = new ImageComboBoxItemEx(tag.Name, tag.FullName, this.method_2(tag), degree + 1)
                 {
                     Tag = tag
                 };
                 int selectedIndex = this.imageComboBoxEdit1.SelectedIndex;
                 this.imageComboBoxEdit1.Properties.Items.Insert(selectedIndex + 1, ex);
                 this.imageComboBoxEdit1.SelectedIndex = selectedIndex + 1;
             }
             this.bool_0 = true;
         }
     }
 }
示例#14
0
        private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            IWorkspaceName workspaceNameClass;
            IGxObject      gxDatabase;
            ListViewItem   listViewItem;

            string[]            name;
            ImageComboBoxItemEx item;

            if (this.listView1.SelectedItems.Count != 0)
            {
                IGxObject tag = this.listView1.SelectedItems[0].Tag as IGxObject;
                if (tag is IGxObjectContainer)
                {
                    this.SetListView(tag);
                    this.m_CanDo = false;
                    if (tag.Parent is IGxCatalog)
                    {
                        int num = 0;
                        while (num < this.imageComboBoxEdit1.Properties.Items.Count)
                        {
                            item = this.imageComboBoxEdit1.Properties.Items[num] as ImageComboBoxItemEx;
                            if (item.Tag != tag)
                            {
                                num++;
                            }
                            else
                            {
                                this.imageComboBoxEdit1.SelectedIndex = num;
                                break;
                            }
                        }
                    }
                    else
                    {
                        item =
                            this.imageComboBoxEdit1.Properties.Items[this.imageComboBoxEdit1.SelectedIndex] as
                            ImageComboBoxItemEx;
                        int degree = item.Degree;
                        item = new ImageComboBoxItemEx(tag.Name, tag.FullName, this.GetImageIndex(tag), degree + 1)
                        {
                            Tag = tag
                        };
                        int selectedIndex = this.imageComboBoxEdit1.SelectedIndex;
                        this.imageComboBoxEdit1.Properties.Items.Insert(selectedIndex + 1, item);
                        this.imageComboBoxEdit1.SelectedIndex = selectedIndex + 1;
                    }
                    this.m_CanDo = true;
                }
                else if (tag is IGxNewDatabase)
                {
                    if (tag.FullName == "添加OLE DB连接")
                    {
                        try
                        {
                            string str = string.Concat(Environment.SystemDirectory.Substring(0, 2),
                                                       "\\Documents and Settings\\Administrator\\Application Data\\ESRI\\ArcCatalog\\");
                            string finalFileName = string.Concat(str, "OLE DB Connection.odc");
                            if (Directory.Exists(str))
                            {
                                finalFileName = this.GetFinalFileName(finalFileName);
                                IWorkspaceFactory oLEDBWorkspaceFactoryClass = new OLEDBWorkspaceFactory();
                                workspaceNameClass = oLEDBWorkspaceFactoryClass.Create(str,
                                                                                       Path.GetFileName(finalFileName), null, 0);
                                gxDatabase = new GxDatabase();
                                (gxDatabase as IGxDatabase).WorkspaceName = workspaceNameClass;
                                gxDatabase.Attach(tag.Parent, this.GxCatalog);
                                name         = new string[] { gxDatabase.Name, gxDatabase.Category };
                                listViewItem = new ListViewItem(name, this.GetImageIndex(gxDatabase))
                                {
                                    Tag = gxDatabase
                                };
                                this.listView1.Items.Add(listViewItem);
                            }
                        }
                        catch (Exception exception)
                        {
                            exception.ToString();
                        }
                    }
                    else if (tag.FullName == "添加空间数据库连接")
                    {
                        frmCreateGDBConnection _frmCreateGDBConnection = new frmCreateGDBConnection()
                        {
                            TopMost = true
                        };
                        if (_frmCreateGDBConnection.ShowDialog() == DialogResult.OK)
                        {
                            gxDatabase         = new GxDatabase();
                            workspaceNameClass = new WorkspaceName() as IWorkspaceName;
                            workspaceNameClass.WorkspaceFactoryProgID = "esriDataSourcesGDB.SdeWorkspaceFactory";
                            workspaceNameClass.PathName = _frmCreateGDBConnection.ConnectionPath;
                            (gxDatabase as IGxDatabase).WorkspaceName = workspaceNameClass;
                            gxDatabase.Attach(tag.Parent, this.GxCatalog);
                            name         = new string[] { gxDatabase.Name, gxDatabase.Category };
                            listViewItem = new ListViewItem(name, this.GetImageIndex(gxDatabase))
                            {
                                Tag = gxDatabase
                            };
                            this.listView1.Items.Add(listViewItem);
                        }
                    }
                }
            }
        }
示例#15
0
        private void kTreeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            ImageComboBoxItemEx item;
            int num;

            if (this.m_TreeCanDo)
            {
                if (this.kTreeView1.SelectedNode != null)
                {
                    IGxObject tag = this.kTreeView1.SelectedNode.Tag as IGxObject;
                    this.BuildContextMenu(e.Node);
                    this.SetListView(tag);
                    this.m_CanDo = false;
                    this.RemoveComboBoxHandleEx();
                    if (!(tag is IGxCatalog))
                    {
                        if (tag.Parent is IGxCatalog)
                        {
                            num = 0;
                            while (num < this.imageComboBoxEdit1.Properties.Items.Count)
                            {
                                item = this.imageComboBoxEdit1.Properties.Items[num] as ImageComboBoxItemEx;
                                if (item.Tag != tag)
                                {
                                    num++;
                                }
                                else
                                {
                                    this.imageComboBoxEdit1.SelectedIndex = num;
                                    break;
                                }
                            }
                        }
                        else
                        {
                            IGxObject root = this.GetRoot(tag);
                            item = null;
                            int num1 = -1;
                            num = 0;
                            while (num < this.imageComboBoxEdit1.Properties.Items.Count)
                            {
                                item = this.imageComboBoxEdit1.Properties.Items[num] as ImageComboBoxItemEx;
                                if (item.Tag != root)
                                {
                                    num++;
                                }
                                else
                                {
                                    num1 = num;
                                    break;
                                }
                            }
                            if (num1 >= 0)
                            {
                                int       degree = item.Degree;
                                IGxObject parent = tag;
                                while (true)
                                {
                                    bool flag = true;
                                    parent = tag;
                                    while (true)
                                    {
                                        flag = true;
                                        if (parent.Parent == root)
                                        {
                                            break;
                                        }
                                        parent = parent.Parent;
                                    }
                                    int num2 = degree + 1;
                                    degree = num2;
                                    item   = new ImageComboBoxItemEx(parent.Name, parent.FullName,
                                                                     this.GetImageIndex(parent), num2)
                                    {
                                        Tag = tag
                                    };
                                    int num3 = num1 + 1;
                                    num1 = num3;
                                    this.imageComboBoxEdit1.Properties.Items.Insert(num3, item);
                                    root = parent;
                                    if (root == tag)
                                    {
                                        break;
                                    }
                                }
                                this.imageComboBoxEdit1.SelectedIndex = num1;
                            }
                        }
                        this.m_CanDo = true;
                    }
                    else
                    {
                        num = 0;
                        while (num < this.imageComboBoxEdit1.Properties.Items.Count)
                        {
                            item = this.imageComboBoxEdit1.Properties.Items[num] as ImageComboBoxItemEx;
                            if (item.Tag != tag)
                            {
                                num++;
                            }
                            else
                            {
                                this.imageComboBoxEdit1.SelectedIndex = num;
                                break;
                            }
                        }
                        this.m_CanDo = true;
                    }
                }
            }
        }
示例#16
0
        private void imageComboBoxEditEx2_SelectedIndexChanged(object sender, EventArgs e)
        {
            TreeNode            node = null;
            ImageComboBoxItemEx item =
                this.imageComboBoxEdit1.Properties.Items[this.imageComboBoxEdit1.SelectedIndex] as ImageComboBoxItemEx;
            IGxObject tag = item.Tag as IGxObject;

            if (this.m_CanDo)
            {
                Cursor.Current = Cursors.WaitCursor;
                this.SetListView(tag);
                this.ComboBoxHandle();
            }
            this.m_TreeCanDo = false;
            if (!(tag is IGxCatalog))
            {
                IGxObject root     = this.GetRoot(tag);
                TreeNode  treeNode = null;
                foreach (TreeNode node2 in this.kTreeView1.Nodes[0].Nodes)
                {
                    if (node2.Tag == root)
                    {
                        treeNode = node2;
                        break;
                    }
                }
                if (root != tag)
                {
                    TreeNode  treeNode1 = treeNode;
                    IGxObject parent    = tag;
                    while (true)
                    {
                        bool flag = true;
                        parent = tag;
                        while (true)
                        {
                            flag = true;
                            if (parent.Parent == root)
                            {
                                break;
                            }
                            parent = parent.Parent;
                        }
                        root = parent;
                        foreach (TreeNode node1 in treeNode1.Nodes)
                        {
                            if (node1.Tag == parent)
                            {
                                treeNode1 = node1;
                                break;
                            }
                        }
                        if (root == tag)
                        {
                            break;
                        }
                    }
                    this.kTreeView1.SelectedNode = treeNode1;
                }
                else
                {
                    this.kTreeView1.SelectedNode = treeNode;
                }
            }
            else
            {
                this.kTreeView1.SelectedNode = this.kTreeView1.Nodes[0];
            }
            this.m_TreeCanDo = true;
            Cursor.Current   = Cursors.Default;
        }