public static BoardDataMng GetBrdMng() { if (!bInsFlag) { bInsFlag = true; brdMng = new BoardDataMng(); } return(brdMng); }
public BoardMngForm(BoardInfoDetail info, bool bOrder, string _isPrimary) : this() { InitLang(); this.brdInfo = info; this.bOrder = bOrder; brdMng = BoardDataMng.GetBrdMng(); InitCtrl(); this.isPrimaryCG = _isPrimary; if (this.isPrimaryCG == "1") { this.panel1.BackgroundImage = MewsBroad.Properties.Resources.bgTitle; } else { this.panel1.BackgroundImage = MewsBroad.Properties.Resources.bgTitleGreen; } }
private void Init() { brdMng = BoardDataMng.GetBrdMng(); if (brdMng.dicBrd.Count == 0) { MessageBox.Show(LangPack.GetMongolian("Please register kind first."), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } cbBlack.Items.Add("Unused"); cbBlack.Items.Add("Used"); foreach (KeyValuePair <string, BoardInfo> pair in brdMng.dicBrd) { cbKind.Items.Add(pair.Key); } this.cutImageList.Images.Clear(); this.cutImageLV.Items.Clear(); if (this.infoD != null) { if (File.Exists(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-1.png")) { Image img = Image.FromFile(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-1.png"); this.cutImageList.Images.Add(img); } if (File.Exists(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-2.png")) { Image img = Image.FromFile(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-2.png"); this.cutImageList.Images.Add(img); } if (File.Exists(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-3.png")) { Image img = Image.FromFile(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-3.png"); this.cutImageList.Images.Add(img); } if (File.Exists(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-4.png")) { Image img = Image.FromFile(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-4.png"); this.cutImageList.Images.Add(img); } if (File.Exists(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-5.png")) { Image img = Image.FromFile(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-5.png"); this.cutImageList.Images.Add(img); } if (File.Exists(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-6.png")) { Image img = Image.FromFile(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-6.png"); this.cutImageList.Images.Add(img); } if (File.Exists(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-7.png")) { Image img = Image.FromFile(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-7.png"); this.cutImageList.Images.Add(img); } if (File.Exists(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-8.png")) { Image img = Image.FromFile(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-8.png"); this.cutImageList.Images.Add(img); } if (File.Exists(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-9.png")) { Image img = Image.FromFile(Util.file_CGCutImage + this.infoD.kindNum.ToString() + "-9.png"); this.cutImageList.Images.Add(img); } } if (bAdd) { cbKind.SelectedIndex = 0; cbBlack.SelectedIndex = 0; } else { oldName = this.infoD.name; cbKind.Text = this.infoD.kind; tbName.Text = this.infoD.name; cbKind.Enabled = false; tbText.Text = this.infoD.text; tbText_TextChanged(null, null); cbBlack.SelectedIndex = (this.infoD.isBlack ? 1 : 0); for (int i = 0; i < 9; i++) { if (this.infoD.cut[i]) { ListViewItem lvi = new ListViewItem(); lvi.ImageIndex = i; lvi.Text = (i + 1).ToString(); this.cutImageLV.Items.Add(lvi); } } } }