Stream(ArrayList data, SelectionAddedEventArgs args) { data.Add(new Snoop.Data.ClassSeparator(typeof(SelectionAddedEventArgs))); data.Add(new Snoop.Data.String("Flags", args.Flags.ToString())); data.Add(new Snoop.Data.SelectionSet("Selection", args.Selection)); data.Add(new Snoop.Data.SelectionSet("Added objects", args.AddedObjects)); }
private void ViewModelOnSelectionAdded(object sender, SelectionAddedEventArgs e) { var item = GetNode(e.NodePath); if (item is not null) { FilesDataGrid.SelectedItems.Add(item); } }
event_SelectionAdded(object sender, SelectionAddedEventArgs e) { PrintEventMessage(sender, "Selection Added"); /*if (m_showDetails) { * Snoop.Forms.Objects dbox = new Snoop.Forms.Objects(e); * dbox.Text = "SelectionAdded"; * dbox.ShowDialog(); * }*/ }
private void callback_SelectionAdded(object sender, SelectionAddedEventArgs e) { try { WriteLine(String.Format("SelectionAdded - {0} ssCount:{1} added:{2}", e.Flags, e.Selection.Count, e.AddedObjects.Count)); } catch (System.Exception ex) { Helper.Message(ex); } }
/// <summary> /// Handles the ClassFilterSelectionAdded event of the ed control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="SelectionAddedEventArgs"/> instance containing the event data.</param> private static void ed_ClassFilterSelectionAdded(object sender, SelectionAddedEventArgs e) { ObjectId[] ids = e.AddedObjects.GetObjectIds(); for (int i = 0; i < ids.Length; i++) { if (!AllowedClassPtrs.Contains(ids[i].ObjectClass.UnmanagedObject)) { e.Remove(i); } } }
/// <summary> /// 对象选择 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public static void OnSelectionAdded(object sender, SelectionAddedEventArgs e) { try { _selectedObjectIds = e.AddedObjects.GetObjectIds(); //集合的ID } catch (System.Exception ex) { PublicMethod.Instance.Editor.WriteMessageWithReturn(ex); } }
void onSelectionAdded(object sender, SelectionAddedEventArgs e) { for (int i = 0; i < e.AddedObjects.Count; i++) { BlockReference br = (BlockReference)e.AddedObjects[i].ObjectId.GetObject(OpenMode.ForRead); if (GetEffectiveName(br) != blockName) { e.Remove(i); } } }
/// <summary> /// Обработчик события для применения фильтрации при выборе объектов /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void ed_SelectionAdded(object sender, SelectionAddedEventArgs e) { ObjectId[] ids = e.AddedObjects.GetObjectIds(); for (int i = 0; i < ids.Length; i++) { if (!_filterObjectMethod(ids[i])) { e.Remove(i); } } }
private void OnSelectionAdded(object sender, SelectionAddedEventArgs e) { string name = ((BlockTableRecord)this.dlg.cbxAutoBlock.SelectedItem).Name; SelectionSet addedObjects = e.AddedObjects; for (int i = 0; i < e.AddedObjects.Count; i++) { if (addedObjects[i].ObjectId.GetObject <BlockReference>().GetEffectiveName() != name) { e.Remove(i); } } }
void Editor_SelectionAdded(object sender, SelectionAddedEventArgs e) { foreach (ObjectId id in e.AddedObjects.GetObjectIds()) { if (id == DimInc_pLine && needOverrule) { tr.AC_Doc.Editor.PointMonitor += Editor_PointMonitor; tr.AC_Doc.Editor.PromptedForPoint += Editor_PromptedForPoint; tr.AC_Doc.Editor.DraggingEnded += Editor_DraggingEnded; ObjectOverrule.AddOverrule(RXClass.GetClass(typeof(Entity)), this, true); needOverrule = false; } } }
/// <summary> /// Обработчик события выделения пользователем объекта автокада /// </summary> /// <param name="o"></param> /// <param name="args"></param> private static void OnSelectionAddedEventHandler(object o, SelectionAddedEventArgs args) { if (args.AddedObjects.Count == 1 && args.AddedObjects[0].ObjectId != _selectedObjectId) { _selectedObjectId = args.AddedObjects[0].ObjectId; OnFocused(new EventArgs <ObjectId>(_selectedObjectId)); _isSelectionAdded = true; } else { if (_isSelectionAdded) { OnSelected(new EventArgs <List <ObjectId> >(args.AddedObjects.GetObjectIds().ToList())); } _isSelectionAdded = false; } }
private void callback_SelectionAdded(object sender, SelectionAddedEventArgs e) { //fmSetting.textBox1.AppendText(String.Format("SelectionAdded - {0} ssCount:{1} added:{2}\r\n", e.Flags, e.Selection.Count, e.AddedObjects.Count)); if (e.AddedObjects != null && e.AddedObjects.Count > 0) { if (e.AddedObjects.Count > 1) { fmObject.ClearSelected(); clearFlag = true; } else if (clearFlag || e.AddedObjects.GetObjectIds()[0] != CurrentObjectID) { clearFlag = false; CurrentObjectID = e.AddedObjects.GetObjectIds()[0]; fmObject.SelectItem(m_processList.FindIndex(p => p.Object.ObjectId == CurrentObjectID)); } } }
void CallbackSelectionAdded(object sender, SelectionAddedEventArgs e) { //string type = e.AddedObjects[0].ObjectId.Handle.ToString(); //ACADProcessesView.getInstanse().m_SettingForm.textBox1.AppendText(String.Format("{0} cnt:{1} add:{2} sel:{3}\r\n", ++line, e.Selection.Count, e.AddedObjects.Count, type)); if (e.AddedObjects.Count == 1) { if (e.AddedObjects.GetObjectIds()[0] != CurrentObjectID) { CurrentObjectID = e.AddedObjects.GetObjectIds()[0]; ObjectForm.SelectObject(ObjectList.FindIndex(p => p.ProcessCurve.ObjectId == CurrentObjectID)); } } else if (CurrentObjectID != ObjectId.Null) { ObjectForm.SelectObject(-1); CurrentObjectID = ObjectId.Null; } }
private void ed_SelectionAdded(object sender, SelectionAddedEventArgs e) { proceed = false; MessageBox.Show("Selection Set has changed. Canceling command..."); ed.SelectionAdded -= ed_SelectionAdded; }
CollectEvent(object sender, CollectorEventArgs e) { // cast the sender object to the SnoopCollector we are expecting Collector snoopCollector = sender as Collector; if (snoopCollector == null) { Debug.Assert(false); // why did someone else send us the message? return; } // see if it is a type we are responsible for Editor editor = e.ObjToSnoop as Editor; if (editor != null) { Stream(snoopCollector.Data(), editor); return; } PromptOptions promptOpts = e.ObjToSnoop as PromptOptions; if (promptOpts != null) { Stream(snoopCollector.Data(), promptOpts); return; } PromptStringOptionsEventArgs promptStringArgs = e.ObjToSnoop as PromptStringOptionsEventArgs; if (promptStringArgs != null) { Stream(snoopCollector.Data(), promptStringArgs); return; } PromptSelectionOptionsEventArgs promptSelectionArgs = e.ObjToSnoop as PromptSelectionOptionsEventArgs; if (promptSelectionArgs != null) { Stream(snoopCollector.Data(), promptSelectionArgs); return; } PromptSelectionOptions promptSelectionOpts = e.ObjToSnoop as PromptSelectionOptions; if (promptSelectionOpts != null) { Stream(snoopCollector.Data(), promptSelectionOpts); return; } PromptPointOptionsEventArgs promptPointArgs = e.ObjToSnoop as PromptPointOptionsEventArgs; if (promptPointArgs != null) { Stream(snoopCollector.Data(), promptPointArgs); return; } PromptNestedEntityResultEventArgs promptNestResultArgs = e.ObjToSnoop as PromptNestedEntityResultEventArgs; if (promptNestResultArgs != null) { Stream(snoopCollector.Data(), promptNestResultArgs); return; } PromptResult promptResult = e.ObjToSnoop as PromptResult; if (promptResult != null) { Stream(snoopCollector.Data(), promptResult); return; } PromptKeywordOptionsEventArgs promptKeywordArgs = e.ObjToSnoop as PromptKeywordOptionsEventArgs; if (promptKeywordArgs != null) { Stream(snoopCollector.Data(), promptKeywordArgs); return; } PromptIntegerOptionsEventArgs promptIntArgs = e.ObjToSnoop as PromptIntegerOptionsEventArgs; if (promptIntArgs != null) { Stream(snoopCollector.Data(), promptIntArgs); return; } PromptEntityOptionsEventArgs promptEntArgs = e.ObjToSnoop as PromptEntityOptionsEventArgs; if (promptEntArgs != null) { Stream(snoopCollector.Data(), promptEntArgs); return; } PromptDoubleOptionsEventArgs promptDoubleArgs = e.ObjToSnoop as PromptDoubleOptionsEventArgs; if (promptDoubleArgs != null) { Stream(snoopCollector.Data(), promptDoubleArgs); return; } PromptSelectionResult prSelRes = e.ObjToSnoop as PromptSelectionResult; if (prSelRes != null) { Stream(snoopCollector.Data(), prSelRes); return; } SelectionSet selSet = e.ObjToSnoop as SelectionSet; if (selSet != null) { Stream(snoopCollector.Data(), selSet); return; } SelectedObject selObj = e.ObjToSnoop as SelectedObject; if (selObj != null) { Stream(snoopCollector.Data(), selObj); return; } SelectedSubObject selSubObj = e.ObjToSnoop as SelectedSubObject; if (selSubObj != null) { Stream(snoopCollector.Data(), selSubObj); return; } SelectionDetails selDetails = e.ObjToSnoop as SelectionDetails; if (selDetails != null) { Stream(snoopCollector.Data(), selDetails); return; } SelectionRemovedEventArgs selRemovedArgs = e.ObjToSnoop as SelectionRemovedEventArgs; if (selRemovedArgs != null) { Stream(snoopCollector.Data(), selRemovedArgs); return; } SelectionAddedEventArgs selAddedArgs = e.ObjToSnoop as SelectionAddedEventArgs; if (selAddedArgs != null) { Stream(snoopCollector.Data(), selAddedArgs); return; } DraggingEndedEventArgs dragEndArgs = e.ObjToSnoop as DraggingEndedEventArgs; if (dragEndArgs != null) { Stream(snoopCollector.Data(), dragEndArgs); return; } InputPointContext inputPtCntxt = e.ObjToSnoop as InputPointContext; if (inputPtCntxt != null) { Stream(snoopCollector.Data(), inputPtCntxt); return; } Keyword keyword = e.ObjToSnoop as Keyword; if (keyword != null) { Stream(snoopCollector.Data(), keyword); return; } PointFilterEventArgs ptFilterEventArgs = e.ObjToSnoop as PointFilterEventArgs; if (ptFilterEventArgs != null) { Stream(snoopCollector.Data(), ptFilterEventArgs); return; } PointFilterResult ptFilterRes = e.ObjToSnoop as PointFilterResult; if (ptFilterRes != null) { Stream(snoopCollector.Data(), ptFilterRes); return; } PointMonitorEventArgs ptMonitorArgs = e.ObjToSnoop as PointMonitorEventArgs; if (ptMonitorArgs != null) { Stream(snoopCollector.Data(), ptMonitorArgs); return; } PromptAngleOptionsEventArgs promptAngleOptsArgs = e.ObjToSnoop as PromptAngleOptionsEventArgs; if (promptAngleOptsArgs != null) { Stream(snoopCollector.Data(), promptAngleOptsArgs); return; } PromptDistanceOptionsEventArgs promptDistanceOptsArgs = e.ObjToSnoop as PromptDistanceOptionsEventArgs; if (promptDistanceOptsArgs != null) { Stream(snoopCollector.Data(), promptDistanceOptsArgs); return; } PromptDoubleResultEventArgs promptDoubleResArgs = e.ObjToSnoop as PromptDoubleResultEventArgs; if (promptDoubleResArgs != null) { Stream(snoopCollector.Data(), promptDoubleResArgs); return; } PromptFileOptions promptFileOpts = e.ObjToSnoop as PromptFileOptions; if (promptFileOpts != null) { Stream(snoopCollector.Data(), promptFileOpts); return; } PromptForEntityEndingEventArgs promptForEntEndArgs = e.ObjToSnoop as PromptForEntityEndingEventArgs; if (promptForEntEndArgs != null) { Stream(snoopCollector.Data(), promptForEntEndArgs); return; } PromptForSelectionEndingEventArgs promptForSelEndArgs = e.ObjToSnoop as PromptForSelectionEndingEventArgs; if (promptForSelEndArgs != null) { Stream(snoopCollector.Data(), promptForSelEndArgs); return; } PromptNestedEntityOptions promptNestEntOpts = e.ObjToSnoop as PromptNestedEntityOptions; if (promptNestEntOpts != null) { Stream(snoopCollector.Data(), promptNestEntOpts); return; } PromptNestedEntityOptionsEventArgs promptNestEntOptsArgs = e.ObjToSnoop as PromptNestedEntityOptionsEventArgs; if (promptNestEntOptsArgs != null) { Stream(snoopCollector.Data(), promptNestEntOptsArgs); return; } PromptSelectionResultEventArgs promptSelResArgs = e.ObjToSnoop as PromptSelectionResultEventArgs; if (promptSelResArgs != null) { Stream(snoopCollector.Data(), promptSelResArgs); return; } // ValueTypes we have to treat a bit different if (e.ObjToSnoop is PickPointDescriptor) { Stream(snoopCollector.Data(), (PickPointDescriptor)e.ObjToSnoop); return; } }