コード例 #1
0
 private void BackStep()
 {
     if (FigList.Size() > 0)
     {
         grRez.Clear(Color.Transparent);
         grMajor.Clear(Color.Transparent);
         FigList.Remove(FigList.Last);
         FigList.PrintList(lboxFigures);
         FigList.DrawAll(grRez);
         grMajor.DrawImage(Layers[1], 0, 0);
         pictureBox1.Refresh();
         BackSteps++;
         if (BackSteps == 3)
         {
             btnBack.Enabled = false;
         }
     }
 }
コード例 #2
0
 private void btnLoad_Click(object sender, EventArgs e)
 {
     isOpenFile                 = true;
     ofdlgLoad.Filter           = "MonsterPaint Pictures|*." + SavedPicturesExtension + "|All Files|*.**";
     ofdlgLoad.InitialDirectory = Application.StartupPath.ToString() + "\\" + SaveLoadPath;
     if (ofdlgLoad.ShowDialog() != DialogResult.Cancel)
     {
         if (ofdlgLoad.FileName != "")
         {
             FileStream fs = (FileStream)ofdlgLoad.OpenFile();
             userfigsbinser = new MyCustomFiguresBinarySerializer();
             FigList.Clear();
             lboxFigures.Items.Clear();
             grRez.Clear(Color.Transparent);
             grMajor.Clear(Color.Transparent);
             pictureBox1.Refresh();
             CurrFig   = -1;
             isPressed = false;
             isMoved   = false;
             isChanged = false;
             try
             {
                 FigList = userfigsbinser.LoadFiguresList(fs, TypesList, UserNamesList, SourceLists);
                 fs.Close();
             }
             catch (System.Runtime.Serialization.SerializationException ee)
             {
                 MessageBoxButtons buttons = MessageBoxButtons.OK;
                 DialogResult      result;
                 result            = MessageBox.Show(ee.Message, "Loading error.", buttons);
                 rbPointer.Checked = true;
             }
             FigList.PrintList(lboxFigures);
             FigList.DrawAll(grMajor);
             grRez.DrawImage(Layers[2], 0, 0);
             pictureBox1.Refresh();
             btnBack.Enabled = false;
         }
     }
     rbPointer.Checked = true;
 }