private void ConvertOldMaskInfos() { #region Convert Old Mask Info if (_MaskInfoSetting.Count > 0 && this._MakeChanges) { MaskInfo maskInfo = this._MaskInfoSetting[0] as MaskInfo; if (maskInfo != null) { if (maskInfo.ShowTitle) { this._ColumnsWidth.Add(maskInfo.TitleWidth); } this.ColumnsWidth.Add(maskInfo.MaskedWidth); MaskInfo maskInfoCopy = maskInfo.Copy(); maskInfoCopy.BrotherMaskInfos = new MaskInfoCollection(); for (int i = 1; i < this._MaskInfoSetting.Count; i++) { MaskInfo brotherMaskInfo = this._MaskInfoSetting[i] as MaskInfo; if (brotherMaskInfo.ShowTitle) { this._ColumnsWidth.Add(brotherMaskInfo.TitleWidth); } this._ColumnsWidth.Add(brotherMaskInfo.MaskedWidth); maskInfoCopy.BrotherMaskInfos.Add(brotherMaskInfo.Copy()); } this._MaskInfoSetting.Clear(); this._MaskInfoSetting.Add(maskInfoCopy); this._MakeChanges = false; } } #endregion }
private void Menu_CopyStat_Click(object sender, System.EventArgs e) { TreeNode node = this.C_GroupInfoTree.SelectedNode; if (node == null) { return; } MaskInfo info = node.Tag as MaskInfo; MaskInfo newInfo = info.Copy(); TreeNode newNode = new TreeNode(newInfo.ToString()); newNode.Tag = newInfo; this.C_GroupInfoTree.Nodes.Add(newNode); this.UpdateTextDisplay(); this.C_GroupInfoTree.SelectedNode = node; }