Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridViewCollection_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            // sort by column header
            MTGCardSet Temp = new MTGCardSet();

            Temp.CardSet = (ArrayList)dataGridViewCollection.DataSource;
            Temp.Sort(e.ColumnIndex);

            dataGridViewCollection.DataSource = Temp.CardSet;
            UpdateCollectionGrid();

            this.Cursor = Cursors.Default;
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        public MTGClientForm()
        {
            InitializeComponent();

            // init the collection data
            Collection = new MTGCollection();

            // setup the collection data grid view
            SetupDataGridView();

            // Welcome the player
            UpdateStatusStrip("Welcome to Magic the Gathering Online!");

            // Disable all the extra tabs until someone is logged in
            EnableTabPages(false);

            // Load the picture data set
            CardSets = new ArrayList();
            try
            {
                // Attempt to load the last cardset saved
                Stream          stream     = File.Open("10E.dat", FileMode.Open);
                BinaryFormatter bformatter = new BinaryFormatter();

                MTGCardSet cards = new MTGCardSet();
                cards = (MTGCardSet)bformatter.Deserialize(stream);
                stream.Close();

                CardSets.Add(cards);
            }
            catch (Exception ex)
            {
                if (!ex.Message.StartsWith("Could not find file"))
                {
                    LogError(String.Format("Init: ", ex.Message));
                }
                else
                {
                    LogError("Cannot find the cards data pack.");
                }
            }

            WaitingData = new byte[PacketSize];
        }