예제 #1
0
        private void DebugMc(MemoryCard memory)
        {
            // ─ │┌ ┐└ ┘├ ┤┬ ┴ ┼
            log.Debug("┌─────────────────────┐");
            log.Debug("│     MEMORY CARD     │");
            log.Debug("└─────────────────────┘\n");

            log.Debug(String.Format("Memory card Path: {0}", memory.GetPath()));
            log.Debug(String.Format("Memory card Free space: {0}", memory.GetFreeSpace()));
            log.Debug(String.Format("Memory card save count: {0}\n", memory.LoadSaves().Count - 2));

            log.Debug("Memory card Save List:\n");

            List <SaveFile> saveList = memory.LoadSaves();

            for (int i = 2; i < saveList.Count; i++)
            {
                log.Debug("┌─────────────────────────────────────────────────────────────────────────────┐");
                log.Debug(String.Format("│  FILE Nº {0,-67}│", String.Format("{0:D3}", i - 1)));
                log.Debug("├─────────────────────────────────────────────────────────────────────────────┤");
                log.Debug(String.Format("│ Save Name: {0,-65}|", saveList[i].FileName));
                log.Debug(String.Format("│ Save Size: {0,-65}|", saveList[i].FileSize));
                log.Debug(String.Format("│ Save Date: {0,-65}|", saveList[i].FileDate));
                log.Debug(String.Format("│ Save Description: {0,-58}|", saveList[i].FileDescription));
                log.Debug("└─────────────────────────────────────────────────────────────────────────────┘\n");
                //Console.WriteLine();
            }
        }
예제 #2
0
        private void ShowMcContent(MemoryCard card, DataGridView mcView)
        {
            mcView.Rows.Clear();

            List <SaveFile> listFiles = card.LoadSaves();

            for (int i = 2; i <= listFiles.Count - 1; i++)
            {
                SaveFile save = listFiles[i];
                mcView.Rows.Add(save.FileName, save.FileSize, save.FileDate, save.FileDescription);
            }

            toolStripStatusLabel1.Text = card.GetPath();
            toolStripStatusLabel2.Text = card.GetFreeSpace();
        }
예제 #3
0
        private MemoryCard DoDelete(ref MemoryCard card)
        {
            if (card != null && card.LoadSaves().Count > 2)
            {
                DialogResult result = MessageBox.Show("This action can't be undone!\nAre you sure?", "Delete save(s)", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);

                if (result == DialogResult.OK)
                {
                    #region Debug
                    log.Debug("Ok button");
                    #endregion

                    string mcPath = card.GetPath();
                    DataGridViewSelectedRowCollection savesCollection = focusedMemoryCard.SelectedRows;

                    DoBatchDelete(mcPath, savesCollection);

                    #region debug
                    log.Debug("\nDelete Save Button Click - Exit.\n" +
                              "───────────────────────────────────────────────────────────────────────────────");
                    #endregion

                    return(RefreshMemoryCard(card, focusedMemoryCard));
                }
                #region Debug
                log.Debug("Cancel button");
                #endregion
            }
            else
            {
                MessageBox.Show("Unable to delete.");
            }

            #region debug
            log.Debug("\nDelete Save Button Click - Exit.\n" +
                      "───────────────────────────────────────────────────────────────────────────────");
            #endregion
            return(card);
        }