本文整理汇总了TypeScript中wing.window.showErrorMessage方法的典型用法代码示例。如果您正苦于以下问题:TypeScript window.showErrorMessage方法的具体用法?TypeScript window.showErrorMessage怎么用?TypeScript window.showErrorMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wing.window
的用法示例。
在下文中一共展示了window.showErrorMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: action
export function action(): void {
wing.window.showInformationMessage("This is an info message");
wing.window.showErrorMessage("This is an error message");
wing.window.showWarningMessage('This is a warn message');
wing.window.showInformationMessage('This is a info message with callback', 'Show Again').then(value => {
if (value == 'Show Again') {
wing.window.showInformationMessage('Show Again');
}
});
}
示例2: doExchange
function doExchange(){
let e = wing.window.activeTextEditor;
if( !e){
wing.window.showErrorMessage("No File Selected Now");
return;
}
let filename = e.document.fileName;
let ext = path.extname(filename);
if( ext != ".exml"){
wing.window.showErrorMessage("File is not exml");
return;
}
let content = e.document.getText();
let xml = parser(content);
let isEui = is_eui(content);
baseClass = isEui ? "eui.Component" : getHostComponent(xml);
parseNS(xml);
classComponents = parseSkinConponents(xml,isEui);
let targetFileName = getTargetName(filename);
let baseName = path.basename(targetFileName);
properties = {
inputbox: targetFileName
};
className = baseName.split(".")[0];
//skinName = parseSkinname(filename);
wing.window.showPopup<IFormOptions>(PopupType.Form, new Store(properties, schema),{
title : "输出设置"
}).then((result)=>{
let settings = result.getProperties(true);
let classContent = assemble(className,baseClass,skinName,classComponents,settings);
fs.writeFileSync(settings["inputbox"],classContent,{encoding:"utf-8"});
wing.window.showInformationMessage('生成成功:'+settings["inputbox"]);
})
}