/// <summary> 將這個<see cref="WzUOL"/>指向特定的<see cref="WzVariant"/>。若該<see cref="WzVariant"/>物件不在同一個映像檔中,則會連結失敗 </summary> /// <param name="variant"> 要指向的<see cref="WzVariant"/>物件 </param> public void LinkVariant(WzVariant variant) { string path = ""; WzSerialize myparent = this.Parent; while (myparent != null) { string path2 = path; WzSerialize vparent = variant.Parent; while (vparent != null) { if (myparent == vparent) { this.Path = path2 + variant.Name; return; } path2 = vparent.Name + "/" + path2; vparent = vparent.Parent; } path = "../" + path; myparent = myparent.Parent; } this.Path = ""; //throw new Exception("Can't find variant '" + v.Name + "' in image file"); }
/// <summary> 取得指定路徑的<see cref="WzVariant"/>拷貝 </summary> /// <param name="path"> <see cref="WzVariant"/>的所在位置 </param> public WzVariant CloneVariant(string path) { WzImage img = null; WzVariant v = GetVariant(path, ref img).Clone(); if (img != null) { img.Dispose(); } return(v); }
/// <summary> </summary> public override bool Equals(WzVariant obj) { return(this.Value == (obj as WzBool).Value); }
/// <summary> </summary> public override bool Equals(WzVariant obj) { return(true); }
/// <summary> </summary> public override bool Equals(WzVariant obj) { return(this.ToString() == obj.ToString()); }
/// <summary> </summary> public override bool Equals(WzVariant obj) { return(this.Value.Equals((obj as WzDispatch).Value)); }
/// <summary> 檢查指定的<see cref="WzVariant"/>是否和目前的<see cref="WzVariant"/>相等 </summary> /// <param name="obj"> 要比較的<see cref="WzVariant"/>物件 </param> public abstract bool Equals(WzVariant obj);