public void Add(IGxObjectFilter igxObjectFilter_0) { if (igxObjectFilter_0 != null) { this.iarray_0.Add(igxObjectFilter_0); } }
public void Add(IGxObjectFilter igxObjectFilter_1) { if (igxObjectFilter_1 != null) { this.iarray_1.Add(igxObjectFilter_1); } }
private string CheckExtension(string string_2, IGxObjectFilter igxObjectFilter_1) { string str = ""; string name = igxObjectFilter_1.Name; if (name != null) { if (!(name == "RasterFormatTifFilter")) { if (name == "RasterFormatImgFilter") { str = ".img"; } } else { str = ".tif"; } } if (str == "") { return(string_2); } int num = string_2.LastIndexOf("."); if ((num != -1) && (string_2.Substring(num + 1).ToLower() != "tif")) { return(string_2 + str); } return(string_2 + str); }
// Creates Dialog on first call and init filter private void InitAddressLocatorDlg() { if (m_dlgAddressLocator == null) { // Create Address Locator Dialog m_dlgAddressLocator = new GxDialogClass(); IGxObjectFilter filter = null; filter = new GxFilterAddressLocatorsClass(); m_dlgAddressLocator.ObjectFilter = filter; m_dlgAddressLocator.Title = "Add Address Locator"; } }
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); } }
private void frmExplorerData_Load(object sender, EventArgs e) { if (_gxCatalog == null) { _gxCatalog = new GxCatalog(); } GISDataComboItem item = new GISDataComboItem((_gxCatalog as IGxObject).Name, (_gxCatalog as IGxObject).Name, this.GetImageIndex(this._gxCatalog as IGxObject), 0) { Tag = _gxCatalog }; gisDataComboBox1.Items.Add(item); IEnumGxObject children = (this._gxCatalog as IGxObjectContainer).Children; children.Reset(); for (IGxObject subObj = children.Next(); subObj != null; subObj = children.Next()) { item = new GISDataComboItem(subObj.Name, subObj.FullName, this.GetImageIndex(subObj), 1) { Tag = subObj }; this.gisDataComboBox1.AddChildNode(item); } gisDataComboBox1.SelectedIndex = 0; this._array2.RemoveAll(); this._gxObjects.Clear(); this.cboShowType.Items.Clear(); for (int i = 0; i < this._filterArray.Count; i++) { IGxObjectFilter filter = this._filterArray.Element[i] as IGxObjectFilter; this.cboShowType.Items.Add(filter.Description); if (filter == this._gxObjectFilter) { this.cboShowType.SelectedIndex = i; } } if ((this._modalType == 0) && (this._filterArray.Count > 1)) { this.cboShowType.Items.Add("已列出的所有过滤条件"); } if (this.cboShowType.SelectedIndex == -1) { this.cboShowType.SelectedIndex = this.cboShowType.Items.Count - 1; } if ((_pStartLocation != null) && (_pStartLocation is string)) { this.LoadViewer(_pStartLocation as string); } }
public static IGxObject OpenArcFile(IGxObjectFilter objectFilter, string Caption) { IGxDialog fileChooser = new GxDialogClass(); IEnumGxObject chosenFiles = null; fileChooser.Title = Caption; fileChooser.ButtonCaption = "Select"; fileChooser.AllowMultiSelect = false; fileChooser.ObjectFilter = objectFilter; fileChooser.DoModalOpen(0, out chosenFiles); chosenFiles.Reset(); return(chosenFiles.Next()); }
// Creates Dialog on first call and init filter private void InitBarriersDlg() { if (m_dlgBarriers == null) { // Create Barriers dialog m_dlgBarriers = new GxDialogClass(); IGxObjectFilter objFilter = null; objFilter = new GxFilterFeatureDatasetsAndFeatureClassesClass(); m_dlgBarriers.ObjectFilter = objFilter; m_dlgBarriers.Title = "Choose Barriers Layer"; } }
private void cboShowType_SelectedIndexChanged(object sender, EventArgs e) { if (this.cboShowType.SelectedIndex == _filterArray.Count) { this._gxObjectFilter = null; } else { this._gxObjectFilter = _filterArray.Element[this.cboShowType.SelectedIndex] as IGxObjectFilter; } ClearViewer(); GISDataComboItem item = gisDataComboBox1.Items[gisDataComboBox1.SelectedIndex] as GISDataComboItem; IGxObject linkTag = item.Tag as IGxObject; LoadViewer(linkTag); }
/// <summary> /// Busca una Capa Raster /// </summary> /// <returns></returns> private string BuscarRaster(string titulo) { IGxDialog pGxDialog = new GxDialogClass(); pGxDialog.AllowMultiSelect = false; IGxObjectFilter pGxFilter = (IGxObjectFilter) new GxFilterRasterDatasetsClass(); pGxDialog.ObjectFilter = pGxFilter; pGxDialog.Title = titulo; IEnumGxObject pEnumGxObj; if (pGxDialog.DoModalOpen(0, out pEnumGxObj)) { return(pEnumGxObj.Next().FullName); } return(""); }
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); }
/// <summary> /// Open the add data dialog. /// </summary> /// <param name="sCaption">Caption of the dialog.</param> /// <param name="pFilter">Dataset filters.</param> /// <param name="bMultiSelect">Allow for multiple selections.</param> /// <returns></returns> private string OpenGXDialog(string sCaption, IGxObjectFilter pFilter, bool bMultiSelect) { IGxDialog pBrowse = new GxDialogClass(); IEnumGxObject pSelect = null; IGxObject pObject = null; IGxCatalog pCatalog = pBrowse.InternalCatalog; string sFile = ""; try { //set up the filters //setup the browse window pBrowse.AllowMultiSelect = bMultiSelect; pBrowse.Title = sCaption; pBrowse.ObjectFilter = pFilter; //!!!this should be written to read a filter collection, but throws a COM QI error pBrowse.RememberLocation = true; //open the browse window and get the selected file info if (pBrowse.DoModalOpen(0, out pSelect)) { pObject = pSelect.Next(); while (pObject != null) { sFile += pObject.FullName + ";"; pObject = pSelect.Next(); } //pInternalName = (IGxObjectInternalName) pObject; //pName = (IName) pInternalName.InternalObjectName; //remove the last semi colon if (sFile.Length > 0) { sFile = sFile.Substring(0, sFile.Length - 1); } } return(sFile); } catch (Exception oErr) { MessageBox.Show(oErr.ToString(), "Data Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(null); } }
public void AddFilter(IGxObjectFilter objectFilter, bool isSelect) { for (int i = 0; i < _filterArray.Count; i++) { IGxObjectFilter filter = _filterArray.Element[i] as IGxObjectFilter; if (filter.Name != objectFilter.Name) { if (isSelect) { this._gxObjectFilter = filter; } return; } } _filterArray.Add(objectFilter); if (isSelect) { this._gxObjectFilter = objectFilter; } }
public void AddFilter(IGxObjectFilter igxObjectFilter_1, bool bool_2) { for (int i = 0; i < this.iarray_0.Count; i++) { IGxObjectFilter filter = this.iarray_0.get_Element(i) as IGxObjectFilter; if (filter.Name == igxObjectFilter_1.Name) { if (bool_2) { this.igxObjectFilter_0 = filter; } return; } } this.iarray_0.Add(igxObjectFilter_1); if (bool_2) { this.igxObjectFilter_0 = igxObjectFilter_1; } }
protected override void OnClick() { // set m_pApp = (IGxApplication)CustomGxFilter_CS.ArcCatalog.Application; IGxCatalog pCat = null; IGxFileFilter pFileFilter = null; IEnumGxObject pSelection = null; IGxDialog pDlg = null; IGxObjectFilter pFilter = null; try { pDlg = new GxDialog(); pCat = pDlg.InternalCatalog; pFileFilter = pCat.FileFilter; if (pFileFilter.FindFileType("py") < 0) { //enter the third parameter with the location of the icon as needed pFileFilter.AddFileType("PY", "Python file", ""); } pFilter = new CustomGxFilter_CS.CustomFilter(); pDlg.ObjectFilter = pFilter; pDlg.Title = "Please select a .Py file"; pDlg.AllowMultiSelect = true; pDlg.DoModalOpen(0, out pSelection); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.ToString()); } finally { pCat = null; pFileFilter = null; pSelection = null; pDlg = null; pFilter = null; } }
private void LoadViewer(IGxObject gxObject) { Cursor = Cursors.WaitCursor; string[] items = new string[2]; ClearViewer(); if (gxObject is IGxObjectContainer) { if (gxObject is IGxDatabase) { if (!(gxObject as IGxDatabase).IsConnected) { (gxObject as IGxDatabase).Connect(); } if (!(gxObject as IGxDatabase).IsConnected) { return; } } else if (gxObject is IGxAGSConnection) { if (!(gxObject as IGxAGSConnection).IsConnected) { (gxObject as IGxAGSConnection).Connect(); } if (!(gxObject as IGxAGSConnection).IsConnected) { return; } } IEnumGxObject children = (gxObject as IGxObjectContainer).Children; children.Reset(); IGxObject subObj = children.Next(); bool canDisplay = true; while (subObj != null) { if (subObj is IGxNewDatabase) { canDisplay = true; } else if (_gxObjectFilter != null) { canDisplay = _gxObjectFilter.CanDisplayObject(subObj); } else { for (int i = 0; i < _filterArray.Count; i++) { IGxObjectFilter filter = _filterArray.Element[i] as IGxObjectFilter; if (canDisplay = filter.CanDisplayObject(subObj)) { break; } } } if (canDisplay) { items[0] = subObj.Name; items[1] = subObj.Category; ListViewItem item = new ListViewItem(items, GetImageIndex(subObj)) { Tag = subObj }; listView1.Items.Add(item); } subObj = children.Next(); } } Cursor = Cursors.Default; }
public static IGxObject OpenArcFile(IGxObjectFilter objectFilter, string Caption) { IGxDialog fileChooser = new GxDialogClass(); IEnumGxObject chosenFiles = null; fileChooser.Title = Caption; fileChooser.ButtonCaption = "Select"; fileChooser.AllowMultiSelect = false; fileChooser.ObjectFilter = objectFilter; fileChooser.DoModalOpen(0, out chosenFiles); chosenFiles.Reset(); return chosenFiles.Next(); }
public CustomFilter() { m_pBasicFilter = new GxFilterBasicTypesClass(); }
private void method_10(IGxObject igxObject_1) { System.Windows.Forms.Cursor.Current = Cursors.WaitCursor; string[] items = new string[2]; this.method_8(); if (igxObject_1 is IGxObjectContainer) { if (igxObject_1 is IGxDatabase) { if (!(igxObject_1 as IGxDatabase).IsConnected) { (igxObject_1 as IGxDatabase).Connect(); } if (!(igxObject_1 as IGxDatabase).IsConnected) { return; } } else if (igxObject_1 is IGxAGSConnection) { if (!(igxObject_1 as IGxAGSConnection).IsConnected) { (igxObject_1 as IGxAGSConnection).Connect(); } if (!(igxObject_1 as IGxAGSConnection).IsConnected) { return; } } IEnumGxObject children = (igxObject_1 as IGxObjectContainer).Children; children.Reset(); IGxObject obj3 = children.Next(); bool flag = true; IGxObjectFilter filter = null; while (obj3 != null) { if (obj3 is IGxNewDatabase) { flag = true; } else if (this.igxObjectFilter_0 != null) { flag = this.igxObjectFilter_0.CanDisplayObject(obj3); } else { for (int i = 0; i < this.iarray_0.Count; i++) { filter = this.iarray_0.get_Element(i) as IGxObjectFilter; if (flag = filter.CanDisplayObject(obj3)) { break; } } } if (flag) { items[0] = obj3.Name; items[1] = obj3.Category; ListViewItem item = new ListViewItem(items, this.method_2(obj3)) { Tag = obj3 }; this.listView1.Items.Add(item); } obj3 = children.Next(); } } System.Windows.Forms.Cursor.Current = Cursors.Default; }
public void Add(IGxObjectFilter igxObjectFilter_0) { this.caddataConvertControl_0.Add(igxObjectFilter_0); }
public CustomFilter() { m_pBasicFilter = new GxFilterBasicTypesClass(); }
public void Add(IGxObjectFilter igxObjectFilter_0) { this.multiObjectClassSelectControl_0.Add(igxObjectFilter_0); }