void ReleaseDesignerOutlets() { if (cancel_select != null) { cancel_select.Dispose(); cancel_select = null; } if (exit_select != null) { exit_select.Dispose(); exit_select = null; } if (SelectCollection != null) { SelectCollection.Dispose(); SelectCollection = null; } if (SelectSubView != null) { SelectSubView.Dispose(); SelectSubView = null; } }
private void InsertFeatures(EditParameters parameter) { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } if (parameter == null) { return; } System.Collections.Generic.Dictionary <DF3DFeatureClass, IRowBufferCollection> geometryMap = parameter.geometryMap; if (geometryMap != null) { CommandManagerServices.Instance().StartCommand(); FDECommand fDECommand = new FDECommand(true, true); SelectCollection.Instance().Clear(); foreach (DF3DFeatureClass current in geometryMap.Keys) { IFeatureClass featureClass = current.GetFeatureClass(); IRowBufferCollection rowBufferCollection = geometryMap[current]; CommonUtils.Instance().FdeUndoRedoManager.InsertFeatures(featureClass, rowBufferCollection); CommonUtils.Instance().Insert(current, rowBufferCollection, true, false); app.Current3DMapControl.FeatureManager.CreateFeatures(featureClass, rowBufferCollection); } fDECommand.SetSelectionMap(); CommandManagerServices.Instance().CallCommand(fDECommand); app.Workbench.UpdateMenu(); } }
private void ExecuteUndoRedo(IUndoRedoResultCollection Coll) { if (Coll != null) { int count = Coll.Count; if (count == 0) { return; } if (app == null || app.Current3DMapControl == null) { return; } app.Current3DMapControl.PauseRendering(false); for (int i = 0; i < count; i++) { IUndoRedoResult undoRedoResult = Coll[i]; if (undoRedoResult != null) { IObjectClass objectClass = undoRedoResult.ObjectClass; IRowBufferCollection rowBuffers = undoRedoResult.RowBuffers; DF3DFeatureClass featureClassInfo = DF3DFeatureClassManager.Instance.GetFeatureClassByID(objectClass.GuidString); switch (undoRedoResult.Type) { case gviCommandType.gviCommandInsert: { CommonUtils.Instance().Insert(featureClassInfo, rowBuffers, false, true); app.Current3DMapControl.FeatureManager.CreateFeatures(objectClass as IFeatureClass, rowBuffers); break; } case gviCommandType.gviCommandDelete: { int[] fidArray = undoRedoResult.FidArray; app.Current3DMapControl.FeatureManager.DeleteFeatures(objectClass as IFeatureClass, fidArray); CommonUtils.Instance().Delete(featureClassInfo, fidArray); break; } case gviCommandType.gviCommandUpdate: { CommonUtils.Instance().Update(featureClassInfo, rowBuffers); app.Current3DMapControl.FeatureManager.EditFeatures(objectClass as IFeatureClass, rowBuffers); break; } } if (rowBuffers != null) { rowBuffers.Clear(); System.Runtime.InteropServices.Marshal.ReleaseComObject(rowBuffers); } System.Runtime.InteropServices.Marshal.ReleaseComObject(objectClass); System.Runtime.InteropServices.Marshal.ReleaseComObject(undoRedoResult); } } System.Runtime.InteropServices.Marshal.ReleaseComObject(Coll); RenderControlEditServices.Instance().SetEditorPosition(SelectCollection.Instance().FcRowBuffersMap); app.Current3DMapControl.ResumeRendering(); } }
private void fdeUndoRedoManager_RedoStart(IUndoRedoResultCollection Coll) { this._wfDlg.Close(); this._wfDlg = null; this._nTotalCount = this.GetTotalCount(Coll); if (this._nTotalCount > 300) { try { try { this._notifySelection = new UndoRedoOperator.NotifySelection(SelectCollection.Instance().NotifySelection); this._recordsChanged = new UndoRedoOperator.RecordsChanged(SelectCollection.Instance().RecordsChanged); this._CreaDataTable = new UndoRedoOperator.CreateDataTableHandel(SelectCollection.Instance().CreateDataTable); this._InsertRecord = new UndoRedoOperator.InsertRecordHandel(SelectCollection.Instance().InsertRecord); this._deleteRecord = new UndoRedoOperator.DeleteRecordHandel(this.DeleteRow); this._bgWorker.RunWorkerAsync(Coll); this._progressDlg.ShowDialog(); } catch (System.Exception) { } return; } finally { if (app != null && app.Current3DMapControl != null) { app.Current3DMapControl.FeatureManager.RefreshAll(); } } } this.ExecuteUndoRedo(Coll); }
public override bool BeginEdit() { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return(false); } System.Windows.Forms.DialogResult dialogResult = XtraMessageBox.Show(StringParser.Parse("${res:feature_alert_batch_edit}"), StringParser.Parse("${res:feature_alert_tooltip}"), System.Windows.Forms.MessageBoxButtons.YesNo); if (dialogResult == System.Windows.Forms.DialogResult.Yes) { this._clearSelection = new ClearSelectionHandle(SelectCollection.Instance().Clear); this._deleteSelection = new DeleteSelectionHandle(CommonUtils.Instance().Delete); this._updateSelection = new UpdateSelectionHandel(SelectCollection.Instance().UpdateSelection); this._InsertSelection = new InsertSelectionHandel(CommonUtils.Instance().Insert); //this._NextPage = new NextPageHandel(SelectCollection.Instance().NextResultSize); this.bNeedOperator = true; app.Current3DMapControl.PauseRendering(false); } else { this.bNeedOperator = false; } return(this.bNeedOperator); }
private void bt_GoCheck_Click(object sender, EventArgs e) { MainForm mmf = this.Owner as MainForm; //主窗口 ModelForm1 mf = mmf.ModelForm; //模型窗口 TextBox messagebox = mmf.MessageTool.Tb_out; MidasGenModel.model.Bmodel mm = mf.CurModel; //激活地震组合有问题 mm.RSCombineActive(cb_isdizhen.Checked);//激活地震组合 if (tb_Elems.Text.Length == 0) { lb_out.Text = "提示:没有指定单元号!"; } List <int> eles = SelectCollection.StringToList(tb_Elems.Text); int num = eles.Count;//选择单元数 int i = 1; mmf.MessageTool.Tb_out.AppendText(Environment.NewLine + "************单元验算开始************"); mmf.MessageTool.Tb_out.AppendText(Environment.NewLine + " 开始验算"); foreach (int ele in eles) { mf.CheckTable.CheckElemByNum(ref mm, ele); //lb_out.Text = "提示:"+i.ToString()+" of "+num.ToString()+ "验算完成" ; string info = " " + i.ToString() + " of " + num.ToString() + " 验算完成!"; ReplaceLastLine(ref messagebox, info); i++; } mmf.MessageTool.Tb_out.AppendText(Environment.NewLine + "************单元验算结束************"); }
public bool IsValid(object caller, ICSharpCode.Core.Condition condition) { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return(false); } DF3DFeatureClass dffc = CommonUtils.Instance().CurEditLayer; if (dffc == null) { return(false); } IFeatureClass fc = dffc.GetFeatureClass(); if (fc == null) { return(false); } IFeatureLayer fl = dffc.GetFeatureLayer(); bool b1 = false; if (fl != null && (fl.GeometryType == gviGeometryColumnType.gviGeometryColumnPolygon || fl.GeometryType == gviGeometryColumnType.gviGeometryColumnPolyline)) { b1 = true; } int count = SelectCollection.Instance().GetCount(false); if (count != 1) { b1 &= false; } return(b1); }
private void 显示单元设计内力ToolStripMenuItem_Click(object sender, EventArgs e) { Bmodel curMM = this.ModelForm.CurModel; //模型数据 BCheckModel curCM = this.ModelForm.CheckModel; //设计数据 List <int> eles = SelectCollection.StringToList(this.cb_selectEle.Text); //选择单元 if (eles.Count == 0) { MessageTool.Tb_out.AppendText(Environment.NewLine + "*Error*:未选择单元!"); return; } TableForm tf = new TableForm(); tf.Text = "单元设计内力表"; tf.Key = "DesignForceTable"; tf.State = ToolWindowState.Mdi; tf.writeDesignForce(ref curMM, ref curCM, eles);//输出数据 if (!this.HasToolWindow("DesignForceTable")) { _LayoutManager.ToolWindows.Add(tf); } else { ToolWindow tw = _LayoutManager.ToolWindows["DesignForceTable"]; _LayoutManager.ToolWindows.Remove(tw); _LayoutManager.ToolWindows.Add(tf); } }
private HashMap GetSelectionMap() { if (SelectCollection.Instance().FeatureClassInfoMap == null || SelectCollection.Instance().FeatureClassInfoMap.Count == 0) { return(null); } HashMap hashMap = new HashMap(); foreach (DF3DFeatureClass key in SelectCollection.Instance().FeatureClassInfoMap.Keys) { ResultSetInfo resultSetInfo = SelectCollection.Instance().FeatureClassInfoMap[key] as ResultSetInfo; if (resultSetInfo != null && resultSetInfo.ResultSetTable != null && resultSetInfo.ResultSetTable.Rows.Count != 0) { System.Collections.Generic.List <int> list = new System.Collections.Generic.List <int>(); for (int i = 0; i < resultSetInfo.ResultSetTable.Rows.Count; i++) { int item = -1; if (int.TryParse(resultSetInfo.ResultSetTable.Rows[i][0].ToString(), out item)) { list.Add(item); } } hashMap[key] = list; } } return(hashMap); }
/// <summary> /// 执行导出任务所需要的参数 /// </summary> /// <param name="selections">导出类别选项</param> /// <param name="specifiedQuaryStringArgs">特别查询参数</param> /// <param name="selectImgs">选择图像</param> /// <param name="selectVdos">选择视频</param> public CmdExecuteArgs(SelectCollection selections, string[] specifiedQuaryStringArgs, bool selectImgs, bool selectVdos) { Selections = selections; SpecifiedQuaryStringArgs = specifiedQuaryStringArgs; SelectImgs = selectImgs; SelectVdos = selectVdos; }
private void 显示单元设计参数ToolStripMenuItem_Click(object sender, EventArgs e) { List <int> eles = SelectCollection.StringToList(this.cb_selectEle.Text); MidasGenModel.model.Bmodel cm; //如果单元选择数为0,作出提示 if (eles.Count == 0) { MessageTool.Tb_out.AppendText(Environment.NewLine + "*Error*:未选择单元!"); return; } if (!this.HasToolWindow(_modelKey)) { MessageBox.Show("请先新建模型", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } else { cm = ModelForm.CurModel; } foreach (int ele in eles) { FrameElement cele = cm.elements[ele] as FrameElement; string outs = string.Format("++++++单元号:{0}++++++", ele); MessageTool.Tb_out.AppendText(Environment.NewLine + outs); MessageTool.Tb_out.AppendText(Environment.NewLine + cele.DPs.ToString()); } }
private void 测试用命令ToolStripMenuItem_Click(object sender, EventArgs e) { #region 测试荷载组合功能 List <int> eles = SelectCollection.StringToList(this.cb_selectEle.Text); MidasGenModel.model.Bmodel cm; //如果单元选择数为0,作出提示 if (eles.Count == 0) { MessageTool.Tb_out.AppendText(Environment.NewLine + "*Error*:未选择单元!"); return; } if (!this.HasToolWindow(_modelKey)) { MessageBox.Show("请先新建模型", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } else { cm = ModelForm.CurModel; } string com = "SRSS3";//组合名 BLoadComb myCom = cm.LoadCombTable.getLoadComb(LCKind.STEEL, com); foreach (int ele in eles) { FrameElement cele = cm.elements[ele] as FrameElement; string outs = string.Format("++++++单元号:{0} 组合:{1}++++++", ele, com); MessageTool.Tb_out.AppendText(Environment.NewLine); MessageTool.Tb_out.AppendText(outs); ElemForce EFcom = cm.CalElemForceComb(myCom, ele); MessageTool.Tb_out.AppendText(Environment.NewLine + "[i]--" + EFcom.Force_i.ToString()); MessageTool.Tb_out.AppendText(Environment.NewLine + "[4/8]--" + EFcom.Force_48.ToString()); MessageTool.Tb_out.AppendText(Environment.NewLine + "[j]--" + EFcom.Force_j.ToString()); } #endregion }
private void UpdateDatabase() { DF3DFeatureClass featureClassInfo = CommonUtils.Instance().CurEditLayer; if (featureClassInfo == null) { return; } IFeatureClass fc = featureClassInfo.GetFeatureClass(); if (fc == null) { return; } int count = SelectCollection.Instance().GetCount(false); EditParameters editParameters = new EditParameters(fc.Guid.ToString()); editParameters.connectionInfo = CommonUtils.Instance().GetCurrentFeatureDataset().DataSource.ConnectionInfo.ToConnectionString(); editParameters.datasetName = CommonUtils.Instance().GetCurrentFeatureDataset().Name; editParameters.regexDataList = regexDataList; editParameters.colName = colName; editParameters.fidList = fids; editParameters.nTotalCount = count; editParameters.TemproalTime = this.time; IBatcheEdit batcheEdit = BatchEditFactory.CreateBatchEdit(count); batcheEdit.BeginEdit(); batcheEdit.DoWork(EditType.ET_UPDATE_ATTRIBUTE, editParameters); batcheEdit.EndEdit(); }
private void bt_CheckGo_Click(object sender, EventArgs e) { MainForm mmf = this.Owner as MainForm;//主窗口 ModelForm1 mf = mmf.ModelForm; TextBox messagebox = mmf.MessageTool.Tb_out; MidasGenModel.model.Bmodel mm = mf.CurModel; if (tb_Elems.Text.Length == 0) { lb_out.Text = "提示:没有指定单元号!"; } List <int> eles = SelectCollection.StringToList(tb_Elems.Text); int num = eles.Count;//选择单元数 int i = 1; mmf.MessageTool.Tb_out.AppendText(Environment.NewLine + "************单元验算开始************"); mmf.MessageTool.Tb_out.AppendText(Environment.NewLine + " 开始验算"); foreach (int ele in eles) { //mf.CheckTable.CheckElemByNum(ref mm, ele); CodeCheck.RefreshDesignPara(ref mm, mf.CheckModel, ele); CodeCheck.CalDesignPara_lemda(ref mm, ele); CodeCheck.CalDesignPara_phi(ref mm, ele, 1); //计算y向轴压稳定系数 CodeCheck.CalDesignPara_phi(ref mm, ele, 2); //计算z向轴压稳定系数 mf.CheckTable.CheckElemByNum_N(ref mm, ele, ref mf.CheckModel); string info = " " + i.ToString() + " of " + num.ToString() + " 验算完成!"; //ReplaceLastLine(ref messagebox, info); mmf.MessageTool.Tb_out.AppendText(Environment.NewLine + info); i++; } mmf.MessageTool.Tb_out.AppendText(Environment.NewLine + "************单元验算结束************"); }
private static SelectCollection <int, int> TestList1To5() { var ints = new[] { 0, 1, 2, 3, 4 }; var sc = new SelectCollection <int, int>(ints, i => - i); return(sc); }
public UCEditFacilityStyle() { InitializeComponent(); LoadStyle(); InitData(); SelectCollection.Instance().SelectionChangedEvent += new SelectionChangedEventHandler(UCEditFacilityStyle_SelectionChangedEvent); }
public event EventHandler CancelExcution; //取消任务 public ExportPage() { InitializeComponent(); selections = new SelectCollection(); files = new ObservableCollection <FileExpression>(); Lst_TargetFiles.ItemsSource = files; }
private static Tuple <ThreadSafeBindableCollection <int>, SelectCollection <int, int> > BindingList1To5() { var ints = new ThreadSafeBindableCollection <int>(); ints.AddRange(new[] { 0, 1, 2, 3, 4 }); var sc = new SelectCollection <int, int>(ints, i => - i); return(Tuple.Create(ints, sc)); }
private void bt_CalForce_Click(object sender, EventArgs e) { if (tb_Nodes.Text.Length == 0) { MessageBox.Show("未输入计算节点集!!"); return; } if (tb_Elems.Text.Length == 0) { MessageBox.Show("未输入单元集!!"); return; } List <int> Nodes = SelectCollection.StringToList(tb_Nodes.Text); //节点集 List <int> Elems = SelectCollection.StringToList(tb_Elems.Text); //单元集 List <string> Coms = MM.LoadCombTable.ComSteel; MessageOUT.AppendText(Environment.NewLine + " [节点号]\t[最大合力(kN)]\t[控制组合]\t[合力方向向量]"); foreach (int nn in Nodes) { List <int> ees = FindNodeElems(nn, Elems); //与之相联的单元 Vector3 MaxSumForce = new Vector3(); //最大合力 string MaxComName = null; //最大合力组合名称 foreach (string com in Coms) { Vector3 SumForce = new Vector3();//合力 foreach (int ee in ees) { Vector3 vectemp = GetNodeForceVec(nn, ee, MM.LoadCombTable.getLoadComb(LCKind.STEEL, com)); SumForce = SumForce + vectemp; } //显示单个组合的合力 if (rb2.Checked == true) { MessageOUT.AppendText(Environment.NewLine + " " + nn.ToString() + "\t" + SumForce.Magnitude.ToString("0.0") + "\t" + com + "\t" + Vector3.Normalize(SumForce).ToString("0.000", null)); } //比较记录最大值 if (SumForce.Magnitude > MaxSumForce.Magnitude) { MaxSumForce = SumForce; MaxComName = com; } } MessageOUT.AppendText(Environment.NewLine + " " + nn.ToString() + "\t" + MaxSumForce.Magnitude.ToString("0.0") + "\t" + MaxComName + "\t" + Vector3.Normalize(MaxSumForce).ToString("0.000", null) + "\t***"); } }
public UCGeometryEdit() { this.InitializeComponent(); this._connInfo = CommonUtils.Instance().CurEditLayer; RenderControlEditServices.Instance().GeometryEditorCreateGeometryEvent += new GeometryEditorCreateGeometryHandle(this.GeometryEditorCreateGeometryEvent); RenderControlEditServices.Instance().GeometryEditorStopEvent += new GeometryEditorStopHandle(this.GeometryEditorStopEvent); RenderControlEditServices.Instance().RenderEditorTypeChangedEvent += new RenderEditorTypeChangedHandle(this.RenderEditorTypeChanged); RenderControlEditServices.Instance().RenderEditorType = RenderEditorType.UnKnownType; SelectCollection.Instance().SelectionChangedEvent += new SelectionChangedEventHandler(this.SelectionChanged); }
private void BeginRote(HashMap rowbufferMap) { this.beginRowbufferMap = rowbufferMap; IEnvelope selectEnvelope = SelectCollection.Instance().GetSelectEnvelope(this.beginRowbufferMap); if (selectEnvelope != null) { this.centerX = (selectEnvelope.MinX + selectEnvelope.MaxX) / 2.0; this.centerY = (selectEnvelope.MinY + selectEnvelope.MaxY) / 2.0; this.centerZ = (selectEnvelope.MinZ + selectEnvelope.MaxZ) / 2.0; } }
public bool IsValid(object caller, ICSharpCode.Core.Condition condition) { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return(false); } int count = SelectCollection.Instance().GetCount(false); return(count > 0 && CommonUtils.Instance().CurEditLayer != null); }
private void CmdProperty_PropertyTableSelectionChangedEvent(DataRow dr) { try { if (regexDataList != null) { regexDataList.Clear(); } colName = ""; fids = null; if (dr == null) { return; } colName = (dr["F"] as IFieldInfo).Name; DF3DFeatureClass dffc = CommonUtils.Instance().CurEditLayer; if (dffc == null) { return; } HashMap hm = SelectCollection.Instance().GetSelectGeometrys(); if (hm != null && hm.Count == 1) { IRowBufferCollection rowBufferCollection = hm[dffc] as IRowBufferCollection; if (rowBufferCollection != null) { List <int> listFids = SelectCollection.Instance().GetOIDList(rowBufferCollection); if (listFids != null) { fids = listFids.ToArray <int>(); if (dr["FV"] == null) { regexDataList = null; } { if (regexDataList == null) { regexDataList = new List <RegexDataStruct>(); } RegexDataStruct rds = new RegexDataStruct(dr["FV"].ToString(), CharactorType.ConstKey); regexDataList.Add(rds); } UpdateDatabase(); } } } } catch (Exception ex) { } }
public override void Run(object sender, System.EventArgs e) { bool _isAuth = Authority3DService.Instance.IsAuthorized; if (!_isAuth) { XtraMessageBox.Show("此功能需要USB Key。", "提示"); return; } DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } RenderControlEditServices.Instance().StopGeometryEdit(true); int count = SelectCollection.Instance().GetCount(false); if (count > 10000) { XtraMessageBox.Show("批量编辑超过上限,请重新选择"); base.HighLight = false; return; } if (CommonUtils.Instance().EnableTemproalEdit) { using (DateSettingDialog dateSettingDialog = new DateSettingDialog()) { if (dateSettingDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK) { base.HighLight = false; return; } this.time = dateSettingDialog.Time; } } //Map3DCommandManager.Push(this); this._uPanel = new UIDockPanel("风格编辑", "风格编辑", this.Location, this._width, this._height); this._dockPanel = FloatPanelManager.Instance.Add(ref this._uPanel, DockingStyle.Right); this._dockPanel.Visibility = DockVisibility.Visible; this._dockPanel.FloatSize = new System.Drawing.Size(this._width, this._height); this._dockPanel.Width = this._width; this._dockPanel.Height = this._height; this._uc = new UCEditFacilityStyle(); this._uc.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._uc); SelectCollection.Instance().FacStyleClassChangedEvent += new Delegate.FacStyleClassChangedHandle(CmdEditFacilityStyle_FacStyleClassChangedEvent); }
public override void RestoreEnv() { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } app.Current3DMapControl.ObjectEditor.FinishEdit(); app.Current3DMapControl.InteractMode = this._InteractaMode; app.Current3DMapControl.RcObjectEditing -= new Gvitech.CityMaker.Controls._IRenderControlEvents_RcObjectEditingEventHandler(Current3DMapControl_RcObjectEditing); app.Current3DMapControl.RcObjectEditFinish -= new EventHandler(Current3DMapControl_RcObjectEditFinish); SelectCollection.Instance().ClearRowBuffers(); }
private void DeleteSelection(EditParameters parameters) { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } CommandManagerServices.Instance().StartCommand(); FDECommand cmd = new FDECommand(false, true); foreach (DF3DFeatureClass featureClassInfo in SelectCollection.Instance().FeatureClassInfoMap.Keys) { ResultSetInfo resultSetInfo = SelectCollection.Instance().FeatureClassInfoMap[featureClassInfo] as ResultSetInfo; if (resultSetInfo != null) { IFeatureClass featureClass = featureClassInfo.GetFeatureClass(); int[] array = new int[resultSetInfo.ResultSetTable.Rows.Count]; int num = 0; foreach (DataRow dataRow in resultSetInfo.ResultSetTable.Rows) { int num2 = int.Parse(dataRow[featureClass.FidFieldName].ToString()); array[num++] = num2; } if (featureClass.HasTemporal() && CommonUtils.Instance().EnableTemproalEdit) { TemporalFilter temporalFilter = new TemporalFilterClass(); temporalFilter.AddSubField(featureClass.FidFieldName); temporalFilter.IdsFilter = array; ITemporalManager temporalManager = featureClass.TemporalManager; ITemporalCursor temporalCursor = temporalManager.Search(temporalFilter); while (temporalCursor.MoveNext()) { temporalCursor.Dead(parameters.TemproalTime); } System.Runtime.InteropServices.Marshal.ReleaseComObject(temporalCursor); System.Runtime.InteropServices.Marshal.ReleaseComObject(temporalManager); app.Current3DMapControl.FeatureManager.RefreshFeatureClass(featureClass); } else { CommonUtils.Instance().FdeUndoRedoManager.DeleteFeatures(featureClass, array); app.Current3DMapControl.FeatureManager.DeleteFeatures(featureClass, array); } } } SelectCollection.Instance().Clear(); CommandManagerServices.Instance().CallCommand(cmd); app.Workbench.UpdateMenu(); }
public override void ViewDidLoad() { base.ViewDidLoad(); try { AppData.Inventory.LoadCats(); AppData.Inventory.LoadPatterns(); } catch { } SelectCollection.RegisterClassForSupplementaryView(typeof(Header), UICollectionElementKindSection.Header, "HeaderID"); SelectCollection.DataSource = new SelectSource(AppData.Inventory.Cats, AppData.Inventory.Patterns); SelectCollection.AllowsMultipleSelection = true; SelectCollection.Delegate = new SelectDelegate(); exit_select.TouchUpInside += (sender, e) => { NSIndexPath[] SelectedItems = SelectCollection.GetIndexPathsForSelectedItems(); if (SelectedItems.Length != 2) { var okAlertController = UIAlertController.Create("Attention !", "Tu dois choisir 2 éléments ...", UIAlertControllerStyle.Alert); okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(okAlertController, true, null); } else { if (SelectedItems[0].Section == SelectedItems[1].Section) { var okAlertController = UIAlertController.Create("Attention !", "Tu dois choisir des éléments de 2 catégories différentes ...", UIAlertControllerStyle.Alert); okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(okAlertController, true, null); } else { var CatCell = SelectCollection.CellForItem(SelectedItems[0]) as SelectCell; StoreItem CatItem = CatCell.item; var PatternCell = SelectCollection.CellForItem(SelectedItems[1]) as SelectCell; StoreItem PatternItem = PatternCell.item; if (CatCell.item.cellImagePath.Contains("cat/")) { AppData.TreeItems.AddItems(CatItem, PatternItem); } else { AppData.TreeItems.AddItems(PatternItem, CatItem); } var okAlertController = UIAlertController.Create("Super !", "Tu as Choisis " + CatItem.cellTitle + " et " + PatternItem.cellTitle + " !", UIAlertControllerStyle.Alert); okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(okAlertController, true, null); } } }; cancel_select.TouchUpInside += (sender, e) => { DismissViewController(true, null); }; }
public override void Run(object sender, System.EventArgs e) { RenderControlEditServices.Instance().StopGeometryEdit(true); System.DateTime temproalTime = System.DateTime.Now; if (CommonUtils.Instance().EnableTemproalEdit) { using (DateSettingDialog dateSettingDialog = new DateSettingDialog()) { if (dateSettingDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } temproalTime = dateSettingDialog.Time; } } DF3DFeatureClass featureClassInfo = null; System.Collections.IEnumerator enumerator = SelectCollection.Instance().FeatureClassInfoMap.Keys.GetEnumerator(); try { if (enumerator.MoveNext()) { DF3DFeatureClass featureClassInfo2 = (DF3DFeatureClass)enumerator.Current; featureClassInfo = featureClassInfo2; } } finally { System.IDisposable disposable = enumerator as System.IDisposable; if (disposable != null) { disposable.Dispose(); } } if (featureClassInfo == null) { return; } int count = SelectCollection.Instance().GetCount(false); EditParameters editParameters = new EditParameters(featureClassInfo.GetFeatureClass().Guid.ToString()); editParameters.connectionInfo = CommonUtils.Instance().GetCurrentFeatureDataset().DataSource.ConnectionInfo.ToConnectionString(); editParameters.datasetName = CommonUtils.Instance().GetCurrentFeatureDataset().Name; editParameters.TemproalTime = temproalTime; IBatcheEdit batcheEdit = BatchEditFactory.CreateBatchEdit(count); batcheEdit.BeginEdit(); batcheEdit.DoWork(EditType.ET_DELETE_SELCTION, editParameters); batcheEdit.EndEdit(); }
public UCPropertyEdit() { InitializeComponent(); this._dt = new DataTable(); this._dt.Columns.Add(new DataColumn("FN", Type.GetType("System.String"))); this._dt.Columns.Add(new DataColumn("FV", Type.GetType("System.Object"))); this._dt.Columns.Add(new DataColumn("F", Type.GetType("System.Object"))); this.gridControl1.DataSource = this._dt; LoadProperty(); InitData(); SelectCollection.Instance().SelectionChangedEvent += new Delegate.SelectionChangedEventHandler(UCPropertyEdit_SelectionChangedEvent); }
private void DeleteSelection(IObjectClass oc, int[] oidList) { //FeatureClassInfo featureClassInfo = WorkSpaceServices.Instance().GetFeatureClassInfo(oc.Name, true); DF3DFeatureClass featureClassInfo = DF3DFeatureClassManager.Instance.GetFeatureClassByID(oc.GuidString); if (featureClassInfo == null) { return; } if (oc.Type == gviDataSetType.gviDataSetFeatureClassTable) { lock (SelectCollection.Instance().FeatureClassInfoMap) { ResultSetInfo resultSetInfo = SelectCollection.Instance().FeatureClassInfoMap[featureClassInfo] as ResultSetInfo; if (resultSetInfo != null) { DataTable resultSetTable = resultSetInfo.ResultSetTable; //for (int i = 0; i < oidList.Length; i++) //{ // this._nCurIndex++; // DataRow dataRow = resultSetTable.Rows.Find(oidList.GetValue(i)); // if (dataRow != null) // { // MainFrmService.MainFrm.Invoke(this._deleteRecord, new object[] // { // dataRow // }); // resultSetInfo.TotalCount--; // } // string userState = string.Format(StringParser.Parse("${res:feature_progress_finished}"), this._nCurIndex, this._nTotalCount); // int percentProgress = this._nCurIndex * 100 / this._nTotalCount; // this._bgWorker.ReportProgress(percentProgress, userState); //} //object[] args = new object[] //{ // featureClassInfo.FeatureLayerGuidString, // resultSetInfo.TotalCount, // resultSetInfo.ResultSetTable.Rows.Count //}; //MainFrmService.MainFrm.Invoke(this._recordsChanged, args); //HashMap hashMap = MainFrmService.MainFrm.Invoke(this._GetRowbufferMap) as HashMap; //MainFrmService.MainFrm.Invoke(this._setEditorPositionHandel, new object[] //{ // hashMap //}); } } } }