本文整理汇总了TypeScript中vs/base/common/event.Emitter类的典型用法代码示例。如果您正苦于以下问题:TypeScript Emitter类的具体用法?TypeScript Emitter怎么用?TypeScript Emitter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Emitter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(private sender: Sender, onMessageEvent: Event<any>) {
const emitter = new Emitter<any>();
onMessageEvent(msg => emitter.fire(msg));
this._onMessage = emitter.event;
}
开发者ID:AlexxNica,项目名称:sqlopsstudio,代码行数:5,代码来源:ipc.electron.ts
示例2: setSelectedConfigurationName
public setSelectedConfigurationName(configurationName: string): void {
this._selectedConfigurationName = configurationName;
this._onDidSelectConfigurationName.fire(configurationName);
}
开发者ID:,项目名称:,代码行数:4,代码来源:
示例3:
this.toDispose.push(this.model.addListener('highlight', () => this._onHighlightChange.fire()));
开发者ID:Chan-PH,项目名称:vscode,代码行数:1,代码来源:treeImpl.ts
示例4:
this._xterm.on('lineFeed', () => this._onCheckShell.fire());
开发者ID:armanio123,项目名称:vscode,代码行数:1,代码来源:windowsShellHelper.ts
示例5: setSelectedFunctionBreakpoint
public setSelectedFunctionBreakpoint(functionBreakpoint: debug.IFunctionBreakpoint): void {
this.selectedFunctionBreakpoint = functionBreakpoint;
this._onDidSelectFunctionBreakpoint.fire(functionBreakpoint);
}
开发者ID:1833183060,项目名称:vscode,代码行数:4,代码来源:debugViewModel.ts
示例6: change
public change(newState: INewFindReplaceState, moveCursor: boolean, updateHistory: boolean = true): void {
let changeEvent: FindReplaceStateChangedEvent = {
moveCursor: moveCursor,
updateHistory: updateHistory,
searchString: false,
replaceString: false,
isRevealed: false,
isReplaceRevealed: false,
isRegex: false,
wholeWord: false,
matchCase: false,
searchScope: false,
matchesPosition: false,
matchesCount: false,
currentMatch: false
};
let somethingChanged = false;
const oldEffectiveIsRegex = this.isRegex;
const oldEffectiveWholeWords = this.wholeWord;
const oldEffectiveMatchCase = this.matchCase;
if (typeof newState.searchString !== 'undefined') {
if (this._searchString !== newState.searchString) {
this._searchString = newState.searchString;
changeEvent.searchString = true;
somethingChanged = true;
}
}
if (typeof newState.replaceString !== 'undefined') {
if (this._replaceString !== newState.replaceString) {
this._replaceString = newState.replaceString;
changeEvent.replaceString = true;
somethingChanged = true;
}
}
if (typeof newState.isRevealed !== 'undefined') {
if (this._isRevealed !== newState.isRevealed) {
this._isRevealed = newState.isRevealed;
changeEvent.isRevealed = true;
somethingChanged = true;
}
}
if (typeof newState.isReplaceRevealed !== 'undefined') {
if (this._isReplaceRevealed !== newState.isReplaceRevealed) {
this._isReplaceRevealed = newState.isReplaceRevealed;
changeEvent.isReplaceRevealed = true;
somethingChanged = true;
}
}
if (typeof newState.isRegex !== 'undefined') {
this._isRegex = newState.isRegex;
}
if (typeof newState.wholeWord !== 'undefined') {
this._wholeWord = newState.wholeWord;
}
if (typeof newState.matchCase !== 'undefined') {
this._matchCase = newState.matchCase;
}
if (typeof newState.searchScope !== 'undefined') {
if (!Range.equalsRange(this._searchScope, newState.searchScope)) {
this._searchScope = newState.searchScope;
changeEvent.searchScope = true;
somethingChanged = true;
}
}
// Overrides get set when they explicitly come in and get reset anytime something else changes
this._isRegexOverride = (typeof newState.isRegexOverride !== 'undefined' ? newState.isRegexOverride : FindOptionOverride.NotSet);
this._wholeWordOverride = (typeof newState.wholeWordOverride !== 'undefined' ? newState.wholeWordOverride : FindOptionOverride.NotSet);
this._matchCaseOverride = (typeof newState.matchCaseOverride !== 'undefined' ? newState.matchCaseOverride : FindOptionOverride.NotSet);
if (oldEffectiveIsRegex !== this.isRegex) {
somethingChanged = true;
changeEvent.isRegex = true;
}
if (oldEffectiveWholeWords !== this.wholeWord) {
somethingChanged = true;
changeEvent.wholeWord = true;
}
if (oldEffectiveMatchCase !== this.matchCase) {
somethingChanged = true;
changeEvent.matchCase = true;
}
if (somethingChanged) {
this._onFindReplaceStateChange.fire(changeEvent);
}
}
开发者ID:burhandodhy,项目名称:azuredatastudio,代码行数:89,代码来源:findState.ts
示例7: setFocusedStackFrame
public setFocusedStackFrame(focusedStackFrame: debug.IStackFrame): void {
this.focusedStackFrame = focusedStackFrame;
this._onDidFocusStackFrame.fire(focusedStackFrame);
}
开发者ID:1833183060,项目名称:vscode,代码行数:4,代码来源:debugViewModel.ts
示例8: handleMetadataChanged
private handleMetadataChanged(meta: string): void {
this.metadata = meta;
this._onMetadataChanged.fire();
}
开发者ID:jumpinjackie,项目名称:sqlopsstudio,代码行数:4,代码来源:binaryEditor.ts
示例9:
this._xterm.on('cursormove', () => {
if (this._newLineFeed) {
this._onCheckShell.fire();
}
});
开发者ID:AlexxNica,项目名称:sqlopsstudio,代码行数:5,代码来源:windowsShellHelper.ts
示例10: removeCodeEditor
public removeCodeEditor(editor: ICommonCodeEditor): void {
if (delete this._codeEditors[editor.getId()]) {
this._onCodeEditorRemove.fire(editor);
}
}
开发者ID:StateFarmIns,项目名称:vscode,代码行数:5,代码来源:abstractCodeEditorService.ts
注:本文中的vs/base/common/event.Emitter类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论