Esempio n. 1
0
 public void TransferTo(PageNavigation transferDataTo)
 {
     transferDataTo.Title = Title;
     transferDataTo.PageType = PageType;
     transferDataTo.Active = Active;
     transferDataTo.Description = Description;
     transferDataTo.Priority = Priority;
     transferDataTo.ShowTwitterFeed = ShowTwitterFeed;
     transferDataTo.ShowPageDescriptionInHeroUnit = ShowPageDescriptionInHeroUnit;
     transferDataTo.DatePublished = DatePublished;
 }
Esempio n. 2
0
 public void TransferTo(PageNavigation transferDataTo)
 {
     transferDataTo.Title           = Title;
     transferDataTo.PageType        = PageType;
     transferDataTo.Active          = Active;
     transferDataTo.Description     = Description;
     transferDataTo.Priority        = Priority;
     transferDataTo.ShowTwitterFeed = ShowTwitterFeed;
     transferDataTo.ShowPageDescriptionInHeroUnit = ShowPageDescriptionInHeroUnit;
     transferDataTo.DatePublished = DatePublished;
 }
Esempio n. 3
0
 public List<PageNavigation> GetNavigation()
 {
     if(!File.Exists(navigationFile))
     {
         StreamWriter sw = null;
         try
         {
             sw = new StreamWriter(navigationFile);
             var page = new PageNavigation
                            {
                                Id = 1,
                                ParentId = null,
                                Title = "Home",
                                DateCreated = DateTime.Now,
                                DateModified = DateTime.Now,
                                Active = true
                            };
             var pages = new List<PageNavigation> {page};
             var serializer = new JavaScriptSerializer();
             var str = serializer.Serialize(pages);
             sw.Write(str);
             sw.Flush();
         }
         finally
         {
             sw.Close();
             sw.Dispose();
             sw = null;
         }
     }
     PageNavigation[] navigation = null;
     StreamReader sr = null;
     try
     {
         sr = new StreamReader(navigationFile);
         var str = sr.ReadToEnd();
         var serializer = new JavaScriptSerializer();
         navigation = serializer.Deserialize<PageNavigation[]>(str);
     }
     finally
     {
         sr.Close();
         sr.Dispose();
         sr = null;
     }
     return navigation.ToList();
 }