本文整理匯總了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;
}