public LibraryFolder(LibraryPage parent)
		{
			Identifier = Guid.NewGuid();
			Parent = parent;
			AddDate = DateTime.Now;

			BannerProperties = new BannerProperties();
			BannerProperties.Font = _headerFont;
			BannerProperties.ForeColor = _foreHeaderColor;

			Files = new List<LibraryLink>();
		}
		public ColumnTitle(LibraryPage parent)
		{
			Parent = parent;
			BannerProperties = new BannerProperties();
		}
示例#3
0
		private void Load()
		{
			BrandingText = string.Empty;
			SyncDate = DateTime.Now;
			MinimizeOnSync = true;
			CloseAfterSync = true;
			ShowProgressDuringSync = true;
			EnableInactiveLinks = true;
			InactiveLinksBoldWarning = true;
			ReplaceInactiveLinksWithLineBreak = false;
			InactiveLinksMessageAtStartup = true;
			SendEmail = false;
			Pages.Clear();
			EmailList.Clear();
			AutoWidgets.Clear();
			ExtraFolders.Clear();

			string file = Path.Combine(Folder.FullName, Constants.StorageFileName);
			if (File.Exists(file))
			{
				var document = new XmlDocument();
				document.Load(file);

				var node = document.SelectSingleNode(@"/Library/Name");
				if (node != null)
					Name = node.InnerText;
				node = document.SelectSingleNode(@"/Library/Identifier");
				if (node != null)
				{
					Guid tempGuid;
					if (Guid.TryParse(node.InnerText, out tempGuid))
						Identifier = tempGuid;
				}
				node = document.SelectSingleNode(@"/Library/BrandingText");
				if (node != null)
					BrandingText = node.InnerText;
				node = document.SelectSingleNode(@"/Library/SyncDate");
				if (node != null)
				{
					DateTime tempDate;
					if (DateTime.TryParse(node.InnerText, out tempDate))
						SyncDate = tempDate;
				}
				node = document.SelectSingleNode(@"/Library/ApplyAppearanceForAllWindows");
				bool tempBool;
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						ApplyAppearanceForAllWindows = tempBool;
				node = document.SelectSingleNode(@"/Library/ApplyWidgetForAllWindows");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						ApplyWidgetForAllWindows = tempBool;
				node = document.SelectSingleNode(@"/Library/ApplyBannerForAllWindows");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						ApplyBannerForAllWindows = tempBool;
				node = document.SelectSingleNode(@"/Library/MinimizeOnSync");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						MinimizeOnSync = tempBool;
				node = document.SelectSingleNode(@"/Library/CloseAfterSync");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						CloseAfterSync = tempBool;
				node = document.SelectSingleNode(@"/Library/ShowProgressDuringSync");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						ShowProgressDuringSync = tempBool;
				node = document.SelectSingleNode(@"/Library/FullSync");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						FullSync = tempBool;
				node = document.SelectSingleNode(@"/Library/VideoConversionWarning");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						VideoConversionWarning = tempBool;
				node = document.SelectSingleNode(@"/Library/EnableInactiveLinks");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						EnableInactiveLinks = tempBool;
				node = document.SelectSingleNode(@"/Library/InactiveLinksBoldWarning");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						InactiveLinksBoldWarning = tempBool;
				node = document.SelectSingleNode(@"/Library/ReplaceInactiveLinksWithLineBreak");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						ReplaceInactiveLinksWithLineBreak = tempBool;
				node = document.SelectSingleNode(@"/Library/InactiveLinksMessageAtStartup");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						InactiveLinksMessageAtStartup = tempBool;
				node = document.SelectSingleNode(@"/Library/SendEmail");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						SendEmail = tempBool;

				node = document.SelectSingleNode(@"/Library/ExtraRoots");
				if (node != null)
					foreach (XmlNode childNode in node.ChildNodes)
					{
						var folder = new RootFolder(this);
						folder.Deserialize(childNode);
						ExtraFolders.Add(folder);
					}

				node = document.SelectSingleNode(@"/Library/PreviewContainers");
				if (node != null)
					foreach (XmlNode childNode in node.ChildNodes)
					{
						var previewContainer = new UniversalPreviewContainer();
						previewContainer.Deserialize(childNode);
						if (!PreviewContainers.Any(x => x.Identifier.Equals(previewContainer.Identifier)))
							PreviewContainers.Add(previewContainer);
					}

				node = document.SelectSingleNode(@"/Library/Pages");
				if (node != null)
					foreach (XmlNode childNode in node.ChildNodes)
					{
						var page = new LibraryPage(this);
						page.Deserialize(childNode);
						Pages.Add(page);
					}
				node = document.SelectSingleNode(@"/Library/EmailList");
				if (node != null)
					foreach (XmlNode childNode in node.ChildNodes)
					{
						if (childNode.Name.Equals("Email"))
							EmailList.Add(childNode.InnerText);
					}
				node = document.SelectSingleNode(@"/Library/AutoWidgets");
				if (node != null)
					foreach (XmlNode childNode in node.ChildNodes)
					{
						var autoWidget = new AutoWidget();
						autoWidget.Deserialize(childNode);
						AutoWidgets.Add(autoWidget);
					}

				node = document.SelectSingleNode(@"/Library/OvernightsCalendar");
				if (node != null)
					OvernightsCalendar.Deserialize(node);

				node = document.SelectSingleNode(@"/Library/IPadContentManager");
				if (node != null)
					IPadManager.Deserialize(node);
				else
				{
					node = document.SelectSingleNode(@"/Library/IPadManager");
					if (node != null)
						IPadManager.Deserialize(node);
				}

				#region Program Manager Settings
				node = document.SelectSingleNode(@"/Library/EnableProgramManagerSync");
				if (node != null)
					if (bool.TryParse(node.InnerText, out tempBool))
						EnableProgramManagerSync = tempBool;

				node = document.SelectSingleNode(@"/Library/ProgramManagerLocation");
				if (node != null)
					ProgramManagerLocation = node.InnerText;
				#endregion

				IsConfigured = true;
			}
			if (Pages.Count == 0)
				Pages.Add(new LibraryPage(this));
		}