Example #1
0
		private void StartContentWindow (ButtonPageData ActiveButtonPage,
					XmlNode ButtonEntry, String LinkData, bool IsTheSameButton)
			{
			if (!HandleWindowsTimingConsiderations (ActiveButtonPage,
					ButtonEntry, LinkData, IsTheSameButton))
				return;
			CreateNavigationWindow (NavigationWindowType.SimpleText, LinkData,
					GetPlayingDuration (ActiveButtonPage, ButtonEntry));
/*
			m_OverlayWindow = new Window ();
			m_OverlayWindow.Left = m_CVM.XPosition;
			m_OverlayWindow.Top = m_CVM.YPosition;
			m_OverlayWindow.Width = m_CVM.VideoWidth;
			m_OverlayWindow.Height = m_CVM.VideoHeight;
			m_OverlayWindow.WindowStyle = WindowStyle.None;
			m_OverlayWindow.Closed +=new EventHandler(m_OverlayWindow_Closed); 
			TextBlock LinkDataBlock = new TextBlock ();
			LinkDataBlock.Text = LinkData;
			m_OverlayWindow.Content = LinkDataBlock;
			m_OverlayWindow.Show ();
*/
			m_ResetToProgrammLoopTimer.Start ();
			}
Example #2
0
		private bool HandleWindowsTimingConsiderations (ButtonPageData ActiveButtonPage,
					XmlNode ButtonEntry, String LinkData, bool IsTheSameButton)
			{
			double Duration = GetPlayingDuration (ActiveButtonPage, ButtonEntry);
			if (IsTheSameButton)
				{
				if (m_ResetToProgrammLoopTimer != null)
					{
					m_ResetToProgrammLoopTimer.Stop ();
					m_ResetToProgrammLoopTimer.Interval = TimeSpan.FromSeconds (Duration);
					m_ResetToProgrammLoopTimer.Start ();
					m_OverlayWindow.Show ();
					return false;
					}
				}
			else
				{
				if (m_ResetToProgrammLoopTimer != null)
					{
					m_ResetToProgrammLoopTimer.Stop ();
					m_ResetToProgrammLoopTimer = null;
					}
				if (m_OverlayWindow != null)
					{
					m_OverlayWindow.Hide ();
					m_OverlayWindow.Close ();
					m_OverlayWindow = null;
					}
				}
			m_ResetToProgrammLoopTimer = new System.Windows.Threading.DispatcherTimer ();
			m_ResetToProgrammLoopTimer.Interval = TimeSpan.FromSeconds (Duration);
			m_ResetToProgrammLoopTimer.Tick += new EventHandler (m_ResetToProgrammLoopTimer_Tick);
			m_ResetToProgrammLoopTimer.Tag = ButtonEntry;
			return true;
			}
Example #3
0
		private void StartNavigationWindow (ButtonPageData ActiveButtonPage,
					XmlNode ButtonEntry, String LinkData, bool IsTheSameButton)
			{
			if (!HandleWindowsTimingConsiderations (ActiveButtonPage,
					ButtonEntry, LinkData, IsTheSameButton))
				return;
			CreateNavigationWindow (NavigationWindowType.InternetNavigation, LinkData,
					GetPlayingDuration (ActiveButtonPage, ButtonEntry));

			m_ResetToProgrammLoopTimer.Start ();
			}
Example #4
0
		private Size GetSizeOfButtonField (ButtonPageData ButtonPage, bool DynamicEntries)
			{
			Size Resultat = new Size ();
			XmlNode ColumnDefaultNode;
			XmlNode RowDefaultNode;
			if (DynamicEntries)
				{
				ColumnDefaultNode = ButtonPage.m_Defaults.SelectSingleNode ("child::" + CVM.CommonValues.BUTTON_COLUMN);
				RowDefaultNode = ButtonPage.m_Defaults.SelectSingleNode ("child::" + CVM.CommonValues.BUTTON_ROW);
				}
			else
				{
				ColumnDefaultNode = ButtonPage.m_Defaults.SelectSingleNode ("child::" + CVM.CommonValues.BUTTON_STATIC_COLUMN);
				RowDefaultNode = ButtonPage.m_Defaults.SelectSingleNode ("child::" + CVM.CommonValues.BUTTON_STATIC_ROW);
				}
			if ((ColumnDefaultNode != null)
				&& (RowDefaultNode != null))
				{
				Resultat.Width = Convert.ToInt32 (ColumnDefaultNode.InnerText);
				Resultat.Height = Convert.ToInt32 (RowDefaultNode.InnerText);
				return Resultat;
				}
			int NumberOfColumns = -1;
			int NumberOfRows = -1;
			XmlNodeList Buttons;
			if (DynamicEntries)
				Buttons = ButtonPage.m_ButtonXmlPage.DocumentElement.SelectNodes ("child::"
										+ CVM.CommonValues.BUTTON_ENTRIES + "/"
										+ CVM.CommonValues.BUTTON_ENTRY);
			else
				Buttons = ButtonPage.m_ButtonXmlPage.DocumentElement.SelectNodes ("child::"
										  + CVM.CommonValues.BUTTON_STATIC_ENTRIES + "/"
										  + CVM.CommonValues.BUTTON_ENTRY);
			foreach (XmlNode Button in Buttons)
				{
				XmlAttribute ColumnAttribute = Button.Attributes [CVM.CommonValues.BUTTON_COLUMN];
				XmlAttribute RowAttribute = Button.Attributes [CVM.CommonValues.BUTTON_ROW];
				if ((ColumnAttribute == null)
					|| (RowAttribute == null))
					{
					WMB.Basics.ReportErrorToEventViewer ("RowAttribute.GetSizeOfButtonField",
						"Row/Column Fehler bei File \"" + ButtonPage.m_ButtonXmlPageFileName + "\"");
					return new Size (0, 0);
					}
				if (Convert.ToInt32 (ColumnAttribute.Value) > NumberOfColumns)
					NumberOfColumns = Convert.ToInt32 (ColumnAttribute.Value);
				if (Convert.ToInt32 (RowAttribute.Value) > NumberOfRows)
					NumberOfRows = Convert.ToInt32 (RowAttribute.Value);
				}
			Resultat.Width = NumberOfColumns + 1;
			Resultat.Height = NumberOfRows + 1;
			return Resultat;
			}
Example #5
0
		private double GetPlayingDuration (ButtonPageData ActiveButtonPage,
					XmlNode ButtonEntry)
			{
			if (ButtonEntry == null)
				return ActiveButtonPage.m_PageDefaultLinkDuration;
			XmlNode DurationNode = ButtonEntry.SelectSingleNode ("child::" + CVM.CommonValues.BUTTON_LINK_DURATION);
			double Duration = ActiveButtonPage.m_PageDefaultLinkDuration;
			if (DurationNode != null)
				Duration = Convert.ToDouble (DurationNode.InnerText);
			return Duration;
			}
Example #6
0
		private void CreateRequiredGrid (Grid RootGrid, ButtonPageData ActuallXmlButtons)
			{
			BrushConverter BRConverter = new BrushConverter ();
			GridLengthConverter GLConverter = new GridLengthConverter ();
			RootGrid.Children.Clear ();
			RootGrid.RowDefinitions.Clear ();
			RootGrid.ColumnDefinitions.Clear ();
			int ColumnIndex = 0;
			while (ColumnIndex < ActuallXmlButtons.m_NumberOfRowsAndColumns.Width)
				{
				ColumnDefinition GlobalGrid_Column = new ColumnDefinition ();
				GlobalGrid_Column.Width = (GridLength)GLConverter.ConvertFromString ("*");
				RootGrid.ColumnDefinitions.Add (GlobalGrid_Column);
				ColumnIndex++;
				}
			int RowIndex = 0;
			while (RowIndex < ActuallXmlButtons.m_NumberOfRowsAndColumns.Height)
				{
				RowDefinition GlobalGrid_Row = new RowDefinition ();
				GlobalGrid_Row.Height = (GridLength)GLConverter.ConvertFromString ("*");
				RootGrid.RowDefinitions.Add (GlobalGrid_Row);
				RowIndex++;
				}

			}
Example #7
0
		public void BannerClicked (String UrlToStartWhenClicked)
			{
			if (String.IsNullOrEmpty (UrlToStartWhenClicked))
				return;
			ButtonPageData BannerButtonPage = new ButtonPageData ();
			BannerButtonPage.m_PageDefaultLinkDuration = 30;
			Uri UriToStart = new Uri (UrlToStartWhenClicked);

			StartNavigationWindow (BannerButtonPage, (XmlNode) null, UrlToStartWhenClicked, false);

			}
Example #8
0
		private void AddNewButtonPage (String ButtonPageFileName, bool IAmANavigationPage)
			{
			if (!File.Exists (ButtonPageFileName))
				return;
			XmlDocument RootButtonPage = new XmlDocument ();
			try
				{
				RootButtonPage.Load (ButtonPageFileName);
				}
			catch (Exception XMLExcp)
				{
				WMB.Basics.ReportErrorToEventViewer ("WPMediaNavigarion.ButtonWindow.AddNewButtonPage",
					"XML Fehler bei File \"" + ButtonPageFileName + "\":\r\n"
					+ XMLExcp.ToString());
				return;
				}
			ButtonPageData ButtonPage = new ButtonPageData ();
			ButtonPage.m_ButtonXmlPage = RootButtonPage;
			ButtonPage.m_Entries = ButtonPage.m_ButtonXmlPage.DocumentElement.SelectNodes ("child::"
											+ CVM.CommonValues.BUTTON_ENTRIES + "/" + CVM.CommonValues.BUTTON_ENTRY);
			ButtonPage.m_Defaults = ButtonPage.m_ButtonXmlPage.DocumentElement.SelectSingleNode ("child::"
											+ CVM.CommonValues.BUTTON_DEFAULTS);
			ButtonPage.m_NumberOfRowsAndColumns = GetSizeOfButtonField (ButtonPage, true);
			ButtonPage.m_PageDefaultLinkDuration = CVM.CommonValues.GLOBAL_LINK_DURATION;
			XmlNode DurationNode = ButtonPage.m_Defaults.SelectSingleNode ("child::" + CVM.CommonValues.BUTTON_LINK_DURATION);
			if (DurationNode != null)
				ButtonPage.m_PageDefaultLinkDuration = Convert.ToDouble (DurationNode.InnerText);
			ButtonPage.m_AutoGoBackInterval = 0;
			XmlNode AutoGoBackIntervalNode = ButtonPage.m_Defaults.SelectSingleNode ("child::" + CVM.CommonValues.BUTTON_AUTO_GO_BACK_INTERVAL);
			if (AutoGoBackIntervalNode != null)
				ButtonPage.m_AutoGoBackInterval = Convert.ToDouble (AutoGoBackIntervalNode.InnerText);


			m_ButtonPageStack.Add (ButtonPage);
			m_ButtonStackIndex = m_ButtonPageStack.Count - 1;
			ButtonPage.m_IAmANavigationPage = IAmANavigationPage;
			StartAutoGoBackTimer ();

			}
Example #9
0
		private void CreateRequiredButtons (ButtonPageData ActuallXmlButtons)
			{
			HandleAllButtonPage ButtonPageHandler = new HandleAllButtonPage ();
			ButtonPageHandler.ButtonClickEventHandler = new RoutedEventHandler (Button_Click);
			foreach (XmlNode ButtonEntry in ActuallXmlButtons.m_Entries)
				{
				ButtonPageHandler.CreateThisButton (true, ButtonEntry, ActuallXmlButtons.m_Defaults);
				}
			}
Example #10
0
		private void FillStaticMessages ()
			{
			if (m_ButtonPageStack.Count == 0)
				return;
			ButtonPageData ButtonPage = (ButtonPageData)m_ButtonPageStack [m_ButtonStackIndex];
			XmlNode StaticEntries = ButtonPage.m_ButtonXmlPage.DocumentElement.SelectSingleNode
				("child::" + CVM.CommonValues.BUTTON_STATIC_ENTRIES);
			if (StaticEntries == null)
				return;
			ButtonPageData StaticButtonPage = new ButtonPageData();
			StaticButtonPage.m_ButtonXmlPage = ButtonPage.m_ButtonXmlPage;
			StaticButtonPage.m_Entries = ButtonPage.m_ButtonXmlPage.DocumentElement.SelectNodes ("child::"
											+ CVM.CommonValues.BUTTON_ENTRIES + "/" + CVM.CommonValues.BUTTON_STATIC_ENTRIES);
			StaticButtonPage.m_Defaults = ButtonPage.m_ButtonXmlPage.DocumentElement.SelectSingleNode ("child::"
											+ CVM.CommonValues.BUTTON_DEFAULTS);
			StaticButtonPage.m_NumberOfRowsAndColumns = GetSizeOfButtonField (StaticButtonPage, false);
			CreateRequiredGrid (Static_Grid_Root, StaticButtonPage);
			HandleAllButtonPage ButtonPageHandler = new HandleAllButtonPage ();
			ButtonPageHandler.ButtonClickEventHandler = new RoutedEventHandler(Button_Click);
			
			foreach (XmlNode Entry in StaticEntries)
				{
				ButtonPageHandler.CreateThisButton (false, Entry, StaticButtonPage.m_Defaults);

				}
			}