コード例 #1
0
ファイル: Form1.cs プロジェクト: farisais/sigsence-apps-core
        /// <summary>
        /// Function to create project structure
        /// </summary>
        /// <param name="filename">File name for the project structure file</param>
        /// <param name="location">location path of the project struture file</param>
        /// <param name="projectType">The type of the project</param>
        /// <param name="recordDirectory">Directory path of the record file</param>
        void CreateProject(string filename, string location, string projectType, string recordDirectory)
        {
            //Create sigsence project class and store all the information inside
            sigsenceProject = new ProjectEnvirontment();
            sigsenceProject.FileName = filename;
            sigsenceProject.LocationPath = location;
            sigsenceProject.ProjectType = projectType;
            sigsenceProject.ProjectName = filename;
            sigsenceProject.RecordLocationPath = recordDirectory;
            sigsenceProject.ProjectCreationDate = DateTime.Now;

            //List all working panel in the project structure
            sigsenceProject.ListWorkingPanel = new List<DSA_Teaser.Class.UI.WorkingPanel>();
            sigsenceProject.ListWorkingPanel.Add(new DSA_Teaser.Class.UI.WorkingPanel(filename + "_Acquisition", "acquisition"));
            sigsenceProject.ListWorkingPanel.Add(new DSA_Teaser.Class.UI.WorkingPanel(filename + "_Analysis", "analysis"));
            sigsenceProject.ListWorkingPanel.Add(new DSA_Teaser.Class.UI.WorkingPanel(filename + "_Report", "report"));
            treeViewSolutionList.Nodes.Add(filename + "_Project");
            treeViewSolutionList.Nodes[0].Nodes.Add("Sequence");
            treeViewSolutionList.Nodes[0].Nodes.Add("Indicator");
            InitWorkingEnvironment();

            //Notify user that the project structure file has been setup
            if (EnvironmentFunction.CreateProjectXmlFile(location + @"\", filename + ".ssp", sigsenceProject))
            {
                barStaticItemNotif.Caption = filename + ".ssp" + " created in " + location;
            }
            else
            {
                barStaticItemNotif.Caption = "failed to create " + filename + ".ssp" + " in " + location;
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: farisais/sigsence-apps-core
        /// <summary>
        /// Event handler to open and load project structure file and initate it on the working environment
        /// </summary>
        /// <param name="sender">Object that raise the event</param>
        /// <param name="e">Argument that passed by the object</param>
        private void barButtonItemOpen_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            OpenFileDialog openfileForm = new OpenFileDialog();
            openfileForm.Filter = "Sigsence Project File (*.ssp)|*.ssp|All files (*.*)|*.*";
            openfileForm.FilterIndex = 1;
            openfileForm.RestoreDirectory = true;
            openfileForm.InitialDirectory = @"C:\Users\faris\Documents\Sigsence DeskApp V.1.0\Projects";

            if (openfileForm.ShowDialog() == DialogResult.OK)
            {
                treeViewSolutionList.Nodes.Add("Project");
                treeViewSolutionList.Nodes[0].Nodes.Add("Sequence");
                treeViewSolutionList.Nodes[0].Nodes.Add("Indicator");
                sigsenceProject = EnvironmentFunction.LoadProjectFile(openfileForm.FileName, this);
                treeViewSolutionList.Nodes[0].Text = sigsenceProject.ProjectName + "_Project";
                InitWorkingEnvironment();
            }
        }