Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (MarkupApp.isActive) {
// NOTE: Because we don't have separate START and STOP buttons in the test app, exit markup mode only when the Markup Select tool is active, otherwise start the Markup Select tool...
const startMarkupSelect = IModelApp.toolAdmin.defaultToolId === MarkupApp.markupSelectToolId && (undefined === IModelApp.toolAdmin.activeTool || MarkupApp.markupSelectToolId !== IModelApp.toolAdmin.activeTool.toolId);
if (startMarkupSelect) {
IModelApp.toolAdmin.startDefaultTool();
return true;
}
MarkupApp.props.result.maxWidth = 1500;
MarkupApp.stop().then((markupData) => {
if (undefined !== markupData.image)
openImageDataUrlInNewWindow(markupData.image, "Markup");
}).catch((_) => { });
} else {
MarkupApp.props.active.element.stroke = "white"; // as an example, set default color for elements
MarkupApp.markupSelectToolId = "Markup.TestSelect"; // as an example override the default markup select tool to launch redline tools using key events
MarkupApp.start(vp); // tslint:disable-line:no-floating-promises
}
return true;
}
}
public run(_args: any[]): boolean {
const vp = IModelApp.viewManager.selectedView;
if (undefined === vp)
return true;
if (MarkupApp.isActive) {
// NOTE: Because we don't have separate START and STOP buttons in the test app, exit markup mode only when the Markup Select tool is active, otherwise start the Markup Select tool...
const startMarkupSelect = IModelApp.toolAdmin.defaultToolId === MarkupApp.markupSelectToolId && (undefined === IModelApp.toolAdmin.activeTool || MarkupApp.markupSelectToolId !== IModelApp.toolAdmin.activeTool.toolId);
if (startMarkupSelect) {
IModelApp.toolAdmin.startDefaultTool();
return true;
}
MarkupApp.props.result.maxWidth = 1500;
MarkupApp.stop().then((markupData) => {
if (undefined !== markupData.image)
openImageDataUrlInNewWindow(markupData.image, "Markup");
}).catch((_) => { });
} else {
MarkupApp.props.active.element.stroke = "white"; // as an example, set default color for elements
MarkupApp.markupSelectToolId = "Markup.TestSelect"; // as an example override the default markup select tool to launch redline tools using key events
MarkupApp.start(vp); // tslint:disable-line:no-floating-promises
}
return true;
activeLocale: IModelApp.i18n.languageList()[0],
});
// Register tools.
Tool1.register(this.sampleAppNamespace);
Tool2.register(this.sampleAppNamespace);
ToolWithSettings.register(this.sampleAppNamespace);
AnalysisAnimationTool.register(this.sampleAppNamespace);
UiProviderTool.register(this.sampleAppNamespace);
IModelApp.toolAdmin.defaultToolId = SelectionTool.toolId;
// store name of this registered control in Redux store so it can be access by plugins
UiFramework.setDefaultIModelViewportControlId(IModelViewportControl.id);
await MarkupApp.initialize();
}
public run(_args: any[]): boolean {
const vp = IModelApp.viewManager.selectedView;
if (undefined === vp)
return true;
if (MarkupApp.isActive) {
// NOTE: Because we don't have separate START and STOP buttons in the test app, exit markup mode only when the Markup Select tool is active, otherwise start the Markup Select tool...
const startMarkupSelect = IModelApp.toolAdmin.defaultToolId === MarkupApp.markupSelectToolId && (undefined === IModelApp.toolAdmin.activeTool || MarkupApp.markupSelectToolId !== IModelApp.toolAdmin.activeTool.toolId);
if (startMarkupSelect) {
IModelApp.toolAdmin.startDefaultTool();
return true;
}
MarkupApp.props.result.maxWidth = 1500;
MarkupApp.stop().then((markupData) => {
if (undefined !== markupData.image)
openImageDataUrlInNewWindow(markupData.image, "Markup");
}).catch((_) => { });
} else {
MarkupApp.props.active.element.stroke = "white"; // as an example, set default color for elements
MarkupApp.markupSelectToolId = "Markup.TestSelect"; // as an example override the default markup select tool to launch redline tools using key events
MarkupApp.start(vp); // tslint:disable-line:no-floating-promises
}
return true;
if (MarkupApp.isActive) {
// NOTE: Because we don't have separate START and STOP buttons in the test app, exit markup mode only when the Markup Select tool is active, otherwise start the Markup Select tool...
const startMarkupSelect = IModelApp.toolAdmin.defaultToolId === MarkupApp.markupSelectToolId && (undefined === IModelApp.toolAdmin.activeTool || MarkupApp.markupSelectToolId !== IModelApp.toolAdmin.activeTool.toolId);
if (startMarkupSelect) {
IModelApp.toolAdmin.startDefaultTool();
return true;
}
MarkupApp.props.result.maxWidth = 1500;
MarkupApp.stop().then((markupData) => {
if (undefined !== markupData.image)
openImageDataUrlInNewWindow(markupData.image, "Markup");
}).catch((_) => { });
} else {
MarkupApp.props.active.element.stroke = "white"; // as an example, set default color for elements
MarkupApp.markupSelectToolId = "Markup.TestSelect"; // as an example override the default markup select tool to launch redline tools using key events
MarkupApp.start(vp); // tslint:disable-line:no-floating-promises
}
return true;
}
}
if (MarkupApp.isActive) {
// NOTE: Because we don't have separate START and STOP buttons in the test app, exit markup mode only when the Markup Select tool is active, otherwise start the Markup Select tool...
const startMarkupSelect = IModelApp.toolAdmin.defaultToolId === MarkupApp.markupSelectToolId && (undefined === IModelApp.toolAdmin.activeTool || MarkupApp.markupSelectToolId !== IModelApp.toolAdmin.activeTool.toolId);
if (startMarkupSelect) {
IModelApp.toolAdmin.startDefaultTool();
return true;
}
MarkupApp.props.result.maxWidth = 1500;
MarkupApp.stop().then((markupData) => {
if (undefined !== markupData.image)
openImageDataUrlInNewWindow(markupData.image, "Markup");
}).catch((_) => { });
} else {
MarkupApp.props.active.element.stroke = "white"; // as an example, set default color for elements
MarkupApp.markupSelectToolId = "Markup.TestSelect"; // as an example override the default markup select tool to launch redline tools using key events
MarkupApp.start(vp); // tslint:disable-line:no-floating-promises
}
return true;
}
}
public run(_args: any[]): boolean {
const vp = IModelApp.viewManager.selectedView;
if (undefined === vp)
return true;
if (MarkupApp.isActive) {
// NOTE: Because we don't have separate START and STOP buttons in the test app, exit markup mode only when the Markup Select tool is active, otherwise start the Markup Select tool...
const startMarkupSelect = IModelApp.toolAdmin.defaultToolId === MarkupApp.markupSelectToolId && (undefined === IModelApp.toolAdmin.activeTool || MarkupApp.markupSelectToolId !== IModelApp.toolAdmin.activeTool.toolId);
if (startMarkupSelect) {
IModelApp.toolAdmin.startDefaultTool();
return true;
}
MarkupApp.props.result.maxWidth = 1500;
MarkupApp.stop().then((markupData) => {
if (undefined !== markupData.image)
openImageDataUrlInNewWindow(markupData.image, "Markup");
}).catch((_) => { });
} else {
MarkupApp.props.active.element.stroke = "white"; // as an example, set default color for elements
MarkupApp.markupSelectToolId = "Markup.TestSelect"; // as an example override the default markup select tool to launch redline tools using key events
MarkupApp.start(vp); // tslint:disable-line:no-floating-promises
}
return true;
}
}