Exemplo n.º 1
0
        public void New()
        {
            var diagramForm = new DiagramForm();

            diagramForm.Show();
            diagramForm.Focus();
        }
Exemplo n.º 2
0
        public AppContext(string filepath)
        {
            Context = this;
            if (Settings.Default.RecentFileList == null)
            {
                Settings.Default.RecentFileList = new StringCollection();
                Settings.Default.Save();
            }

            var diagramForm = new DiagramForm();

            MainForm = diagramForm;
            diagramForm.Show();
            if (string.IsNullOrEmpty(filepath))
            {
                LoadLastFile(diagramForm);
            }
            else
            {
                try
                {
                    diagramForm.OpenFileByPath(filepath);
                }
                catch (Exception exception)
                {
                    MessageBox.Show(string.Format("{0}:{1}{2}", DesignerResources.FileCouldntBeOpened, Environment.NewLine, exception.Message), DesignerResources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            diagramForm.Focus();
        }
Exemplo n.º 3
0
 public PrintPreviewForm(DiagramForm diagramForm)
 {
     InitializeComponent();
     _diagramForm = diagramForm;
     CreateButtons();
     UpdateMarginFields();
     RefreshDocument();
 }
Exemplo n.º 4
0
 public PrintPreviewForm(DiagramForm diagramForm)
 {
     InitializeComponent();
     _diagramForm = diagramForm;
     CreateButtons();
     UpdateMarginFields();
     RefreshDocument();
 }
Exemplo n.º 5
0
        public AppContext()
        {
            Context = this;
            if (Settings.Default.RecentFileList == null)
            {
                Settings.Default.RecentFileList = new StringCollection();
                Settings.Default.Save();
            }

            var diagramForm = new DiagramForm();
            MainForm = diagramForm;
            diagramForm.Show();
            LoadLastFile(diagramForm);
            diagramForm.Focus();
        }
Exemplo n.º 6
0
 private void DiagramFormKeyUp(object sender, KeyEventArgs e)
 {
     if (!e.Control)
     {
         return;
     }
     if (e.KeyCode == Keys.P)
     {
         _fileForm.InitPrint();
         _fileForm.ShowDialog();
     }
     else if (e.KeyCode == Keys.N)
     {
         var diagramForm = new DiagramForm();
         diagramForm.Show();
     }
     else if (e.KeyCode == Keys.O)
     {
         _fileForm.InitOpen();
         _fileForm.ShowDialog();
     }
     else if (e.KeyCode == Keys.S && e.Shift)
     {
         SaveAs();
     }
     else if (e.KeyCode == Keys.S)
     {
         Save();
     }
     else if (e.KeyCode == Keys.OemMinus)
     {
         Designer.Document.Zoom -= 0.1f;
     }
     else if (e.KeyCode == Keys.Oemplus)
     {
         Designer.Document.Zoom += 0.1f;
     }
 }
Exemplo n.º 7
0
 public void LoadLastFile(DiagramForm diagramForm)
 {
     if (!Settings.Default.AutoLoadLastFile || Settings.Default.RecentFileList.Count == 0)
         return;
     var recentFiles = new string[Settings.Default.RecentFileList.Count];
     Settings.Default.RecentFileList.CopyTo(recentFiles, 0);
     foreach (var file in recentFiles)
     {
         var filepath = file;
         if (!Path.IsPathRooted(filepath))
             filepath = Path.Combine(WaveletStudio.Utils.AssemblyDirectory, filepath);
         if (!File.Exists(filepath))
             continue;
         try
         {
             diagramForm.OpenFileByPath(filepath);
             break;
         }
         catch (Exception)
         {
             continue;
         }
     }
 }
Exemplo n.º 8
0
 public FileForm(DiagramForm diagramForm)
 {
     InitializeComponent();
     _diagramForm = diagramForm;
     UpdateFields();
 }
Exemplo n.º 9
0
 public FileForm(DiagramForm diagramForm)
 {
     InitializeComponent();
     _diagramForm = diagramForm;
     UpdateFields();
 }