Ejemplo n.º 1
0
 public void Add(int Action, AMSFileList PreItems)
 {
     if(this.Count < UndoMax)
     {
         this.UndoSteps[Count] = new StructUndo(Action, PreItems);
         this.SelectedStep = this.Count++;
     }
 }
Ejemplo n.º 2
0
        public ListForm(int size)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitComponent call
            FileList = new AMSFileList(size);
            UndoList = new ClassUndo();
        }
Ejemplo n.º 3
0
        public FormRenameDrawing(string oldName,int index, AMSFileList FileList)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            this.textBoxName.Text = oldName;
            this.index = index;
            this.FileList = FileList;
        }
Ejemplo n.º 4
0
 public StructUndo(int Action, AMSFileList PreItems)
 {
     //
     // TODO: Add constructor logic here
     //
     this.Action = Action;
     this.PreItems = new AMSFileList();
     this.PreItems.Count = PreItems.Count;
     for(int i=0; i<this.PreItems.Count; i++)
     {
         this.PreItems.AMSFiles[i].FileName = PreItems.AMSFiles[i].FileName;
         this.PreItems.AMSFiles[i].FilePath = PreItems.AMSFiles[i].FilePath;
     }
 }
Ejemplo n.º 5
0
 public void SaveItem(AMSFileList.AMSFileInfo fi)
 {
     FileInfo FiSrc;
     string FiDest;
     FiSrc = new FileInfo(fi.FilePath);
     FiDest = this.SavePath + "\\" + fi.FileName + ".dwg";
     try
     {
         FiSrc.CopyTo(FiDest,true);
     }
     catch
     {
         MessageBox.Show("Cannot save file to " + this.SavePath,
             "Drawing Window",MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     MessageBox.Show("Save completed to " + this.SavePath,
         "Save",MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
Ejemplo n.º 6
0
 private void menuItemUndo_Click(object sender, System.EventArgs e)
 {
     if(this.UndoList.Count > 0)
     {
         this.FileList = new AMSFileList();
         this.FileList = this.UndoList.UndoSteps[this.UndoList.SelectedStep].PreItems;
         this.listBoxItem.Items.Clear();
         for(int i=0;i<this.FileList.Count;i++)
         {
             this.listBoxItem.Items.Add(this.FileList.AMSFiles[i].FileName);
         }
         this.UndoList.UndoAction();
         UpdateNumFile();
     }
 }