本文整理汇总了TypeScript中vs/editor/common/modes.IState类的典型用法代码示例。如果您正苦于以下问题:TypeScript IState类的具体用法?TypeScript IState怎么用?TypeScript IState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IState类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: equals
public equals(other:IState): boolean {
if (this.modeId !== other.getModeId()) {
return false;
}
let otherStateData = other.getStateData();
if (!this.stateData && !otherStateData) {
return true;
}
if (this.stateData && otherStateData) {
return this.stateData.equals(otherStateData);
}
return false;
}
示例2: safeEquals
public static safeEquals(a: IState, b: IState): boolean {
if (a === null && b === null) {
return true;
}
if (a === null || b === null) {
return false;
}
return a.equals(b);
}
示例3: equals
public equals(other: IState): boolean {
if (other === null || this.modeId !== other.getModeId()) {
return false;
}
if (other instanceof AbstractState) {
return AbstractState.safeEquals(this.stateData, other.stateData);
}
return false;
}
示例4: clone
public clone(): IState {
let stateDataClone:IState = (this.stateData ? this.stateData.clone() : null);
return new NullState(this.modeId, stateDataClone);
}
示例5: safeClone
public static safeClone(state: IState): IState {
if (state) {
return state.clone();
}
return null;
}