![]() |
swDialogWatcher Class |
Namespace: CADSharpTools.SOLIDWORKS.UIAutomation
The swDialogWatcher type exposes the following members.
Name | Description | |
---|---|---|
![]() | swDialogWatcher |
Creates a new instance of the SOLIDWORKS dialog watcher class.
|
Name | Description | |
---|---|---|
![]() | Dialogs |
Dialogs to be watched.
|
![]() | GenericAction |
Action to perform on all dialog if Dialogs is empty or null.
|
![]() | IsIdle |
Returns whether the dialog watcher class is idle or not. This property implements INotifyPropertyChanged.
|
![]() | ProcessId |
Gets or sets process Id of the affected SOLIDWORKS instance.
|
![]() | SOLIDWORKSProcess |
Gets the affected SOLIDWORKS process.
|
Name | Description | |
---|---|---|
![]() | AddDialog |
Adds a new dialog to be watched.
|
![]() | RemoveDialog |
Remove a dialog from the watcher's list of dialogs to watch.
|
![]() | Start |
Starts watching dialogs.
|
![]() | Stop |
Stops watching dialogs.
|
using CADSharpTools.SOLIDWORKS; using System; using SolidWorks.Interop.sldworks; namespace CADSharpTools.PDM.Tests { public class Test { [STAThread] static void Main(string[] args) { var swApp = CADSharpTools.SOLIDWORKS.Singleton.GetApplication(-1, true); int processID = swApp.GetProcessID(); var newDocumentDialog = new CADSharpTools.SOLIDWORKS.UIAutomation.swDialog("New SOLIDWORKS Document", null, SOLIDWORKS.UIAutomation.swDialogButtonAction_e.ClickOK, SOLIDWORKS.UIAutomation.swDialogCompareMethod_e.Title); var swDialogWatcher = new CADSharpTools.SOLIDWORKS.UIAutomation.swDialogWatcher(processID); swDialogWatcher.AddDialog(newDocumentDialog); swDialogWatcher.Start(); // swDialogWatcher.Stop() stops watching. Console.ReadLine(); } } }