예제 #1
0
		public bool SetParameter (CVM.CommonValues cvm, String [] Arguments,
					int VideoWidth, int VideoHeight, double TargetAspectRatio, String PrintQueueName)
			{
			m_CVM = cvm;
			m_Arguments = Arguments;
			m_PrintQueueName = PrintQueueName;
			System.Drawing.Rectangle VideoRectangle = m_CVM.VideoRectangle;
			this.WindowStartupLocation = WindowStartupLocation.Manual;

			m_RootButtonFileName = m_CVM.GetButtonFileName (CVM.CommonValues.BUTTON_ROOT_FILE_NAME);
			if (!File.Exists (m_RootButtonFileName))
				{
				WMB.Basics.ReportErrorToEventViewer ("WPMediaNavigation.SetParameter",
							"Der Root Button File \"" + m_RootButtonFileName + "\" konnte nicht gefunden werden");
				return false;
				}
			FileInfo FileAttributes = new FileInfo (m_RootButtonFileName);
			m_LastWriteTimeForRootButtonPage = FileAttributes.LastWriteTime;
			m_ButtonPageStack = new List<ButtonPageData> ();
			AddNewButtonPage (m_RootButtonFileName, false);
			m_CheckForChangedRootPageTimer = new DispatcherTimer();
			m_CheckForChangedRootPageTimer.Interval = TimeSpan.FromSeconds(300);
#if DEBUG
			m_CheckForChangedRootPageTimer.Interval = TimeSpan.FromSeconds(30);
#endif
			m_CheckForChangedRootPageTimer.Tick += new EventHandler(m_CheckForChangedRootPageTimer_Tick);
			m_CheckForChangedRootPageTimer.Start ();
			return true;
			}
예제 #2
0
        private void cboCertNew_MouseClick(object sender, MouseEventArgs e)
        {
            this.cboCertNew.Visible = true;
            this.label3.Visible     = true;

            cboCertNew.Items.Clear();

            string strPath = Globals.currentDirectory;

            X509Store store = new X509Store("MY", StoreLocation.CurrentUser);

            store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
            X509Certificate2Collection filterCerts = store.Certificates.Find(X509FindType.FindByTimeValid, DateTime.Now, false);
            String CN = "";

            foreach (X509Certificate2 x509 in filterCerts)
            {
                CVM    cvm            = CVM.GetInstance();
                string configFileName = strPath + @"cvm.xml";
                cvm.config(configFileName);
                CertificateStatus ret = cvm.VerifyCertificate(x509);
                if (ret == CertificateStatus.VALID)
                {
                    String   subjectname = x509.Subject;
                    String[] names       = subjectname.Split(',');
                    foreach (String name in names)
                    {
                        if (name.IndexOf("CN=") > 0)
                        {
                            int begin = name.IndexOf("CN=");
                            int len   = name.Length;
                            CN = name.Substring(4, len - 4);

                            cboCertNew.Items.Add(CN);
                            cboCertificate.Items.Add(CN);
                        }
                    }
                }
            }
            if (CN.Equals("") || CN == null)
            {
                // MessageBox.Show("没有有效的证书,请联系管理员!");
            }
            store.Close();

            if (cboCertificate.Items.Count != 0)
            {
                cboCertificate.Text      = cboCertificate.Items[0].ToString();
                cboCertNew.Text          = cboCertificate.Items[0].ToString();
                cboCertNew.SelectedIndex = 0;
            }
            try
            {
                cboCertNew.Focus();
            }
            catch (Exception ex)
            {
                Globals.logAdapter.Record("EX925511256761", ex.Message + ">>" + ex.ToString(), true);
            }
        }
예제 #3
0
		public void SetParameter (CVM.CommonValues Cvm, String [] Arguments, int VideoWidth, int VideoHeight)
			{
			m_CVM = Cvm;
			m_Arguments = Arguments;

			if (m_Arguments.Length > 1)
				{
				foreach (String ArgumentContent in m_Arguments)
					{
					if (ArgumentContent.IndexOf (CVM.CommonValues.WPMEDIA_DURATION_PARAMETER) == 0)
						{
						m_SecondsToStop = Convert.ToDouble (ArgumentContent.Substring
							(CVM.CommonValues.WPMEDIA_DURATION_PARAMETER.Length));

						}
					if (ArgumentContent.IndexOf (CVM.CommonValues.WPMEDIA_STOP_TIME_PARAMETER) == 0)
						{
						m_StopTime = DateTime.Parse (ArgumentContent.Substring
							(CVM.CommonValues.WPMEDIA_STOP_TIME_PARAMETER.Length));
						}
					}
				}
			this.WindowStartupLocation = WindowStartupLocation.Manual;

			m_StarterPage = new RTFPage ();
			m_StarterPage.SetParameter (m_CVM, m_Arguments, VideoWidth, VideoHeight, m_SecondsToStop);
			m_StarterPage.CloseRequestedCall += new CVM.CloseRequested (m_StarterPage_CloseRequestedCall);
			}
예제 #4
0
        /// <summary>
        /// Opens a Jupiter database and reads requested data
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void ReadJupiter(string FileName)
        {
            DataBaseFileName = FileName;
            CanReadJupiter   = false;
            CanReadMikeShe   = true;

            Reader R = new Reader(FileName);

            Task t = Task.Factory.StartNew(() => wells = R.ReadWellsInSteps());

            t.Wait();


            //Start reading the remaining well data
            Task t4 = Task.Factory.StartNew(() => R.ReadLithology(wells));
            JupiterXLFastReader jxf = new JupiterXLFastReader(FileName);

            CVM.SetDataBaseConnection(jxf);
            Task t5 = Task.Factory.StartNew(() => jxf.ReadWaterLevels(wells));

            t5.ContinueWith((tt) => WellsRead());


            //Read plants
            Task t2 = Task.Factory.StartNew(() => Plants = R.ReadPlants(wells));

            t2.Wait();
            BuildPlantList();
            var t3 = t2.ContinueWith((tt) => R.FillInExtractionWithCount(Plants));

            t3.ContinueWith((tt) => PlantsRead());
        }
예제 #5
0
		public XAMLHandling (CVM.CommonValues Cvm)
			{
			m_CVM = Cvm;
			ShowTextFrames = false;
			FramingAroundPercentage = 20;
			MaxPercentage = 100 + FramingAroundPercentage;
			MaxFactor = MaxPercentage / 100;
			}
예제 #6
0
        public IActionResult Edit(int id, [FromBody] CVM con)
        {
            var co = (from c in _context.Contact where id == c.id select c).First();

            co.email = con.email;
            _context.SaveChanges();
            return(Json(true));
        }
		private String [] FillUseOnlyWhenIndexOfIsIn (CVM.CommonValues CVM)
			{
			String [] UseOnlyWhenIndexOfIsIn = new string[1];
			CVM.WPMediaStandbildPlayingData StandBildPlayingData = m_CVM.DeSerializedDesriptionObject as CVM.WPMediaStandbildPlayingData;
			if (StandBildPlayingData == null)
				{
				return null;
				}
			UseOnlyWhenIndexOfIsIn [0] = StandBildPlayingData.TableName + "_Randomizer";
			return UseOnlyWhenIndexOfIsIn;
			}
예제 #8
0
		public void SetParameter (CVM.CommonValues Cvm, String [] Arguments, int VideoWidth,
						int VideoHeight, double CompletePlayLengthInSeconds)
			{
			m_CVM = Cvm;
			m_XAML = new XAMLHandling (m_CVM);
			m_Arguments = Arguments;
			if (m_Arguments.Length == 0)
				return;
			if (!File.Exists (m_Arguments [0]))
				{
				CloseRequestedCall ("");
				return;
				}
			m_WPMediaProgramm = m_CVM.GetExternalProgrammDetails (m_Arguments,
						ref m_ProgrammClass, ref m_ProgrammInstance);
			m_ProgrammRoot = m_CVM.GetProgrammDirectory ();
			m_XAML = new XAMLHandling (m_CVM);
			m_XAML.ShowGridLines = false;
			}
		public void SetParameter (CVM.CommonValues cvm, String [] Arguments, int VideoWidth, int VideoHeight, double TargetAspectRatio)
			{
			WPMediaManagement.SingletonManagedProgrammManagement.Instance.CheckForLoad ();
			m_CVM = cvm;
			m_Arguments = Arguments;
			UseOnlyWhenIndexOfIsIn = FillUseOnlyWhenIndexOfIsIn (m_CVM);
			if (WMB.Basics.IsTestRun)
				CommonDataBase.CommonBasics.ShowWPMediaParameter (UseOnlyWhenIndexOfIsIn);
			m_LoadWPMediaParameterReturnValue = CommonDataBase.CommonBasics.LoadWPMediaParameter (UseOnlyWhenIndexOfIsIn);
			if (m_LoadWPMediaParameterReturnValue == false)
				WMB.Basics.ReportErrorToEventViewer ("PlayingDataProcessMainWindow.SetParameter",
						 "Bei folgenden Parameter Settings entstand ein \"m_LoadWPMediaParameterReturnValue\" Fehler\"\r\n"
						 + String.Join (";\r\n", m_Arguments) + "\"");
			System.Drawing.Rectangle VideoRectangle = m_CVM.VideoRectangle;
			this.WindowStartupLocation = WindowStartupLocation.Manual;

			m_MainDynamicPage = new MainDynamicPage ();
			m_MainDynamicPage.CloseRequestedCall += new CloseRequested (m_MainDynamicPage_CloseRequestedCall);
			m_MainDynamicPage.SetParameter (m_CVM, m_Arguments, m_CVM.VideoWidth,
							m_CVM.VideoHeight, m_CVM.SecondsToStop);
			m_MainDynamicPage.LogWPMediaActivitiesCall = new CVM.LogWPMediaActivities (PlayingDataProcessInterface_LogWPMediaActivitiesCall);
			}
예제 #10
0
		void FillTheIndexerForFixedOrder (CVM.WPMediaStandbildPlayingData StandBildPlayingData)
			{
			StandBildPlayingData.SortedNamesOfActiveDescriptions.Clear ();
			List<int> ActuallFileIndizessesToPlay = new List<int> ();
			int Index = 0;
			foreach (String FileName in StandBildPlayingData.NamesOfActiveDescriptions)
				{
				StandBildPlayingData.SortedNamesOfActiveDescriptions.Add (FileName);
				ActuallFileIndizessesToPlay.Add (Index++);
				}
			StandBildPlayingData.SetFileIndizessesToPlay (ActuallFileIndizessesToPlay);
			}
예제 #11
0
		void FillTheIndexerForSortedOrder
				(CVM.WPMediaStandbildPlayingData StandBildPlayingData, String PlayingOrder)
			{
			SortedDictionary<String, int> SortingField = new SortedDictionary<string, int> ();
			int Index = 0;
			while (Index < StandBildPlayingData.SortFields.Count)
				{
				String SortField = StandBildPlayingData.SortFields [Index];
				int SortingUnifier = 0;
				while (SortingField.Keys.Contains (SortField))
					{
					SortField = StandBildPlayingData.SortFields [Index] + Convert.ToString (SortingUnifier++);
					}
				SortingField.Add (SortField, Index);
				Index++;
				}
			List<int> ActuallFileIndizessesToPlay = new List<int> ();
			if (PlayingOrder == "NameID")
				{
				foreach (KeyValuePair<String, int> Entry in SortingField)
					{
					ActuallFileIndizessesToPlay.Add (Entry.Value);
					}
				}
			else
				if (PlayingOrder == "LastWriteTime")
					{
					foreach (KeyValuePair<String, int> Entry in SortingField)
						{
						ActuallFileIndizessesToPlay.Insert (0, Entry.Value);
						}
					}
				else
					{
					foreach (KeyValuePair<String, int> Entry in SortingField)
						{
						ActuallFileIndizessesToPlay.Add (Entry.Value);
						}
					}


			StandBildPlayingData.SetFileIndizessesToPlay (ActuallFileIndizessesToPlay);
			}
		void FillForVonBisTiming (CVM.TimingsProcessingType ProcessingType)
			{
			m_VonDatePicker.DisplayDate = VonTiming;
			m_VonDatePicker.Tag = CVM.TimingsProcessingType.VonTiming;
			m_VonDatePicker.DisplayDateStart = VonTiming.AddYears (-2);
			m_VonDatePicker.DisplayDateEnd = VonTiming.AddYears (10);
			m_VonDatePicker.Text = VonTiming.ToString (DATE_DISPLAY_FORMAT);

			String VonHours = String.Format ("{0:D2}", VonTiming.Hour);
			String VonMinutes = String.Format ("{0:D2}", VonTiming.Minute);
			m_VonHourComboBox.Text = VonHours;
			m_VonHourComboBox.Tag = CVM.TimingsProcessingType.VonTiming;
			m_VonMinuteComboBox.Text = VonMinutes;
			m_VonMinuteComboBox.Tag = CVM.TimingsProcessingType.VonTiming;
			
			m_BisDatePicker.DisplayDate = BisTiming;
			m_BisDatePicker.Tag = CVM.TimingsProcessingType.BisTiming;
			m_BisDatePicker.DisplayDateStart = BisTiming.AddYears (-2);
			m_BisDatePicker.DisplayDateEnd = BisTiming.AddYears (10);
			m_BisDatePicker.Text = BisTiming.ToString (DATE_DISPLAY_FORMAT);
			String BisHours = String.Format ("{0:D2}", BisTiming.Hour);
			String BisMinutes = String.Format ("{0:D2}", BisTiming.Minute);
			m_BisHourComboBox.Text = BisHours;
			m_BisHourComboBox.Tag = CVM.TimingsProcessingType.BisTiming;
			m_BisMinuteComboBox.Text = BisMinutes;
			m_BisMinuteComboBox.Tag = CVM.TimingsProcessingType.BisTiming;
			}
예제 #13
0
파일: Logon.cs 프로젝트: zhanglg40/hmr
        private void IsUkey()
        {
            string strS = "";

            using (gjtEmrService.emrServiceXml es = new gjtEmrService.emrServiceXml())
            {
                strS = es.GetIsKeyUser(Globals.DoctorID);
            }
            if (ThisAddIn.CanOption(ElementNames.UKey) == true && strS.Trim() == "1")
            {
                this.cboCertNew.Visible = true;
                //this.label3.Visible = true;
                cboCertNew.Items.Clear();
                string    strPath = Globals.currentDirectory;
                X509Store store   = new X509Store("MY", StoreLocation.CurrentUser);
                store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
                X509Certificate2Collection filterCerts = store.Certificates.Find(X509FindType.FindByTimeValid, DateTime.Now, false);
                String CN = "";
                foreach (X509Certificate2 x509 in filterCerts)
                {
                    CVM    cvm            = CVM.GetInstance();
                    string configFileName = strPath + @"cvm.xml";
                    cvm.config(configFileName);
                    CertificateStatus ret = cvm.VerifyCertificate(x509);
                    if (ret == CertificateStatus.VALID)
                    {
                        String   subjectname = x509.Subject;
                        String[] names       = subjectname.Split(',');
                        foreach (String name in names)
                        {
                            if (name.IndexOf("CN=") > 0)
                            {
                                cboCertNew.Visible = true;
                                int begin = name.IndexOf("CN=");
                                int len   = name.Length;
                                CN = name.Substring(4, len - 4);
                                cboCertNew.Items.Add(CN);
                                //cboCertificate.Items.Add(CN);
                            }
                        }
                    }
                    else
                    {
                        cboCertNew.Visible = false;
                    }
                }
                if (CN.Equals("") || CN == null)
                {
                    // MessageBox.Show("没有有效的证书,请联系管理员!");
                }
                store.Close();
                //try
                //{
                //    if (cboCertificate.Items.Count != 0)
                //    {
                //        cboCertificate.Text = cboCertificate.Items[0].ToString();
                //        cboCertNew.Text = cboCertificate.Items[0].ToString();
                //        cboCertNew.SelectedIndex = 0;
                //    }
                //    cboCertNew.Focus();
                //}
                //catch (Exception ex)
                //{
                //}
            }
        }
예제 #14
0
		public void SetParameter (CVM.CommonValues cvm, String [] Arguments,
			int VideoWidth, int VideoHeight, double CompleteDuration)
			{
			try
				{
				m_CVM = cvm;
				m_OldArguments = Arguments;
				if (CompleteDuration > 1)
					ExpectedStopTime = m_CVM.GetDateTimeNow.AddSeconds (CompleteDuration);
				}
			catch (Exception Excp)
				{
				WMB.Basics.ReportErrorToEventViewer ("MainDynamicPage.SetParameter",
					"Folgender Fehler trat auf:\r\n" + Excp.ToString());
				WMB.Basics.ReportErrorToEventViewer ("MainDynamicPage.SetParameter",
							 "Bei folgenden Parameter Settings \"" + String.Join (" ", Arguments) + "\"");

				}

			}
예제 #15
0
		public void FillIndexIndizess (CVM.WPMediaStandbildPlayingData StandBildPlayingData)
			{
			if (StandBildPlayingData.SortedNamesOfActiveDescriptions == null)
				StandBildPlayingData.SortedNamesOfActiveDescriptions = new List<string> ();
			if (Basics.IsTestRun)
				Basics.ReportInformationToEventViewer ("WPMediaRandomController.FillIndexIndizess",
			         Convert.ToString (StandBildPlayingData.SortedNamesOfActiveDescriptions.Count) + " Einträge in UsedFiles vorhanden");
			DataRow TableDefinitionsRow = null;
			if (StandBildPlayingData.FormatierDataSet != null)
				TableDefinitionsRow = StandBildPlayingData.FormatierDataSet.Tables
					 ["TableDefinitions"].Rows [0];
			if (StandBildPlayingData.TableDefinitionTable != null)
				TableDefinitionsRow = StandBildPlayingData.TableDefinitionTable.Rows [0];
			if (TableDefinitionsRow == null)
				return;
			String PlayingOrder = TableDefinitionsRow [CVM.CommonValues.WPMEDIA_ENTRY_PLAYING_ORDER].ToString ();
			String EntryTimingTyp = TableDefinitionsRow [CVM.CommonValues.WPMEDIA_ENTRY_TIMING_TYPE].ToString ();
			String MeaningOfOutsideSetDuration = TableDefinitionsRow
				[CVM.CommonValues.WPMEDIA_MEANING_OF_OUTSIDE_SET_DURATION].ToString ();
			OutsideSetDurationInCentralTableDefinition = -1;
			if (TableDefinitionsRow [CVM.CommonValues.WPMEDIA_OUTSIDE_SET_DURATION] != Convert.DBNull)
				if (!String.IsNullOrEmpty (TableDefinitionsRow [CVM.CommonValues.WPMEDIA_OUTSIDE_SET_DURATION].ToString ()))
					OutsideSetDurationInCentralTableDefinition = Convert.ToDouble (TableDefinitionsRow [CVM.CommonValues.WPMEDIA_OUTSIDE_SET_DURATION]);
			DefaultDurationForOneEntryInCentralTableDefinition = -1;
			if (TableDefinitionsRow [CVM.CommonValues.WPMEDIA_ENTRY_ENTRY_DURATION] != Convert.DBNull)
				if (!String.IsNullOrEmpty (TableDefinitionsRow [CVM.CommonValues.WPMEDIA_ENTRY_ENTRY_DURATION].ToString ()))
					DefaultDurationForOneEntryInCentralTableDefinition = Convert.ToDouble (TableDefinitionsRow [CVM.CommonValues.WPMEDIA_ENTRY_ENTRY_DURATION]);
			CalculatedFullDurationWhenAllEntriesArePlayed = StandBildPlayingData.GetFullDuration ();
			String TableName = TableDefinitionsRow ["TableName"].ToString ();
			if (StandBildPlayingData.SortedNamesOfActiveDescriptions.Count > StandBildPlayingData.OverallNumberOfPicturesToShow)
				{
				Basics.ReportErrorToEventViewer ("WPMediaRandomController.FillIndexIndizess",
					"Da bei der Tabelle \"" + TableName + "\" die Anzahl der StandBildPlayingData.SortedNamesOfActiveDescriptions mit "
					+ Convert.ToString (StandBildPlayingData.SortedNamesOfActiveDescriptions.Count)
					+ " über der Zahl der möglichen\r\nEinträge "
					+ Convert.ToString (StandBildPlayingData.OverallNumberOfPicturesToShow)
					+ " liegt, werden alle UsedFilesNames gelöscht");
				StandBildPlayingData.SortedNamesOfActiveDescriptions.Clear ();
				}

			if ((PlayingOrder == CVM.CommonValues.XML_PLAYING_ORDER_RANDOM)
				&& (OutsideSetDurationInCentralTableDefinition < 0))
				{
				if (Basics.IsTestRun)
					Basics.ReportInformationToEventViewer ("WPMediaRandomController.FillIndexIndizess",
								 "Die Tabelle \"" + TableName + "\" wird mit der Procedure\r\n\""
								 + "FillTheIndexerForRandomOrder\" behandelt");

				FillTheIndexerForRandomOrder (StandBildPlayingData);
				return;
				}


			if ((PlayingOrder == CVM.CommonValues.XML_PLAYING_ORDER_RANDOM)
				&& (MeaningOfOutsideSetDuration == CVM.CommonValues.WPMEDIA_MEANING_OF_OUTSIDE_SET_DURATION_MAX)
				&& (CalculatedFullDurationWhenAllEntriesArePlayed < OutsideSetDurationInCentralTableDefinition))
				{
				if (Basics.IsTestRun)
					Basics.ReportInformationToEventViewer ("WPMediaRandomController.FillIndexIndizess",
								 "Die Tabelle \"" + TableName + "\" wird mit der Procedure\r\n\""
								 + "FillTheIndexerForRandomOrder\" behandelt");
				FillTheIndexerForRandomOrder (StandBildPlayingData);
				return;
				}

			if ((PlayingOrder == CVM.CommonValues.XML_PLAYING_ORDER_FIX)
				&& (OutsideSetDurationInCentralTableDefinition < 0))
				{
				if (Basics.IsTestRun)
					Basics.ReportInformationToEventViewer ("WPMediaRandomController.FillIndexIndizess",
								 "Die Tabelle \"" + TableName + "\" wird mit der Procedure\r\n\""
								 + "FillTheIndexerForFixedOrder\" behandelt");
				FillTheIndexerForFixedOrder (StandBildPlayingData);
				return;
				}

			if ((PlayingOrder == CVM.CommonValues.XML_PLAYING_ORDER_FIX)
				&& (MeaningOfOutsideSetDuration == CVM.CommonValues.WPMEDIA_MEANING_OF_OUTSIDE_SET_DURATION_MAX)
				&& (CalculatedFullDurationWhenAllEntriesArePlayed < OutsideSetDurationInCentralTableDefinition))
				{
				if (Basics.IsTestRun)
					Basics.ReportInformationToEventViewer ("WPMediaRandomController.FillIndexIndizess",
								 "Die Tabelle \"" + TableName + "\" wird mit der Procedure\r\n\""
								 + "FillTheIndexerForFixedOrder\" behandelt");
				FillTheIndexerForFixedOrder (StandBildPlayingData);
				return;
				}

			if ((PlayingOrder == CVM.CommonValues.XML_PLAYING_ORDER_REPEAT)
				&& (EntryTimingTyp == CVM.CommonValues.XML_PLAYING_ORDER_FIX))
				{
				if (Basics.IsTestRun)
					Basics.ReportInformationToEventViewer ("WPMediaRandomController.FillIndexIndizess",
								 "Die Tabelle \"" + TableName + "\" wird mit der Procedure\r\n\""
								 + "FillTheIndexerForFixedOrder\" behandelt");
				FillTheIndexerForFixedOrder (StandBildPlayingData);
				return;
				}

			if ((PlayingOrder != "Random")
				&& (PlayingOrder != "Repeat"))
			//&& (OutsideSetDuration < 0))
				{
				if (Basics.IsTestRun)
					Basics.ReportInformationToEventViewer ("WPMediaRandomController.FillIndexIndizess",
								 "Die Tabelle \"" + TableName + "\" wird mit der Procedure\r\n\""
								 + "FillTheIndexerForSortedOrder\" behandelt");
				FillTheIndexerForSortedOrder (StandBildPlayingData, PlayingOrder);
				return;
				}

			if (Basics.IsTestRun)
				Basics.ReportInformationToEventViewer ("WPMediaRandomController.FillIndexIndizess",
							 "Die Tabelle \"" + TableName + "\" wird mit der (Default-)Procedure\r\n\""
							 + "FillTheIndexerForRandomOrder\" behandelt");
			FillTheIndexerForRandomOrder (StandBildPlayingData);
			return;
			}
예제 #16
0
		private RadioButton [] CreateBoolLine (CVM.TableLayoutDefinition ContentInstance,
									PropertyInfo PropInfo,
									RowDefinition MainRow, Grid SubGrid, String [] Labels, FieldInfo HelpField)
			{
			GridLengthConverter GLConverter = new GridLengthConverter ();
			MainRow.Height = (GridLength)GLConverter.ConvertFromString ("*");
			MainRow.MinHeight = 20;
			Grid SubSubGrid = new Grid ();
			SubGrid.Children.Add (SubSubGrid);
			Grid.SetColumn (SubSubGrid, 1);
			SubSubGrid.ColumnDefinitions.Add (new ColumnDefinition ());
			SubSubGrid.ColumnDefinitions [0].Width = (GridLength)GLConverter.ConvertFromString ("*");
			SubSubGrid.ColumnDefinitions.Add (new ColumnDefinition ());
			SubSubGrid.ColumnDefinitions [1].Width = (GridLength)GLConverter.ConvertFromString ("*");
			RadioButton Yes = new RadioButton ();
			Yes.Name = "Yes";
			Yes.VerticalAlignment = VerticalAlignment.Center;
			Yes.Content = Labels [0];
			RadioButton No = new RadioButton ();
			No.Name = "No";
			No.VerticalAlignment = VerticalAlignment.Center;
			No.Content = Labels [1];
			SubSubGrid.Children.Add (Yes);
			Grid.SetColumn (Yes, 0);
			SubSubGrid.Children.Add (No);
			Grid.SetColumn (No, 1);
			if (HelpField != null)
				{
				Yes.ToolTip = (String) HelpField.GetValue (null);
				No.ToolTip = (String) HelpField.GetValue (null);
				}
			Object PropertyContent = PropInfo.GetValue (ContentInstance, BindingFlags.GetProperty, null, null, null);
			Yes.Tag = PropInfo;
			No.Tag = PropInfo;
			String BoolValue = Convert.ToString (PropInfo);
			if (BoolValue == "Ja")
				{
				Yes.IsChecked = true;
				No.IsChecked = false;
				}
			else
				{
				Yes.IsChecked = false;
				No.IsChecked = true;
				}
			Yes.Checked += new RoutedEventHandler (YesNo_Checked);
			No.Checked += new RoutedEventHandler (YesNo_Checked);
			return new RadioButton [] { Yes, No };
			}
예제 #17
0
	private void InsertOverlay (CVM.CommonValues.PictureSourceType PictureSourceType)
		{
		switch (PictureSourceType)
			{
			case CVM.CommonValues.PictureSourceType.Nothing:
				{
				this.OverlayInsertPlaceHolder.Visibility = Visibility.Collapsed;
				this.OverlayMaterialPlaceHolder.Visibility = Visibility.Collapsed;
				break;
				}
			case CVM.CommonValues.PictureSourceType.Material:
				{
				try
					{
					if (m_HostCVM.MaterialOverlaySettingsNodeList.Count > 0)
						{
						if (this.OverlayMaterialPlaceHolder.Children.Count == 0)
							{
							foreach (XmlNode MaterialOverlay in m_HostCVM.MaterialOverlaySettingsNodeList)
								{
								Panel NewOverlay = m_XAML.CreateControlOutOfAutoGenerationEntry
										(m_HostCVM.WPMediaRoot, MaterialOverlay.ChildNodes [0]);
								if (NewOverlay != null)
									{
									this.OverlayMaterialPlaceHolder.Children.Add (NewOverlay);
									}
								}
							}
						}
					}
				catch (Exception MaterialExcp)
					{
					WMB.Basics.ReportErrorToEventViewer ("InsertOverlay.InsertMaterials",
						"Beim Erzeugen der MaterialOverlay Controls trat folgender Fehler auf:\r\n"
						+ MaterialExcp.ToString());
					}
				this.OverlayMaterialPlaceHolder.Visibility = Visibility.Visible;
				this.OverlayInsertPlaceHolder.Visibility = Visibility.Collapsed;
				break;
				}
			case CVM.CommonValues.PictureSourceType.Insert:
				{
				try
					{
					if (m_HostCVM.InsertOverlaySettingsNodeList.Count > 0)
						{
						if (this.OverlayInsertPlaceHolder.Children.Count == 0)
							{
							foreach (XmlNode InsertOverlay in m_HostCVM.InsertOverlaySettingsNodeList)
								{
								Panel NewOverlay = m_XAML.CreateControlOutOfAutoGenerationEntry
										(m_HostCVM.WPMediaRoot, InsertOverlay.ChildNodes [0]);
								if (NewOverlay != null)
									{
									this.OverlayInsertPlaceHolder.Children.Add (NewOverlay);
									}
								}
							}
						}
					}
				catch (Exception InsertExcp)
					{
					WMB.Basics.ReportErrorToEventViewer ("InsertOverlay.InsertInserts",
						"Beim Erzeugen der InsertOverlay Controls trat folgender Fehler auf:\r\n"
						+ InsertExcp.ToString());
					}
				this.OverlayInsertPlaceHolder.Visibility = Visibility.Visible;
				this.OverlayMaterialPlaceHolder.Visibility = Visibility.Collapsed;
				break;
				}
			}

		}
예제 #18
0
파일: Page1.xaml.cs 프로젝트: heinzsack/DEV
		String DataRowWindow_DefineSelectionWindowControlsCall (CVM.SelectWindow Parent, Grid RootGrid, string Bereich,
			object Sender, string TableName, string ID, string [] Additionals, string [] BackAdditionals)
			{
			m_CallBackParent = Parent;
			//if (m_AdressenSelectionControl == null)
				{
				m_AdressenSelectionControl = new SelectAdressen ();
				m_AdressenSelectionControl.SelectionFinishedEventCall += 
					new SelectWindow.SelectionFinishedEvent (SelectionFinishedEventCall);
				m_AdressenSelectionControl.m_DataBase = DataBase;
				m_AdressenSelectionControl.HandleShowAndEditListBoxEntry_MouseRightButtonUpCall 
					+=new HandleShowAndEditListBoxEntry_MouseRightButtonUpEvent
						(SelectionControl_HandleShowAndEditListBoxEntry_MouseRightButtonUpCall);
				}
			//if (m_TypenSelectionControl == null)
				{
				m_TypenSelectionControl = new SelectTypen ();
				m_TypenSelectionControl.SelectionFinishedEventCall +=
					new SelectWindow.SelectionFinishedEvent (SelectionFinishedEventCall);
				m_TypenSelectionControl.DataBase = DataBase;
				}
			//if (m_PersonenTypenSelectionControl == null)
				{
				m_PersonenTypenSelectionControl = new SelectPersonenTypen ();
				m_PersonenTypenSelectionControl.SelectionFinishedEventCall +=
					new SelectWindow.SelectionFinishedEvent (SelectionFinishedEventCall);
				m_PersonenTypenSelectionControl.DataBase = DataBase;
				}
			//if (m_PersonenSelectionControl == null)
				{
				m_PersonenSelectionControl = new SelectPersonen ();

				m_PersonenSelectionControl.SelectionFinishedEventCall +=
					new SelectWindow.SelectionFinishedEvent (SelectionFinishedEventCall);
				m_PersonenSelectionControl.DataBase = DataBase;
				m_PersonenSelectionControl.HandleShowAndEditListBoxEntry_MouseRightButtonUpCall +=
					new HandleShowAndEditListBoxEntry_MouseRightButtonUpEvent
						(SelectionControl_HandleShowAndEditListBoxEntry_MouseRightButtonUpCall);
				}
			RootGrid.Children.Clear ();
			String Title = "Not defined";
			if (TableName == "Adressen")
				{
				RootGrid.Children.Add (m_AdressenSelectionControl);
				m_AdressenSelectionControl.Visibility = Visibility.Visible;
				m_AdressenSelectionControl.SetData (Bereich, Sender, TableName, ID, Additionals, BackAdditionals);
				Title = "Bitte wählen Sie die neue Adresse aus";
				m_AdressenSelectionControl.SetSelectionPossible (true);
				m_TypenSelectionControl.Visibility = Visibility.Collapsed;
				m_PersonenTypenSelectionControl.Visibility = Visibility.Collapsed;
				m_PersonenSelectionControl.Visibility = Visibility.Collapsed;
				}
			if (TableName == "Personen")
				{
				RootGrid.Children.Add (m_PersonenSelectionControl);
				m_PersonenSelectionControl.Visibility = Visibility.Visible;
				m_PersonenSelectionControl.SetData (Bereich, Sender, TableName, ID, Additionals, BackAdditionals);
				Title = "Bitte wählen Sie die neue Person aus";
				m_AdressenSelectionControl.Visibility = Visibility.Collapsed;
				m_TypenSelectionControl.Visibility = Visibility.Collapsed;
				m_PersonenTypenSelectionControl.Visibility = Visibility.Collapsed;
				//if (SelectionApplyEventCall != null)
				m_PersonenSelectionControl.SelectionApplyEventCall
					+= new SelectWindow.SelectionApplyEvent
						(WindowSelectionApplyEventCall);
						
				}
			if (TableName == "PersonenTypen")
				{
				RootGrid.Children.Add (m_PersonenTypenSelectionControl);
				m_PersonenTypenSelectionControl.Visibility = Visibility.Visible;
				m_PersonenTypenSelectionControl.SetData (Bereich, Sender, TableName, ID, Additionals, BackAdditionals);
				Title = "Bitte wählen Sie den neuen Personen Typ aus";
				m_PersonenSelectionControl.Visibility = Visibility.Collapsed;
				m_AdressenSelectionControl.Visibility = Visibility.Collapsed;
				m_TypenSelectionControl.Visibility = Visibility.Collapsed;
				}
			if (TableName == "OrganisationsTypen")
				{
				RootGrid.Children.Add (m_TypenSelectionControl);
				m_TypenSelectionControl.Visibility = Visibility.Visible;
				m_TypenSelectionControl.SetData (Bereich, Sender, TableName, ID, Additionals, BackAdditionals);
				Title = "Bitte wählen Sie den neuen OrganisationsTyp aus";
				m_PersonenTypenSelectionControl.Visibility = Visibility.Collapsed;
				m_PersonenSelectionControl.Visibility = Visibility.Collapsed;
				m_AdressenSelectionControl.Visibility = Visibility.Collapsed;
				}
			if (TableName == "OrganisationsSubTypen")
				{
				RootGrid.Children.Add (m_TypenSelectionControl);
				m_TypenSelectionControl.Visibility = Visibility.Visible;
				m_TypenSelectionControl.SetData (Bereich, Sender, TableName, ID, Additionals, BackAdditionals);
				Title = "Bitte wählen Sie den neuen OrganisationsSubTyp aus";
				m_PersonenTypenSelectionControl.Visibility = Visibility.Collapsed;
				m_PersonenSelectionControl.Visibility = Visibility.Collapsed;
				AdressenSelectionControl.Visibility = Visibility.Collapsed;
				}
			return Title;
			}
예제 #19
0
		public static void ClearPropertiesControlBinding(CVM.ManagedPropertiesControl ControlToFill)
			{
			BindingOperations.ClearBinding(ControlToFill, CVM.ManagedPropertiesControl.OptionStorageProperty);
			}
예제 #20
0
		public static Binding SetPropertiesControlBinding (DataRowView AktuellView,
			CVM.ManagedPropertiesControl ControlToFill, String DataColumnName)
			{
			Binding PropertiesControlBinding = new Binding (DataColumnName);
			PropertiesControlBinding.Source = AktuellView;
			ControlToFill.SetBinding(CVM.ManagedPropertiesControl.OptionStorageProperty,
							PropertiesControlBinding);
			return PropertiesControlBinding;
			}
예제 #21
0
        public static List<PositioningEntry> ShowFrameGeometry (double DrawingWidth, GraphicsHandling GraphicsHandler,
            CVM.RedrawInformation RedrawData, Grid RootGridForAllDrawings, String PageIDToProcess, RedrawMeEvent RedrawMeEventCall,
            GraphicsSingleton.DoThisAfterContextProcessingEvent DoThisAfterContextProcessingCall,
            SetUIElementsEnabelingToEvent SetUIElementsEnabelingToEventHandlerParameter,
            CVM.ActivatePageIDEvent ActivatePageIDEventHandler,
            CVM.GetBeitragsDatenFromBeitragsIDEvent GetBeitragsDatenFromBeitragsIDParameter,
            WMB.CloseRequested PosWindow_CloseRequestedEntry,
            RedrawFrameGeometryEvent RedrawFrameGeometryCall)
            {
            RedrawMeEventHandler = RedrawMeEventCall;
            DoThisAfterContextProcessingEventHandler = DoThisAfterContextProcessingCall;
            SetUIElementsEnabelingToEventHandler = SetUIElementsEnabelingToEventHandlerParameter;
            GetBeitragsDatenFromBeitragsIDHandler = GetBeitragsDatenFromBeitragsIDParameter;

            GraphicsSingleton SingletonInstance = GraphicsSingleton.Instance;
            SingletonInstance.SetDoThisAfterContextProcessingCall (DoThisAfterContextProcessingCall);
            SingletonInstance.RedrawData = RedrawData;
//DeleteExistingFrames (SingletonInstance.ListOfPositioningEntryInstances);
            TargetAspectRatio = GraphicsHandler.TargetPictureWidth / GraphicsHandler.TargetPictureHeight;
            ResizingFactor = GraphicsHandler.TargetPictureWidth / DrawingWidth;
            TargetPictureWidth = GraphicsHandler.TargetPictureWidth / ResizingFactor;
            TargetPictureHeight = GraphicsHandler.TargetPictureHeight / ResizingFactor;
            PositioningEntry.TargetPictureWidth = TargetPictureWidth;
            PositioningEntry.TargetPictureHeight = TargetPictureHeight;
            PositioningEntry.TargetAspectRatio = TargetAspectRatio;
            PositioningEntry.ResizingFactor = ResizingFactor;
            int LocalRootGridLastIndexNotToDelete = RootGridForAllDrawings.Children.Count;
            if (SingletonInstance.ListOfPositioningEntryInstances == null)
                SingletonInstance.ListOfPositioningEntryInstances = new List<PositioningEntry> ();
// by sac
            SingletonInstance.GraphicsHandler.ClearRootCanvas ();
            SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.MinWidth = TargetPictureWidth;
            SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.Width = TargetPictureWidth;
            SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.MinHeight = TargetPictureHeight;
            SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.Height = TargetPictureHeight;
            SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.AllowDrop = true;

            int DuplicationID = RedrawData.PageIndex;
            Image TargetImage = RedrawData.TargetImage;
            DataRow PageRow = GraphicsHandler.FrameDataDataSetReader.Tables ["Pages"]
                .Select ("ID = '" + RedrawData.PageID + "'") [0];
            DataRow [] FrameContentRows = GraphicsHandler.FrameDataDataSetReader.Tables ["FrameContent"]
                .Select ("PageID = '" + RedrawData.PageID + "'", "FrameOrder");
            foreach (DataRow FrameContentRow in FrameContentRows)
                {
                if (DuplicationID != -1)
                    if ((Convert.ToInt32 (FrameContentRow ["MultiPageIndex"]) != -1)
                        && (Convert.ToInt32 (FrameContentRow ["MultiPageIndex"]) != DuplicationID))
                        continue;
                if (!String.IsNullOrEmpty (FrameContentRow ["ItemName"].ToString ()))
                    if (GraphicsHandler.ActuallReadableContentRow.Table.Columns [FrameContentRow ["ItemName"].ToString ()] == null)
                        continue;
                DataRow [] FrameRows = GraphicsHandler.FrameDataDataSetReader.Tables ["Frames"]
                    .Select ("ID = '" + FrameContentRow ["FrameID"].ToString () + "'");
                if (FrameRows.Length != 1)
                    {
                    Basics.ReportErrorToEventViewer ("GraphicsHandling.ShowFrameGeometry",
                        "Fehler in der Frame und FrameContent Kombination:\r\n"
                        + "FrameContentID = \"" + FrameContentRow ["ID"].ToString ()
                        + "\" NameID = \"" + FrameContentRow ["NameID"].ToString () + "\r\nFrameID = \""
                        + FrameContentRow ["FrameID"].ToString () + "\"");
                    MessageBox.Show ("Fehler in der Frame und FrameContent Kombination:\r\n"
                                     + "FrameContentID = \"" + FrameContentRow ["ID"].ToString ()
                                     + "\" NameID = \"" + FrameContentRow ["NameID"].ToString () + "\r\nFrameID = \""
                                     + FrameContentRow ["FrameID"].ToString () + "\"");
                    continue;
                    }

                bool Found = false;
                String FrameID = FrameContentRow ["FrameID"].ToString ();
                foreach (PositioningEntry ExistingPositioningEntryInstance in SingletonInstance.ListOfPositioningEntryInstances)
                    {
                    if (ExistingPositioningEntryInstance.FrameID == FrameID)
                        {
                        ExistingPositioningEntryInstance.FillMeFromDataBase ();
                        Found = true;
                        break;
                        }
                    }
                if (Found == false)
                    {
                    PositioningEntry NewPositioningEntryInstance = new PositioningEntry ();
                    NewPositioningEntryInstance.FrameRow = FrameRows [0];
                    NewPositioningEntryInstance.FrameID = FrameID;
                    NewPositioningEntryInstance.FrameContentRow = FrameContentRow;
                    PositioningEntry.SetUIElementsEnabelingToEventHandler = SetUIElementsEnabelingToEventHandler;
                    PositioningEntry.ActivatePageIDEventHandler = ActivatePageIDEventHandler;
                    NewPositioningEntryInstance.RootUIElement = RootGridForAllDrawings;
                    NewPositioningEntryInstance.RedrawMeEventCall += RedrawMeEventCall;
                    NewPositioningEntryInstance.RedrawFrameGeometryCall += RedrawFrameGeometryCall;
                    NewPositioningEntryInstance.PageID = PageIDToProcess;
                    NewPositioningEntryInstance.RootGrid = RootGridForAllDrawings;
                    NewPositioningEntryInstance.RootGridLastIndexNotToDelete = LocalRootGridLastIndexNotToDelete;
                    //			NewPositioningEntryInstance.AllFrames = SingletonInstance.ListOfPositioningEntryInstances;
                    NewPositioningEntryInstance.CloseRequestedCall += PosWindow_CloseRequestedEntry;
                    NewPositioningEntryInstance.FillMeFromDataBase ();
                    SingletonInstance.ListOfPositioningEntryInstances.Add (NewPositioningEntryInstance);
                    }
                }

            int Index = 0;
            PositioningEntry PosWindowToSelect = null;
            foreach (PositioningEntry PosEntry in SingletonInstance.ListOfPositioningEntryInstances)
                {
                if (SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities
                    .Children.Contains (PosEntry.FramingRectangle) == false)
                    SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.Children.Add (PosEntry.FramingRectangle);
                Canvas.SetLeft (PosEntry.FramingRectangle, PosEntry.Left);
                Canvas.SetTop (PosEntry.FramingRectangle, PosEntry.Top);
                if (Index == LastSelectedIndex)
                    PosWindowToSelect = PosEntry;
                Index++;
                }
            //if (PosWindowToSelect != null)
            //    {
            //    PosWindowToSelect.PositionableEntry_MouseDown (PosWindowToSelect.FramingRectangle, null);
            //    }
            if (Basics.IsTestRun)
                Basics.ReportInformationToEventViewer ("PositioningEntry.ShowFrameGeometry (static)",
                    "SingletonInstance.ListOfPositioningEntryInstances mit "
                    + Convert.ToString (SingletonInstance.ListOfPositioningEntryInstances.Count)
                    + " returned");

            return SingletonInstance.ListOfPositioningEntryInstances;
            }
예제 #22
0
		private void CreateControlContentForSingleEntry (CVM.TableLayoutDefinition ContentInstance,
									System.Type ContentClass, Grid Parent)
			{
			Parent.Children.Clear ();
			Parent.RowDefinitions.Clear ();
			Parent.ColumnDefinitions.Clear ();
			PropertyInfo [] Properties = ContentClass.GetProperties ();
			GridLengthConverter GLConverter = new GridLengthConverter ();

			int RowIndex = 0;
			foreach (PropertyInfo PropInfo in Properties)
				{
				String LabePropertyName = PropInfo.Name;
				String OptionStringName = LabePropertyName + "_Option";
				FieldInfo OptionField = (FieldInfo)ContentClass.GetField (OptionStringName);
				String Options;
				if (OptionField != null)
					{
					Options = (String)OptionField.GetValue (ContentInstance);
					if (Options.IndexOf ("NoUpdate") != -1)
						continue;
					}
				String HelpStringName = LabePropertyName + "_Help";
				FieldInfo HelpField = (FieldInfo) ContentClass.GetField (HelpStringName);
				RowDefinition MainRow = new RowDefinition ();
				Parent.RowDefinitions.Add (MainRow);
				Grid SubGrid = new Grid ();
				Parent.Children.Add (SubGrid);
				Grid.SetRow (SubGrid, RowIndex++);
				Grid.SetColumn (SubGrid, 0);
				Label PropertyNameLabel = new Label ();
				PropertyNameLabel.Content = LabePropertyName;
				SubGrid.Children.Add (PropertyNameLabel);
				Grid.SetRow (PropertyNameLabel, 0);
				SubGrid.ColumnDefinitions.Add (new ColumnDefinition ());
				SubGrid.ColumnDefinitions [0].Width = (GridLength)GLConverter.ConvertFromString ("6" + "*");
				SubGrid.ColumnDefinitions.Add (new ColumnDefinition ());
				SubGrid.ColumnDefinitions [1].Width = (GridLength)GLConverter.ConvertFromString ("8" + "*");
				SubGrid.RowDefinitions.Add (new RowDefinition ());
				SubGrid.RowDefinitions [0].Height = (GridLength)GLConverter.ConvertFromString ("*");
				if (PropInfo.PropertyType == typeof (int))
					{
					TextBox ContentBox = CreateSimpleLine (ContentInstance, PropInfo, MainRow, SubGrid, HelpField);
					}
				if (PropInfo.PropertyType == typeof (double))
					{
					TextBox ContentBox = CreateSimpleLine (ContentInstance, PropInfo, MainRow, SubGrid, HelpField);
					}
				if (PropInfo.PropertyType == typeof (Size))
					{
					TextBox [] ContentBoxes = CreateTwoSubLines (ContentInstance, PropInfo, MainRow, SubGrid,
						new String [] { "Weite", "Höhe" }, HelpField);
					}
				if (PropInfo.PropertyType == typeof (Point))
					{
					TextBox [] ContentBoxes = CreateTwoSubLines (ContentInstance, PropInfo, MainRow, SubGrid,
						new String [] { "Links", "Oben" }, HelpField);
					}
				if (PropInfo.PropertyType == typeof (String))
					{
					TextBox ContentBox = CreateSimpleLine (ContentInstance, PropInfo, MainRow, SubGrid, HelpField);
					}
				if (PropInfo.PropertyType == typeof (bool))
					{
					RadioButton [] Buttons = CreateBoolLine (ContentInstance, PropInfo, MainRow, SubGrid,
						new String [] { "Ja", "Nein" }, HelpField);
					}
				}

			}
예제 #23
0
		private TextBox CreateSimpleLine (CVM.TableLayoutDefinition ContentInstance,
									PropertyInfo PropInfo,
									RowDefinition MainRow, Grid SubGrid, FieldInfo HelpField)
			{
			GridLengthConverter GLConverter = new GridLengthConverter ();
			MainRow.Height = (GridLength)GLConverter.ConvertFromString ("*");
			MainRow.MinHeight = 20;
			TextBox SimpleContent = new TextBox ();
			SubGrid.Children.Add (SimpleContent);
			Grid.SetColumn (SimpleContent, 1);
			Grid.SetRow (SimpleContent, 0);
			if (HelpField != null)
				{
				SimpleContent.ToolTip = (String)HelpField.GetValue (null);
				}
			Binding SimpleBinding = new Binding(PropInfo.Name);
			SimpleBinding.Source = ContentInstance;
			SimpleContent.SetBinding (TextBox.TextProperty, SimpleBinding);
			SimpleContent.Tag = PropInfo;
			return SimpleContent;
			}
예제 #24
0
		void FillTheIndexerForRandomOrder (CVM.WPMediaStandbildPlayingData StandBildPlayingData)
			{
			StandBildPlayingData.SortedNamesOfActiveDescriptions.Clear ();
			StandBildPlayingData.SetFileIndizessesToPlay (CVM.CommonValues.CreateRealRandomizedIndexArray
				(StandBildPlayingData.NamesOfActiveDescriptions.Count));
			StandBildPlayingData.IndexToFileIndexToPlay = 0;
			while (StandBildPlayingData.IsFileIndexToPlayCorrect ())
				{
				StandBildPlayingData.SortedNamesOfActiveDescriptions.Add (StandBildPlayingData.NameOfActiveDescription ());
				StandBildPlayingData.IndexToFileIndexToPlay++;
				}
			StandBildPlayingData.IndexToFileIndexToPlay = 0;
			}
예제 #25
0
		private TextBox [] CreateTwoSubLines (CVM.TableLayoutDefinition ContentInstance,
									PropertyInfo PropInfo,
									RowDefinition MainRow, Grid SubGrid, String [] Labels, FieldInfo HelpField)
			{
			GridLengthConverter GLConverter = new GridLengthConverter ();
			MainRow.Height = (GridLength)GLConverter.ConvertFromString ("3*");
			MainRow.MinHeight = 60;
			SubGrid.RowDefinitions.Add (new RowDefinition ());
			SubGrid.RowDefinitions [1].Height = (GridLength)GLConverter.ConvertFromString ("2*");

			Grid SubSubGrid = new Grid ();
			SubGrid.Children.Add (SubSubGrid);
			Grid.SetColumn (SubSubGrid, 0);
			Grid.SetRow (SubSubGrid, 1);
			Grid.SetColumnSpan (SubSubGrid, 2);
			SubSubGrid.ColumnDefinitions.Add (new ColumnDefinition ());
			SubSubGrid.ColumnDefinitions [0].Width = (GridLength)GLConverter.ConvertFromString ("*");
			SubSubGrid.ColumnDefinitions.Add (new ColumnDefinition ());
			SubSubGrid.ColumnDefinitions [1].Width = (GridLength)GLConverter.ConvertFromString ("5*");
			SubSubGrid.ColumnDefinitions.Add (new ColumnDefinition ());
			SubSubGrid.ColumnDefinitions [2].Width = (GridLength)GLConverter.ConvertFromString ("8*");
			SubSubGrid.RowDefinitions.Add (new RowDefinition ());
			SubSubGrid.RowDefinitions [0].Height = (GridLength)GLConverter.ConvertFromString ("*");
			SubSubGrid.RowDefinitions.Add (new RowDefinition ());
			SubSubGrid.RowDefinitions [1].Height = (GridLength)GLConverter.ConvertFromString ("*");

			Label WidthLabel = new Label ();
			WidthLabel.Content = Labels [0];
			SubSubGrid.Children.Add (WidthLabel);
			Grid.SetColumn (WidthLabel, 1);
			Grid.SetRow (WidthLabel, 0);
			TextBox Value1 = new TextBox ();
			SubSubGrid.Children.Add (Value1);
			Grid.SetColumn (Value1, 2);
			Grid.SetRow (Value1, 0);

			Label HeightLabel = new Label ();
			HeightLabel.Content = Labels [1];
			SubSubGrid.Children.Add (HeightLabel);
			Grid.SetColumn (HeightLabel, 1);
			Grid.SetRow (HeightLabel, 1);
			TextBox Value2 = new TextBox ();
			SubSubGrid.Children.Add (Value2);
			Grid.SetColumn (Value2, 2);
			Grid.SetRow (Value2, 1);
			if (HelpField != null)
				{
				Value1.ToolTip = (String)HelpField.GetValue (null);
				Value2.ToolTip = (String)HelpField.GetValue (null);
				}
			Object PropertyContent = PropInfo.GetValue (ContentInstance, BindingFlags.GetProperty, null, null, null);
			Value1.Tag = PropInfo;
			Value2.Tag = PropInfo;
			if (PropInfo.PropertyType == typeof (Size))
				{
				Size ContentSize = (Size) PropertyContent;
				Value1.Text = Convert.ToString (ContentSize.Width);
				Value1.Name = "Width";
				Value2.Text = Convert.ToString (ContentSize.Height);
				Value2.Name = "Height";
				}
			if (PropInfo.PropertyType == typeof (Point))
				{
				Point ContentPoint = (Point)PropertyContent;
				Value1.Text = Convert.ToString (ContentPoint.X);
				Value1.Name = "X";
				Value2.Text = Convert.ToString (ContentPoint.Y);
				Value2.Name = "Y";
				}
			Value1.LostFocus += new RoutedEventHandler (DoubleField_LostFocus);
			Value2.LostFocus += new RoutedEventHandler (DoubleField_LostFocus);
			return new TextBox [] { Value1, Value2 };
			}
예제 #26
0
		public bool SetListBox (Object Sender, String Bereich, DataSet SchemaDataSet,
			CVM.CommonValues.SelectionDefinition [] SelectionDefinitions)
			{
			m_Bereich = Bereich;
			m_SchemaDataSet = SchemaDataSet;
			m_SelectionDefinitions = SelectionDefinitions;
			ListBox ListBoxToProcess = (ListBox)Sender;
			CVM.CommonValues.ListBoxUserData UserData = (CVM.CommonValues.ListBoxUserData)ListBoxToProcess.Tag;
			if (ListBoxToProcess.SelectedIndex == -1)
				{
				return false;
				}
			m_ActiveID = ((ListBoxItem)ListBoxToProcess.Items
							[ListBoxToProcess.SelectedIndex]).Tag.ToString ();
			m_RefreshmentRoutine = UserData.m_RefreshFunctionName;
			m_PrimaryKeyName = UserData.m_PrimaryKeyName;
			//SimpleDataRowWindow DataRowWindow = new SimpleDataRowWindow ();
			m_ProcessingDataSet = DataBase.GetCommonDataSet (
				"Select * from " + UserData.m_TableName + " where " + m_PrimaryKeyName + " = '" + m_ActiveID + "'");
			SetData (m_ProcessingDataSet.Tables [0].Rows [0], "Bitte ändern Sie ggf. die Daten dieser "
						+ UserData.m_TableName, UserData.m_UpdateAble);
			return true;
			}
예제 #27
0
        static void Main(string[] args)
        {
            CGX_NET pGeo = null;
            CDB     hDB  = null;
            CVV     hVV  = null;
            CVM     hVM  = null;
            CVA     hVA  = null;

            Int32 iChan, iLine; // database symbols

            int          iVA, iL, iLines, iS;
            double       dValue;
            DoubleVector dData;


            // --- Usage ---
            if (args.Length < 3)
            {
                Console.WriteLine("Usage: chanadd database channel value");
                return;
            }

            try
            {
                // --- Initialize ---
                pGeo = new CGX_NET("CHANADD", "V1", 2047, null, 0);
                if (pGeo == null)
                {
                    Console.WriteLine("Unable to start Geosoft session");
                    return;
                }

                // ---
                // Open a database.
                // Note that all databases created by normal Geosoft users will have
                // user name "SUPER" with password "".  Third-party or custom applications
                // may create databases that require a user-name and password, in which
                // case you require these values to open the database.
                // ---
                hDB = CDB.Open(args[0], "SUPER", "");

                // --- Get the channel handle ---
                iChan = hDB.FindSymb(args[1], CoreConstant.DB_SYMB_CHAN);
                if (iChan == CoreConstant.NULLSYMB)
                {
                    Console.WriteLine(args[1] + " channel not found in database " + args[0]);
                    return;
                }

                // --- Lock channel for read-writer ---
                hDB.LockSymb(iChan, CoreConstant.DB_LOCK_READWRITE, CoreConstant.DB_WAIT_NONE);

                // --- do we need a VV or a VA? ---
                iVA = hDB.iGetColVA(iChan); // number of elements in a VA, 1 if its a VV
                if (iVA == 1)
                {
                    // --- Create a VV to hold data array ---
                    hVV = CVV.CreateExt(CoreConstant.GS_DOUBLE, 0);
                }
                else
                {
                    // --- its a VA channel ---
                    hVA = CVA.CreateExt(CoreConstant.GS_DOUBLE, 0, iVA);
                }

                // --- Get a real VM to hold the data in memory ---
                hVM = CVM.Create(CoreConstant.GS_REAL, 0);

                // -- Get Value to add to data ---
                dValue = Convert.ToDouble(args[2]);

                // --- Count selected lines ---
                iLines = hDB.iCountSelLines();

                // --- Go through all selected lines ---
                iL    = 0;
                iLine = hDB.FirstSelLine();

                do
                {
                    // --- Break if line is not a valid line ---
                    if (hDB.iIsLineValid(iLine) == 0)
                    {
                        break;
                    }

                    // --- Update progress ---
                    Console.WriteLine("Chanadd " + (iL + 1) + " of " + iLines + " Complete");

                    // --- Read Data ---
                    if (iVA == 1)
                    {
                        // --- get VV data ---
                        hDB.GetChanVV(iLine, iChan, hVV);
                    }
                    else
                    {
                        // --- get VA data ---
                        hDB.GetChanVA(iLine, iChan, hVA);

                        // ---
                        // Get the VV to the VA data.  This VV contains all VA data
                        // by element, then by row.  The VV is owned by the VA, so you
                        // cannot destroy the VA or the VV will become invalid.
                        // ---

                        hVV = hVA.GetFullVV();
                    }

                    // ---
                    // Get data VM from the VV.  This will re-size the VM to
                    // hold all the data in the VV.
                    // ---

                    CVV.CopyVVtoVM(hVM, hVV);

                    // --- now get a pointer to the data ---

                    iS = hVV.iLength();

                    dData = CGX_NET.GetDoubleVM(hVM, iS);

                    //-----------------------------------------------------------------------
                    //                             MAIN MATH CODE
                    //-----------------------------------------------------------------------

                    for (int i = 0; i < iS; i++)
                    {
                        dData[i] += dValue;
                    }

                    // --- Put the VM data back in the VV ---
                    hVV.CopyVMtoVV(hVM);

                    // --- Write data back to the database ---
                    if (iVA == 1)
                    {
                        hDB.PutChanVV(iLine, iChan, hVV);
                    }
                    else
                    {
                        // ---
                        // Since the VA owned the VV, changing the VV data is the same as
                        // changing toe VA data.  All I need to do is write the VA data.
                        // ---
                        hDB.PutChanVA(iLine, iChan, hVA);
                    }

                    // --- Advance to Next Line ---
                    iLine = hDB.NextSelLine(iLine);
                    iL++;
                }while (true);

                Console.WriteLine("ChanAdd Complete");


                // --- Cleanup ---

                hDB.UnLockSymb(iChan);

                // ---
                // Destroy any handles that were created.  This is not really necessary since
                // destroying a pGeo handle will destroy all classes.  However, we considere it
                // good practice to destroy your own instances since it ensures you are
                // thinking about what instances you have created.  You really do not want to
                // keep class instances longer than you need them since they consume system
                // resources that could be better used by other parts of your application.
                // ---

                if (hVM != null)
                {
                    hVM.Dispose();
                }

                // --- be careful not to try to destroy a VV owned by a VA ---

                if (hVV != null && (iVA != 1))
                {
                    hVV.Dispose();
                }

                if (hVA != null)
                {
                    hVA.Dispose();
                }

                hDB.Dispose();
            }
            catch (CERROR e)
            {
                Console.WriteLine("Error: " + e.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: " + ex.Message);
            }
            finally
            {
                if (pGeo != null)
                {
                    pGeo.Dispose();
                }
            }
        }
예제 #28
0
		List<Presentation_Info> CreatePlayList (CVM.CommonValues HostCVM)
			{

			String [] PresentationDirectories = HostCVM.ProcessableDirectories;
			List<Presentation_Info> PlayListData = new List<Presentation_Info> ();
			foreach (String PresentationDirectory in PresentationDirectories)
				{
				List<String> PowerPointFiles = WMB.Basics.GetFilesFromDirectory (PresentationDirectory, new String [] { "*.pps" }, -1);
				foreach (String PowerPointFile in PowerPointFiles)
					{
					PlayListData.Add (new Presentation_Info (PowerPointFile));
					}
				}
			return PlayListData;
			}
예제 #29
0
		public static void InsertForTable (String TableName, CVM.TableHandlerDefinition Definition)
			{
			WMB.WPMediaApplicationState.Instance.Properties ["HandlerFor_" + TableName] = Definition;
			}
예제 #30
0
		public void ShowNamesOfSortedActiveDescriptions (CVM.WPMediaStandbildPlayingData StandBildPlayingData, String PlaceWhereTheMessageComesFrom)
			{
			if (!Basics.IsTestRun)
				return;
			if (StandBildPlayingData.SortedNamesOfActiveDescriptions == null)
				{
				Basics.ReportInformationToEventViewer("WPMediaRandomController.ShowUsedFileNames." + PlaceWhereTheMessageComesFrom,
					"\"StandBildPlayingData.SortedNamesOfActiveDescriptions\" nicht gefüllt");
				return;
				}
			Basics.ReportInformationToEventViewer("WPMediaRandomController.ShowUsedFileNames." + PlaceWhereTheMessageComesFrom,
				String.Join("\r\n", StandBildPlayingData.SortedNamesOfActiveDescriptions));
			}
예제 #31
0
		public BitmapSource GetCreatedFrameBitmapSource (CVM.RedrawInformation RedrawData)
			{
			String PageID = RedrawData.PageID;
			int DuplicationID = RedrawData.PageIndex;
			Image TargetImage = RedrawData.TargetImage;

			DrawingVisual DrawingBoard = new DrawingVisual ();
			
			DrawingContext BoardContext = DrawingBoard.RenderOpen ();

			DataRow PageRow = m_FrameDataDataSet.Tables ["Pages"]
				.Select ("ID = '" + PageID + "'") [0];
			DataRow [] FrameContentRows = m_FrameDataDataSet.Tables ["FrameContent"]
				.Select ("PageID = '" + PageID + "'", "FrameOrder");
			foreach (DataRow FrameContentRow in FrameContentRows)
				{
				if (DuplicationID != -1)
					if ((Convert.ToInt32 (FrameContentRow ["MultiPageIndex"]) != -1)
						&& (Convert.ToInt32 (FrameContentRow ["MultiPageIndex"]) != DuplicationID))
						continue;


				DataRow [] FrameRows = m_FrameDataDataSet.Tables ["Frames"]
					.Select ("ID = '" + FrameContentRow ["FrameID"].ToString () + "'");
				if (FrameRows.Length != 1)
					{
					Basics.ReportErrorToEventViewer ("GraphicsHandling.GetCreatedFrameBitmapSource",
						"Fehler in der Frame und FrameContent Kombination:\r\n"
									 + "FrameContentID = \"" + FrameContentRow ["ID"].ToString ()
									 + "\" NameID = \"" + FrameContentRow ["NameID"].ToString () + "\r\nFrameID = \""
									 + FrameContentRow ["FrameID"].ToString () + "\"");
					//MessageBox.Show ("Fehler in der Frame und FrameContent Kombination:\r\n"
					//                 + "FrameContentID = \"" + FrameContentRow ["ID"].ToString ()
					//                 + "\" NameID = \"" + FrameContentRow ["NameID"].ToString () + "\r\nFrameID = \""
					//                 + FrameContentRow ["FrameID"].ToString () + "\"");
					continue;
					}
				DataRow FrameRow = FrameRows [0];
				if (FrameRow ["Typ"].ToString () == "Video")
					{
					InsertVideoFrame (BoardContext, PageRow, FrameRow, FrameContentRow);
					}
				if (FrameRow ["Typ"].ToString () == "Programm")
					{
					InsertProgrammFrame (BoardContext, PageRow, FrameRow, FrameContentRow);
					}
				if (FrameRow ["Typ"].ToString () == "Bild")
					{
					InsertBildFrame (BoardContext, PageRow, FrameRow, FrameContentRow);
					}
				if (FrameRow ["Typ"].ToString () == "Logo")
					{
					InsertBildFrame (BoardContext, PageRow, FrameRow, FrameContentRow);
					}
				if (FrameRow ["Typ"].ToString () == "Text")
					{
					InsertTextFrame (BoardContext, PageRow, FrameRow, FrameContentRow);
					}
				}
			BoardContext.Close ();			// by sac
			RenderTargetBitmap DrawingBitmap = new RenderTargetBitmap
				((int) TargetPictureWidth, (int) TargetPictureHeight, 96, 96,
												 PixelFormats.Pbgra32);
			DrawingBitmap.Render (DrawingBoard);
			//			PngBitmapEncoder PngImage = new PngBitmapEncoder ();
			return (BitmapSource) BitmapFrame.Create (DrawingBitmap);
			}
예제 #32
0
		/*
		Style GridStyleEntry = StyleDictionary ["BannerInfoGridStyle"] as Style;
		Style GridStyleHotEntry = StyleDictionary ["BannerHotInfoGridStyle"] as Style;
		Style TextBlockStyleHotEntry = StyleDictionary ["BannerHotInfoTextBlockStyle"] as Style;
		Style TextBlockStyleEntry = StyleDictionary ["BannerInfoTextBlockStyle"] as Style;
		*/


		public bool PrimaryStartup(CVM.CommonValues CVM, ResourceDictionary StyleDictionaryParameter)
			{
			m_CVM = CVM;
			StyleDictionary = StyleDictionaryParameter;
			DefaultFadeInDuration = TimeSpan.FromSeconds(1.5);
			DefaultDisplayDuration = TimeSpan.FromSeconds(6);
			DefaultFadeOutDuration = TimeSpan.FromSeconds(1.5);

			BannerFileName = System.IO.Path.Combine(System.IO.Path.Combine(m_CVM.GetLocalWPMediaRoot()
				+ "\\" + CommonValues.XML_SENDER_AUTO_CONTENT_DIRECTORY,
					CommonValues.BANNER_DIRECTORY), CommonValues.BANNER_FILE_NAME);
			BannerEntries.Clear();

			BannerEntries.Add (new BannerEntryDefinition("Entries", StyleDictionary["BannerInfoGridStyle"] as Style,
				StyleDictionary["BannerInfoTextBlockStyle"] as Style));
			BannerEntries.Add (new BannerEntryDefinition("HotEntries", StyleDictionary["BannerHotInfoGridStyle"] as Style,
				StyleDictionary["BannerHotInfoTextBlockStyle"] as Style));

			return true;
			}
예제 #33
0
		public void SetParameter (CVM.CommonValues CVM, String [] Arguments,
						NavigationWindowType NavigationType, String LinkData,
						double SecondsToBeAlive, String PrintQueueName)
			{
			m_CVM = CVM;
			m_XAMLHandling = new CVM.XAMLHandling (m_CVM);
			m_Arguments = Arguments;
			m_NavigationType = NavigationType;
			StartupHTMLString = LinkData;
			m_SecondsToBeAlive = SecondsToBeAlive;
			m_PrintQueueName = PrintQueueName;
			}
예제 #34
0
		public void SetParameter (CVM.CommonValues CVM, String [] Arguments)
			{
			m_CVM = CVM;
			m_Arguments = Arguments;
			SetWindowsContent ();
			}