当前位置: 首页>>代码示例>>C#>>正文


C# FileInfo.LoadAs_Object_From_SerializedBinary方法代码示例

本文整理汇总了C#中System.IO.FileInfo.LoadAs_Object_From_SerializedBinary方法的典型用法代码示例。如果您正苦于以下问题:C# FileInfo.LoadAs_Object_From_SerializedBinary方法的具体用法?C# FileInfo.LoadAs_Object_From_SerializedBinary怎么用?C# FileInfo.LoadAs_Object_From_SerializedBinary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.FileInfo的用法示例。


在下文中一共展示了FileInfo.LoadAs_Object_From_SerializedBinary方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MainWindow

		public MainWindow()
			{
			if (Environment.GetCommandLineArgs().Length < 1)
				Environment.Exit(0);
			FileInfo dBFileInfo = new FileInfo(Environment.GetCommandLineArgs()[0]);
			if (!dBFileInfo.Exists)
				App.Current.Shutdown();


			RingPlayerDb ringerl = dBFileInfo.LoadAs_Object_From_SerializedBinary<RingPlayerDb>();
			if (ringerl == null)
				{
				MessageBox.Show($"Der File\r\n{Environment.GetCommandLineArgs()[0]}\r\nkann nicht als DataSet desrialisiert werden");
				Environment.Exit(0);
				}









			PlayerDataSetViewerModellInstance = new PlayerDataSetViewerModell(ringerl);
			InitializeComponent();
			}
开发者ID:heinzsack,项目名称:DEV,代码行数:27,代码来源:MainWindow.xaml.cs

示例2: LoadAndDeSerialize

		public DataSet LoadAndDeSerialize()
			{
			FileInfo SerializedParameter = new FileInfo($"\\\\{ComputerName}\\WPMediaSender\\RuntimeParameter.ser");
			if (!SerializedParameter.Exists)
				return null;
			return SerializedParameter.LoadAs_Object_From_SerializedBinary<DataSet>();
			}
开发者ID:heinzsack,项目名称:DEV,代码行数:7,代码来源:RuntimeSettings.cs

示例3: LoadAndDeSerialize

		private static MultiMedia LoadAndDeSerialize()
			{
			lock (lockObject)
				{
				FileInfo SerializedParameter = new FileInfo($"\\\\{ComputerName}\\WPMediaSender\\RuntimeParameter.ser");
				MultiMedia multiMediaDb = new MultiMedia();
				foreach (DataTable dataTable in SerializedParameter.LoadAs_Object_From_SerializedBinary<DataSet>().Tables)
					{
					CsDbTable mmTable = multiMediaDb.GetTableByName(dataTable.TableName);
					mmTable.Merge(dataTable);
					}
				multiMediaDb.SetHasBeenLoaded();
				return multiMediaDb;
				}
			}
开发者ID:heinzsack,项目名称:DEV,代码行数:15,代码来源:CommonServices.cs

示例4: foreach

		private Dictionary<MMSlot, StatisticalBalancer<MMUnit>> LoadActuallBalancers
			(MMSender mmSender, DateTime dateTimeToCheck)
			{
			Dictionary<MMSlot, StatisticalBalancer<MMUnit>> entriesActuallInBalancer
				= new Dictionary<MMSlot, StatisticalBalancer<MMUnit>>();
			List<MMSlot> balancedMMSlotsToCheck = new List<MMSlot>();
			foreach (MMProgrammBlock programmBlock in mmSender.Get_OrderedProgrammBloecke)
				{
				foreach (MMProgrammBlockToMMSlot mmProgrammBlockToMMSlot in programmBlock.Get_MMSlotsZuMMProgrammBlockOrdered
					.Where(whe => whe.MMProgrammBlockToMMSlotsPlayingTyp.Id == Guid.Parse("F173BC3B-F8B4-407D-90B5-1B717219C444")))
					if (!balancedMMSlotsToCheck.Contains(mmProgrammBlockToMMSlot.MMSlot))
						balancedMMSlotsToCheck.Add(mmProgrammBlockToMMSlot.MMSlot);
				}
			foreach (MMSlot mmSlot in balancedMMSlotsToCheck)
				{
				if (!entriesActuallInBalancer.Keys.Contains(mmSlot))
					{
					if (dateTimeToCheck.Date == DateTime.Now.Date)
						{
						FileInfo playerFileInfo = new FileInfo(VisualBasics.GetSenderPlaylistName(mmSender.NameId));
						RingPlayerDb playerDb = playerFileInfo.LoadAs_Object_From_SerializedBinary<RingPlayerDb>();
						playerDb.SetHasBeenLoaded();
						RingUpdater ringUpdater = new RingUpdater(playerDb, mmSlot.DataSet);
						ringUpdater.Load();
						if (ringUpdater.BalancerPerBalancerId.ContainsKey(mmSlot.Id))
							entriesActuallInBalancer[mmSlot]
								= ringUpdater.BalancerPerBalancerId[mmSlot.Id];
						else
							entriesActuallInBalancer[mmSlot]
								= new StatisticalBalancer<MMUnit>();
						}
					else
						{
						entriesActuallInBalancer[mmSlot]
							= new StatisticalBalancer<MMUnit>();
						}
					}
				//TODO Actualice the balancer content
				//Debug.WriteLine($"Vor dem Ergänzen der Balancer - {dateTimeToCheck} für den Sender {mmSender.NameId}");
				//Debug.WriteLine($"\tSlot = {mmSlot.NameId}");
				//foreach (MMUnit mmUnit in TodayActiveMMUnitsPerMMSlot[mmSlot].Keys)
				//	{
				//	Debug.WriteLine($"\t\t{mmUnit.NameId} - {((IContainTimingAttributes)mmUnit.MMUnitTimings.FirstOrDefault()).FreiText}");
				//	}
				ActualizeBalancers(entriesActuallInBalancer[mmSlot],
					TodayActiveMMUnitsPerMMSlot[mmSlot].Keys.ToArray());
				//Debug.WriteLine($"Actuelle Entries in Balancer nach dem Aktualisieren");
				//foreach (MMUnit entriesKey in entriesActuallInBalancer[mmSlot].Entries.Keys)
				//	{
				//	Debug.WriteLine($"\t{entriesKey.NameId}");
				//	}
				}
			return entriesActuallInBalancer;
			}
开发者ID:heinzsack,项目名称:DEV,代码行数:54,代码来源:BalancerUsage.cs

示例5: SetActuallPlayerDb

		public void SetActuallPlayerDb(MMSender mmSender)
			{

			FileInfo actuallDBFileInfo = new FileInfo(VisualBasics.GetSenderPlaylistName(mmSender.NameId));
			if ((actuallDBFileInfo.Exists)
				&& (actuallDBFileInfo.Length > 2000))
				{
				String Message = String.Empty;
				try
					{
					RingPlayerDb CommonDataSet= actuallDBFileInfo.LoadAs_Object_From_SerializedBinary<RingPlayerDb>();
					ActualRing = CreateNewRingInstance();
					ActualRing.DataSet.Merge(CommonDataSet);
					ActualRing.DataSet.SetHasBeenLoaded();
					}
				catch (Exception Excp)
					{
					Message = Excp.ToString();
					
					ActualRing = CreateNewRingInstance();
					}
				}
			else
				{
				ActualRing = CreateNewRingInstance();
				ActualRing.DataSet.SaveAs_SerializedBinary(actuallDBFileInfo);
				}
			if (ActualRing != null)
				{
				ActualRing.SourceFileName = actuallDBFileInfo.FullName;
				ActualRing.SourceCreationDateTime = actuallDBFileInfo.LastWriteTime;
				_selectedPageGroupSchedule = ActualRing.ScheduledPageGroups;
				}
			else
				{
				_selectedPageGroupSchedule = null;
				}
			}
开发者ID:heinzsack,项目名称:DEV,代码行数:38,代码来源:ProgrammSchemaModell.cs


注:本文中的System.IO.FileInfo.LoadAs_Object_From_SerializedBinary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。