Beispiel #1
0
        private void frmCardView_Load(object sender, EventArgs e)
        {
            LoadMenu();

            listViewEx1.LargeImageList = Global.frmMainHolder.imageList1;
            listViewEx1.SmallImageList = Global.frmMainHolder.imageList2;

            sorter.AddField("ID", SortField.INT, false);
            sorter.AddField("atkValue", SortField.INT);
            sorter.AddField("defValue", SortField.INT);
            sorter.AddField("name2", SortField.STRING);
            sorter.AddField("japName2", SortField.STRING);
            sorter.AddField("cardType2", SortField.STRING, false);
            sorter.AddField("element", SortField.STRING);
            sorter.AddField("tribe", SortField.STRING);
            sorter.AddField("level", SortField.INT);

            DB2Config config = DB2Config.GetInstance();

            if (string.Equals(config.GetSetting("SaveLayout"), "True", StringComparison.OrdinalIgnoreCase))
            {
                if (string.Equals(config.GetSetting("CardView"), "List", StringComparison.OrdinalIgnoreCase))
                {
                    listViewEx1.View = View.Details;
                }
                else
                {
                    listViewEx1.View = View.LargeIcon;
                }
            }
        }
Beispiel #2
0
        private void frmDeckView_FormClosing(object sender, FormClosingEventArgs e)
        {
            DB2Config config = DB2Config.GetInstance();

            if (string.Equals(config.GetSetting("SaveLayout"), "True", StringComparison.OrdinalIgnoreCase))
            {
                SaveLayout("DeckViewLayout.xml");
                if (listViewEx1.View == View.Details)
                {
                    config.SetSetting("DeckView1", "List");
                }
                else
                {
                    config.SetSetting("DeckView1", "Ico");
                }
                if (listViewEx2.View == View.Details)
                {
                    config.SetSetting("DeckView2", "List");
                }
                else
                {
                    config.SetSetting("DeckView2", "Ico");
                }
                if (listViewEx3.View == View.Details)
                {
                    config.SetSetting("DeckView3", "List");
                }
                else
                {
                    config.SetSetting("DeckView3", "Ico");
                }
            }
        }
Beispiel #3
0
        private void frmConfig_Load(object sender, EventArgs e)
        {
            DB2Config config   = DB2Config.GetInstance();
            CLConfig  clconfig = CLConfig.GetInstance();

            if (string.Equals(config.GetSettingNext("NotShowIco"), "True", StringComparison.OrdinalIgnoreCase))
            {
                checkBoxX1.Checked = true;
            }

            if (string.Equals(config.GetSettingNext("NoVirtualMode"), "True", StringComparison.OrdinalIgnoreCase))
            {
                checkBoxX2.Checked = true;
            }

            if (string.Equals(clconfig.GetSetting("AllowForbiddenCard"), "True", StringComparison.OrdinalIgnoreCase))
            {
                checkBoxX3.Checked = true;
            }

            if (string.Equals(config.GetSettingNext("NoDrag"), "True", StringComparison.OrdinalIgnoreCase))
            {
                checkBoxX4.Checked = true;
            }

            if (!string.Equals(clconfig.GetSettingNext("AllowDIY"), "True", StringComparison.OrdinalIgnoreCase))
            {
                checkBoxX5.Checked = false;
            }

            if (!string.Equals(config.GetSetting("SaveLayout"), "True", StringComparison.OrdinalIgnoreCase))
            {
                checkBoxX6.Checked = false;
            }

            textBox1.Text = config.GetSetting("ImagePath");

            textBox2.Text = config.GetSetting("IcoPath");

            textBox3.Text = config.GetSetting("NBXPath");

            textBox4.Text = config.GetSetting("DeckPath");
        }
Beispiel #4
0
        //构造函数(略缩图数量, 略缩图路径, DIY略缩图路径)
        public PicLoader(int capacity, string icoPath, string diyIcoPath)
        {
            DB2Config config = DB2Config.GetInstance();

            if (!string.Equals(config.GetSetting("NotShowIco"), "True", StringComparison.OrdinalIgnoreCase))
            {
                //读取参数
                refreshinterval = MyTools.Config.GetIntValue(config.GetSetting("RefreshInterval"), 200);
                loadpicinterval = MyTools.Config.GetIntValue(config.GetSetting("LoadPicInterval"), 20);
                loadoncenum     = MyTools.Config.GetIntValue(config.GetSetting("LoadPicOnceNum"), 10);

                //初始化
                Global.loadPicEnd = false;
                Capacity          = capacity;
                IcoPath           = FileTools.DirToPath(FileTools.RelativeToAbsolutePath(icoPath));
                DIYIcoPath        = FileTools.DirToPath(FileTools.RelativeToAbsolutePath(diyIcoPath));
                NeedShow          = new Stack <PicInfo>();
                IndexMapper       = new Hashtable(capacity + 1);

                //将所有载入略缩图请求压栈
                for (int i = capacity - 1; i >= 0; i--)
                {
                    NeedShow.Push(new PicInfo(i, false));
                }

                //在新线程载入略缩图
                Thread WorkThread = new Thread(new ThreadStart(LoadPic));
                WorkThread.IsBackground = true;
                WorkThread.Priority     = ThreadPriority.BelowNormal;
                WorkThread.Start();
            }
            else
            {
                DoLoadEnd();
            }
        }
Beispiel #5
0
        private void frmDeckView_Load(object sender, EventArgs e)
        {
            DB2Config config = DB2Config.GetInstance();

            SaveLayout("DefaultDeckViewLayout.xml");

            if (string.Equals(config.GetSetting("SaveLayout"), "True", StringComparison.OrdinalIgnoreCase))
            {
                LoadLayout("DeckViewLayout.xml");
            }

            //
            // columnHeader1
            //
            this.columnHeader1.Text  = "中文名";
            this.columnHeader1.Width = 128;
            //
            // columnHeader2
            //
            this.columnHeader2.Text  = "日文名";
            this.columnHeader2.Width = 125;
            //
            // columnHeader3
            //
            this.columnHeader3.Text  = "卡种";
            this.columnHeader3.Width = 65;
            //
            // columnHeader4
            //
            this.columnHeader4.Text = "种族";
            //
            // columnHeader5
            //
            this.columnHeader5.Text  = "属性";
            this.columnHeader5.Width = 42;
            //
            // columnHeader6
            //
            this.columnHeader6.Text  = "星级";
            this.columnHeader6.Width = 42;
            //
            // columnHeader7
            //
            this.columnHeader7.Text = "攻击";
            //
            // columnHeader8
            //
            this.columnHeader8.Text = "防御";
            //
            // columnHeader9
            //
            this.columnHeader9.Text  = "自编号";
            this.columnHeader9.Width = 51;

            this.listViewEx1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
                this.columnHeader1,
                this.columnHeader2,
                this.columnHeader3,
                this.columnHeader4,
                this.columnHeader5,
                this.columnHeader6,
                this.columnHeader7,
                this.columnHeader8,
                this.columnHeader9
            });


            listViewEx1.LargeImageList = Global.frmMainHolder.imageList1;
            listViewEx2.LargeImageList = Global.frmMainHolder.imageList1;
            listViewEx3.LargeImageList = Global.frmMainHolder.imageList1;
            listViewEx1.SmallImageList = Global.frmMainHolder.imageList2;
            listViewEx2.SmallImageList = Global.frmMainHolder.imageList2;
            listViewEx3.SmallImageList = Global.frmMainHolder.imageList2;

            sorter.AddField("cardType2", SortField.INT, false, false);
            sorter.AddField("atkValue", SortField.INT);
            sorter.AddField("defValue", SortField.INT);
            sorter.AddField("ID", SortField.DOC, true, false);
            sorter.AddField("name2", SortField.STRING, true);
            sorter.AddField("japName2", SortField.STRING, true);
            sorter.AddField("element", SortField.STRING);
            sorter.AddField("tribe", SortField.STRING);
            sorter.AddField("level", SortField.INT);

            if (string.Equals(config.GetSetting("SaveLayout"), "True", StringComparison.OrdinalIgnoreCase))
            {
                if (string.Equals(config.GetSetting("DeckView1"), "List", StringComparison.OrdinalIgnoreCase))
                {
                    listViewEx1.View = View.Details;
                }
                else
                {
                    listViewEx1.View = View.LargeIcon;
                }
                if (string.Equals(config.GetSetting("DeckView2"), "List", StringComparison.OrdinalIgnoreCase))
                {
                    listViewEx2.View = View.Details;
                }
                else
                {
                    listViewEx2.View = View.LargeIcon;
                }
                if (string.Equals(config.GetSetting("DeckView3"), "List", StringComparison.OrdinalIgnoreCase))
                {
                    listViewEx3.View = View.Details;
                }
                else
                {
                    listViewEx3.View = View.LargeIcon;
                }
            }
        }