Пример #1
0
        public FormMain()
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;

            Form splash = new FormSplash();

            splash.Show();
            splash.Refresh();

            // Set up DeckCounter class
            dc = new DeckCounter(deck);
            // Set accessor values
            dc.LabelNumCards = labelNumCards;
            dc.LabelTopdeck  = labelTopdeck;
            dc.FormMain      = this;
            // Load last deck
            if (dc.Options.GetAsString("LastDeck") != "")
            {
                dc.LoadDeck(dc.Options.GetAsString("LastDeck"));
            }

            int w = Screen.PrimaryScreen.WorkingArea.Width;
            int h = Screen.PrimaryScreen.WorkingArea.Height;

            this.MaximumSize = new System.Drawing.Size(w, h);

            splash.Hide();
            splash.Dispose();

            if (dc.Options.GetAsInteger("WindowMainX") != 0)
            {
                this.StartPosition = FormStartPosition.Manual;
                this.Location      = new Point(dc.Options.GetAsInteger("WindowMainX"), dc.Options.GetAsInteger("WindowMainY"));
            }

            dc.SetStayOnTop(dc.Options.GetAsBool("StayOnTop"));
        }
Пример #2
0
 private void buttonLoad_Click(object sender, EventArgs e)
 {
     dc.LoadDeck();
 }