/// <summary> /// BoardLayout深拷贝 /// </summary> /// <param name="boardLayout"></param> public BoardLayout Clone() { BoardLayout boardLayout = new BoardLayout(); boardLayout.LayoutName = this.LayoutName; foreach (ButtonDefinition buttonDef in this.BoardButtonDefs) { boardLayout.BoardButtonDefs.Add(new ButtonDefinition(buttonDef.KeyCode, buttonDef.KeyText, buttonDef.ButtonRect)); } return(boardLayout); }
public bool Compare(BoardLayout targetLayout) { if (targetLayout.LayoutName != this.LayoutName) { return(false); } for (int i = 0; i < this.BoardButtonDefs.Count; i++) { if (!targetLayout.BoardButtonDefs[i].Compare(this.BoardButtonDefs[i])) { return(false); } } return(true); }