示例#1
0
        public static void LoadProject(string path, bool tempfile)
        {
            EditingLayer = null;
            SetSidebar(SidebarPages.Layers);
            if (dms != null)
            {
                dms.FileUpdated       -= FU_DMS;
                dms.FileStatusChanged -= FSC_DMS;
            }
            project                = new ProjectData();
            dms                    = new DMS <ProjectData>(DMS_ID, ref project, path);
            dms.FileUpdated       += FU_DMS;
            dms.FileStatusChanged += FSC_DMS;
            if (path != "" && System.IO.File.Exists(path))
            {
                if (tempfile)
                {
                    dms.LoadFileAndClearPath();
                }
                else
                {
                    dms.LoadFromSource();
                }
            }
            else
            {
                SetSidebar(SidebarPages.Layers);
            }
            //TITLE BAR
            if (mainwindowobj != null)
            {
                ((MainWindow)mainwindowobj).FSC(tempfile, tempfile ? "" : path);
            }

            //RECENT PROJECTS
            if (!tempfile)
            {
                rp_container.AddItem(path);
                rp.CheckChanges();
                rp.SaveChanges();
            }
        }