private void btnOpen_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var dialogOpen = new OpenFileDialog();
                dialogOpen.Title = "Open Workflow";
                //dialogOpen.Filter = "Project|*.aut|Workflows (.xaml)|*.xaml";
                dialogOpen.Filter = "Project|*.aut";

                if (dialogOpen.ShowDialog() == true)
                {
                    // using (var file = new StreamReader(dialogOpen.FileName, true))
                    //{
                    NewProjectEventArgs ne = new NewProjectEventArgs();
                    ne.Path            = dialogOpen.FileName;
                    ne.projectType     = ProjectType.openproject;
                    ne.projectFullName = dialogOpen.FileName;
                    OpenProject(sender, ne);
                    // }
                }
            }
            catch (Exception ex)
            {
                Log.Logger.LogData(ex.Message, LogLevel.Error);
            }
        }
        protected virtual void OnNewProjectDiagram(NewProjectEventArgs e)
        {
            NewProjectEventHandler handler = NewProjectDiagram;

            if (handler != null)
            {
                handler(this, e);
            }
        }
 private void btnOpenExplorer_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         NewProjectEventArgs ne = new NewProjectEventArgs();
         ne.projectType = ProjectType.openexplorer;
         OpenProject(sender, ne);
     }
     catch (Exception ex)
     {
         Log.Logger.LogData(ex.Message, LogLevel.Error);
     }
 }
 /// <summary>
 /// Is invoked when a file click or Load File is invoked from the MRU control.
 /// </summary>
 /// <param name="filePathName"></param>
 public void LoadFile(string filePathName)
 {
     try
     {
         NewProjectEventArgs ne = new NewProjectEventArgs();
         ne.Path        = filePathName;
         ne.projectType = ProjectType.openproject;
         OpenProject(null, ne);
         //MessageBox.Show("Demo Opening File: " + filePathName);
     }
     catch (Exception ex)
     {
         Log.Logger.LogData(ex.Message, LogLevel.Error);
     }
 }
        private void CreateProject(object sender, ProjectType projectType)
        {
            try
            {
                NewProject newProject = new NewProject("New Project");
                newProject.ShowDialog();
                if (newProject.DialogResult == true)
                {
                    ProjectName = newProject.ProjectName;
                    Location    = newProject.Location;

                    Location = Location + Path.DirectorySeparatorChar + ProjectName;
                    if (!Directory.Exists(Location))
                    {
                        Directory.CreateDirectory(Location);
                    }

                    string ProjectFullName = Location + Path.DirectorySeparatorChar + ProjectName + ".aut";
                    File.Create(ProjectFullName);

                    if (!Directory.Exists(Location + Path.DirectorySeparatorChar + "Images"))
                    {
                        Directory.CreateDirectory(Location + Path.DirectorySeparatorChar + "Images");
                    }

                    NewProjectEventArgs ne = new NewProjectEventArgs();
                    ne.Path            = Location;
                    ne.projectType     = projectType;
                    ne.projectFullName = ProjectFullName;
                    NewProjectDiagram(sender, ne);
                }
            }
            catch (Exception ex)
            {
                Log.Logger.LogData(ex.Message, LogLevel.Error);
            }
        }