private static BaseLogic DeserializeLogicItem(XElement itemXML)
        {
            BaseLogic item = new BaseLogic();

            switch (itemXML.Element("Name").Value)
            {
            case "Information":
                item = new InformationResource()
                {
                    ID           = new Guid(itemXML.Element("ID").Value),
                    DesignerID   = new Guid(itemXML.Element("DesignerID").Value),
                    Name         = itemXML.Element("Name").Value,
                    CreationDate = DateTime.Parse(itemXML.Element("CreationDate").Value),
                    Category     = (Category)Enum.Parse(typeof(Category), itemXML.Element("Category").Value),
                    Document     = new Document()
                    {
                        Content = Encoding.ASCII.GetBytes(itemXML.Element("Document").Value)
                    },
                    Title = itemXML.Element("Title").Value
                };
                break;

            default:
                item.ID         = new Guid(itemXML.Element("ID").Value);
                item.DesignerID = new Guid(itemXML.Element("DesignerID").Value);
                item.Name       = itemXML.Element("Name").Value;
                break;
            }
            return(item);
        }
Beispiel #2
0
 public InformationWindow(InformationResource informationResource)
 {
     InitializeComponent();
     InformationResource = informationResource;
     FillData();
     Closing += InformationWindow_Closing;
 }