private void SchedulingWindow_Loaded (object sender, RoutedEventArgs e) { m_ProgrammManagement = new WPMediaManagement.ManagedProgrammManagement (); CommonDataBase.CommonBasics.LoadWPMediaParameter (); m_CVM = new CVM.CommonValues (); m_XAMLHandling = new CVM.XAMLHandling (m_CVM); WMB.WPMediaApplicationState.Instance.Properties ["DataBase"] = DataBase; //CVM.LoginHandler.ApplicationName = "WPTV"; //String userName = String.Empty; //m_Rollen = CVM.LoginHandler.CheckUser (ref userName); //if (m_Rollen == null) // { // Close (); // return; // } Cursor = Cursors.Wait; m_IntelliSenseFactory = new IntelliSenseAutoCompletionFactoryRoutines (DataBase); m_ControlFactory.m_Factory = m_IntelliSenseFactory; //m_XAMLHandling.ShowGridLines = true; Width = 900; Height = 650; m_RootGrid = m_XAMLHandling.CreateGrid (new int [] { 100 }, new int [] { 55, 70, 40 }); this.Content = m_RootGrid; this.Background = SystemColors.ControlLightBrush; CreateAllGrids (); CreateAllControls (); FillSenderComboBox (); SetEventHandler (); Cursor = Cursors.Arrow; if (!ExternalControlServer.HookedInTheCommandProcessingChain ("SchedulingWindow")) { ExternalControlServer.MessageReceivedCall += new ExternalControlServer.MessageReceivedEvent (ExternalRequest_MessageReceivedCall); ExternalControlServer.HookeIntoTheCommandProcessingChain ("SchedulingWindow"); } // ExternalControlServer.StartListening (); }
private void Window_Loaded (object sender, RoutedEventArgs e) { m_UtilityControl = new CommonDataBase.DataBaseUtility (); m_UtilityControl.CloseRequestedHandler += new CloseRequested (m_UtilityControl_CloseRequestedHandler); m_UtilityControl.SetConnectionString ("Data Source=.\\WPMediaLocalSQL;Initial Catalog=Master;" + "Integrated Security=SSPI;User Instance=True"); foreach (String Argument in ApplicationArguments) { if (Argument.IndexOf (".pkg", StringComparison.InvariantCultureIgnoreCase) != -1) { m_UtilityControl.SetConnectionString (string.Empty); m_PackageDataControl = new PackageDataControl (); m_PackageDataControl.PackageFileName = Argument; m_PackageDataControl.CloseRequestedCall += new CloseRequested (m_PackageDataControl_CloseRequestedCall); this.Content = m_PackageDataControl; return; } if (Argument.IndexOf ("WPMediaProgramm") != -1) { m_UtilityControl.SetConnectionString (string.Empty); if (ProgrammManagement == null) { ProgrammManagement = new WPMediaManagement.ManagedProgrammManagement (); ProgrammManagement.ProgrammDefinitionFileName = Argument; } m_ProgrammDataControl = new ProgrammDataControl (); m_ProgrammDataControl.ProgrammManagement = ProgrammManagement; m_ProgrammDataControl.CloseRequestedCall += new CloseRequested (m_ProgrammDataControl_CloseRequestedCall); this.Content = m_ProgrammDataControl; return; } if (Argument.IndexOf ("/SQLExpress") != -1) { break; } if (Argument.IndexOf ("/MachineDSN=") != -1) { String MachineDSN = Argument.Substring ("/MachineDSN=".Length).Replace ("\"", ""); m_UtilityControl.SetConnectionString ("Data Source=" + MachineDSN); break; } if (Argument.IndexOf ("/ConnectString=") != -1) { m_UtilityControl.SetConnectionString (Argument.Substring ("/ConnectString==".Length).Replace ("\"", "")); break; } if (Argument.IndexOf ("/Dynamic") != -1) { CVM.SimpleInputWindow InputWindow = new SimpleInputWindow (); InputWindow.CreateTextFromUserWindow ("Bitte ConnectionString direkt eingeben", ""); if (InputWindow.ShowDialog () != true) { return; } String ConnectionString = InputWindow.GetInput (); m_UtilityControl.SetConnectionString (ConnectionString); break; } if (Argument.IndexOf ("/Select") != -1) { CVM.SimpleInputWindow InputWindow = new SimpleInputWindow (); List<String> AllowedValues = new List<String> (); foreach (System.Configuration.SettingsProperty Prop in Properties.Settings.Default.Properties) { if (Prop.Name.IndexOf ("CS_") != -1) { AllowedValues.Add (Properties.Settings.Default [Prop.Name].ToString ()); } } InputWindow.AllowedValues = AllowedValues.ToArray (); InputWindow.CreateTextFromUserWindow ("Bitte ConnectionString auswählen", ""); if (InputWindow.ShowDialog () != true) { return; } String ConnectionString = InputWindow.GetInput (); m_UtilityControl.SetConnectionString (ConnectionString); break; } } this.Content = m_UtilityControl; }
public void SetParameter () { if (m_Arguments.Count == 0) return; if (!File.Exists (m_Arguments ["P0"])) return; #region Data for Root PreviewBeitrag m_TypeOfBeitrag = WMB.Basics.GetCommandLineContent (m_Arguments, CVM.CommonValues.WPMEDIA_TYPE_OF_BEITRAG); m_OrderNumber = WMB.Basics.GetCommandLineContent (m_Arguments, CVM.CommonValues.WPMEDIA_ORDER_NUMBER); m_BeitragsIDOfPreviewBeitrag = WMB.Basics.GetCommandLineContent (m_Arguments, WPMediaManagement.ManagedProgrammData.Param_VideoBeitragsID); m_ConnectedBeitragsID = WMB.Basics.GetCommandLineContent (m_Arguments, WPMediaManagement.ManagedProgrammData.Param_LogicallyConnectedBeitragsID); //m_FullBeitragToDisplay = new ArrayList (); //m_StartingTimesToDisplay = new ArrayList (); m_ProgrammManagement = new WPMediaManagement.ManagedProgrammManagement (); if (!m_ProgrammManagement.ProgrammData.FullBeitragList.ContainsKey (m_BeitragsIDOfPreviewBeitrag)) { WMB.Basics.ReportErrorToEventViewer ("ProgrammPreview.SetParameter", "Für die ID \"" + m_BeitragsIDOfPreviewBeitrag + "\" gibt es keinen Eintrag"); } m_BeitragsFullDataSetOfPreviewBeitrag = m_ProgrammManagement.ProgrammData.FullBeitragList [m_BeitragsIDOfPreviewBeitrag]; DataRow [] BeitragsSchedulingRows = m_ProgrammManagement.ProgrammData.SchedulingDataSet.Tables ["Scheduling"].Select ("OrderNumber = '" + m_OrderNumber + "'"); if (BeitragsSchedulingRows.Length < 1) { WMB.Basics.ReportErrorToEventViewer ("ProgrammPreview.SetParameter", "Für die OrderNumber = \"" + m_OrderNumber + "\" gibt es keinen Eintrag"); m_TypeOfBeitrag = String.Empty; return; } m_BeitragsSchedulingRow = BeitragsSchedulingRows [0]; List<Slide> SlideList = new List<Slide> (); #endregion if (m_TypeOfBeitrag == WPMediaManagement.ManagedProgrammData.BLOCK_PREVIEW) { Dictionary<String, List<String>> StartTimes = m_ProgrammManagement.ProgrammData.GetStartTimesForEachBeitragIDInThisBlock (m_BeitragsSchedulingRow ["ParentBlockOrderNumber"].ToString ()); m_CompleteRunningTime = (m_HostCVM.TimeToStop - m_HostCVM.GetDateTimeNow).TotalSeconds; TimeSpan PictureIntervall = TimeSpan.FromSeconds(((m_CompleteRunningTime - CVM.CommonValues.DEFAULT_TIME_FOR_COMMON_OPEN_CHANNEL_INFO - CVM.CommonValues.DEFAULT_TIME_FOR_COMMON_BIETE_SUCHE_INFO - CVM.CommonValues.DEFAULT_TIME_FOR_COMMON_PREVIEW_INFO) / StartTimes.Keys.Count)); foreach (String BeitragID in StartTimes.Keys) { if (!m_ProgrammManagement.ProgrammData.FullBeitragList.ContainsKey(BeitragID)) { WMB.Basics.ReportErrorToEventViewer("ProgrammPreview.CreateListOfDisplayableBeitraege", "Der Beitrag \"" + BeitragID + "\" ist nicht zugreifbar"); continue; } SlideList.Add (new Slide ()); SlideList.Last ().Content = new ProgrammEntryPreview (this, BeitragID, m_TypeOfBeitrag) { BeitragToPreviewFullDataSet = m_ProgrammManagement.ProgrammData.FullBeitragList [BeitragID], StartTimesForThisBeitragIDInThisBlock = (StartTimes [BeitragID]) }; SlideList.Last ().Options.DisplayDuration = PictureIntervall; } m_CompleteRunningTime = (m_HostCVM.TimeToStop - m_HostCVM.GetDateTimeNow).TotalSeconds; } else { TimeSpan PictureIntervall = m_ProgrammManagement.ProgrammData.GetDefinedDuration(m_BeitragsSchedulingRow); m_CompleteRunningTime = PictureIntervall.TotalSeconds; if (!m_ProgrammManagement.ProgrammData.FullBeitragList.ContainsKey (m_ConnectedBeitragsID)) { WMB.Basics.ReportErrorToEventViewer ("ProgrammPreview.CreateListOfDisplayableBeitraege", "Der Beitrag \"" + m_ConnectedBeitragsID + "\" ist nicht zugreifbar"); } else { SlideList.Add (new Slide ()); SlideList.Last ().Content = new ProgrammEntryPreview (this, m_ConnectedBeitragsID, m_TypeOfBeitrag) { BeitragToPreviewFullDataSet = m_ProgrammManagement.ProgrammData.FullBeitragList [m_ConnectedBeitragsID] }; SlideList.Last ().Options.DisplayDuration = PictureIntervall; } } SlideShow.Slides = SlideList.ToArray(); SlideShow.TargetControl = TargetContent; }
public ProgrammManagementInterface () { m_ProgrammManagement = new WPMediaManagement.ManagedProgrammManagement (); }