Пример #1
0
 public static void ImportData(
     this Common.Core.Objects.Output.TextGroup target,
     Legacy.Common.Entities.Common.TextGroup source)
 {
     foreach (var oldItem in source.Items)
     {
         if (oldItem is Legacy.Common.Entities.Common.TextGroup)
         {
             var oldTextGroup = (Legacy.Common.Entities.Common.TextGroup)oldItem;
             var textGroup    = new Common.Core.Objects.Output.TextGroup(
                 oldTextGroup.Separator,
                 oldTextGroup.BorderLeft,
                 oldTextGroup.BorderRight);
             textGroup.ImportData(oldTextGroup);
             target.Items.Add(textGroup);
         }
         else if (oldItem is Legacy.Common.Entities.Common.TextItem)
         {
             var oldTextItem = (Legacy.Common.Entities.Common.TextItem)oldItem;
             var textItem    = new Common.Core.Objects.Output.TextItem(oldTextItem.Text, oldTextItem.IsBold);
             target.Items.Add(textItem);
         }
     }
 }
Пример #2
0
		public static void ImportData(
			this Common.Core.Objects.Output.TextGroup target,
			Legacy.Common.Entities.Common.TextGroup source)
		{
			foreach (var oldItem in source.Items)
			{
				if (oldItem is Legacy.Common.Entities.Common.TextGroup)
				{
					var oldTextGroup = (Legacy.Common.Entities.Common.TextGroup)oldItem;
					var textGroup = new Common.Core.Objects.Output.TextGroup(
						oldTextGroup.Separator,
						oldTextGroup.BorderLeft,
						oldTextGroup.BorderRight);
					textGroup.ImportData(oldTextGroup);
					target.Items.Add(textGroup);
				}
				else if (oldItem is Legacy.Common.Entities.Common.TextItem)
				{
					var oldTextItem = (Legacy.Common.Entities.Common.TextItem)oldItem;
					var textItem = new Common.Core.Objects.Output.TextItem(oldTextItem.Text, oldTextItem.IsBold);
					target.Items.Add(textItem);
				}
			}
		}