/// <summary> /// When the user double clicks on a tool call this method. /// </summary> public override bool DoubleClick() { using (ToolDialog td = new ToolDialog(_tool, ModelElements)) { return(td.ShowDialog() == DialogResult.OK); } }
/// <summary> /// Updates the status indicator. /// </summary> public void UpdateStatus() { using (ToolDialog td = new ToolDialog(Tool, ModelElements)) { ToolStatus = td.ToolStatus; } }
/// <summary> /// When the user doulbe clicks on a tool call this method /// </summary> public override bool DoubleClick() { ToolDialog td = new ToolDialog(_tool, ModelElements); td.ShowDialog(); if (td.DialogResult == DialogResult.OK) { return(true); } return(false); }
private void DoDoubleClick(TreeNode theNode) { // Checks if the user double clicked a node and not a white spot if (theNode == null) return; // checks if the user clicked a tool or a category // Get an instance of the tool and dialog box to go with it toolToExecute = GetTool(theNode.Name); if (toolToExecute != null) { Extent ex = new Extent(-180, -90, 180, 90); // it wasn't a category? if (_legend != null) { IMapFrame mf = _legend.RootNodes[0] as IMapFrame; if (mf != null) ex = mf.ViewExtents; } ToolDialog td = new ToolDialog(toolToExecute, DataSets, ex); DialogResult tdResult = td.ShowDialog(this); while (tdResult == DialogResult.OK && td.ToolStatus != ToolStatus.Ok) { MessageBox.Show(MessageStrings.ToolSetupIncorectly); tdResult = td.ShowDialog(this); } if (tdResult == DialogResult.OK && td.ToolStatus == ToolStatus.Ok) { //This fires when the user clicks the "OK" button on a tool dialog //First we create the progress form ToolProgress progForm = new ToolProgress(1); //We create a background worker thread to execute the tool BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += BwDoWork; bw.RunWorkerCompleted += executionComplete; object[] threadParameter = new object[2]; threadParameter[0] = toolToExecute; threadParameter[1] = progForm; // Show the progress dialog and kick off the Async thread progForm.Show(this); bw.RunWorkerAsync(threadParameter); } } }
/// <summary> /// Updates the status indicator /// </summary> public void UpdateStatus() { ToolDialog td = new ToolDialog(_tool, ModelElements); _toolStatus = td.ToolStatus; }
/// <summary> /// When the user doulbe clicks on a tool call this method /// </summary> public override bool DoubleClick() { ToolDialog td = new ToolDialog(_tool, ModelElements); td.ShowDialog(); if (td.DialogResult == DialogResult.OK) return true; return false; }