Beispiel #1
0
        public void Load()
        {
            var filename = @"D:\Repos\GanttProjectDotNet\test.gan";
            var doc      = XDocument.Load(filename);

            myProject  = new GanttProject();
            area       = new GanttGraphicArea();
            myFacadeUI = new UIFacade();

            myProject.ProjectName  = doc.Root.GetAttribute(Constants.NameAttribute);
            myProject.Organization = doc.Root.GetAttribute(Constants.OrganizationAttribute);
            myProject.MyWebLink    = doc.Root.GetAttribute(Constants.MyWebLinkAttribute);

            area.StartDate = doc.Root.GetAttribute(Constants.AreaStartDateAttribute);

            if (doc.Root.Attribute(Constants.MyFacadeUIViewIndexAttribute) != null)
            {
                myFacadeUI.ViewIndex = doc.Root.GetAttributeINT(Constants.MyFacadeUIViewIndexAttribute);
            }
            if (doc.Root.Attribute(Constants.MyFacadeUIGanttDividerLocationAttribute) != null)
            {
                myFacadeUI.GanttDividerLocation = doc.Root.GetAttributeINT(Constants.MyFacadeUIGanttDividerLocationAttribute);
            }
            if (doc.Root.Attribute(Constants.MyFacadeUIResourceDividerLocationAttribute) != null)
            {
                myFacadeUI.ResourceDividerLocation = doc.Root.GetAttributeINT(Constants.MyFacadeUIResourceDividerLocationAttribute);
            }

            VERSION  = doc.Root.GetAttribute(Constants.VERSIONAttribute);
            LANGUAGE = doc.Root.GetAttribute(Constants.LANGUAGEAttribute);

            ////// See https://bugs.openjdk.java.net/browse/JDK-8133452
            //if (!String.IsNullOrEmpty(myProject.Description))
            //    root.AddElement("description", myProject.Description, true);

            myProject.Description = doc.Root.Element(Constants.DescriptionElement).GetElementValue(Constants.DescriptionElement, true);

            //saveViews(handler);
            //emptyComment(handler);
            //saveCalendar(handler);
            //saveTasks(handler);
            //saveResources(handler);
            //saveAssignments(handler);
            //saveVacations(handler);
            //saveHistory(handler);
            //saveRoles(handler);
            //endElement("project", handler);
            //handler.endDocument();

            //stream.close();
        }
Beispiel #2
0
 public GanttXMLSaver(GanttProject project, TaskTreeUIFacade taskTree, GanttResourcePanel peop, GanttGraphicArea area, UIFacade uIFacade)
 {
     this.area = area;
     myProject = project;
 }