Ejemplo n.º 1
0
 /// <remarks/>
 public void mockLibraryLinkBundleItemAsync(LibraryLinkBundleItem item, object userState) {
     if ((this.mockLibraryLinkBundleItemOperationCompleted == null)) {
         this.mockLibraryLinkBundleItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnmockLibraryLinkBundleItemOperationCompleted);
     }
     this.InvokeAsync("mockLibraryLinkBundleItem", new object[] {
                 item}, this.mockLibraryLinkBundleItemOperationCompleted, userState);
 }
Ejemplo n.º 2
0
 public void mockLibraryLinkBundleItem(LibraryLinkBundleItem item) {
     this.Invoke("mockLibraryLinkBundleItem", new object[] {
                 item});
 }
Ejemplo n.º 3
0
 /// <remarks/>
 public void mockLibraryLinkBundleItemAsync(LibraryLinkBundleItem item) {
     this.mockLibraryLinkBundleItemAsync(item, null);
 }
		private static void ImportData(
			this LinkBundleLinkSettings target,
			SalesLibraries.Business.Entities.Wallbin.NonPersistent.LinkSettings.LinkBundleLinkSettings source)
		{
			var imageConverter = TypeDescriptor.GetConverter(typeof(Bitmap));

			((IBaseLinkSettings)target).ImportData(source);
			target.customWebFormat = source.CustomWebFormat;
			target.bundleItems = source.Bundle.Settings.Items
				.Where(sourceBundleItem => sourceBundleItem.Visible)
				.Select(sourceBundleItem =>
				{
					IBaseLinkBundleItem linkItem;
					switch (sourceBundleItem.ItemType)
					{
						case LinkBundleItemType.LibraryLink:
							linkItem = new LibraryLinkBundleItem();
							((LibraryLinkBundleItem)linkItem).libraryLinkId = ((LibraryLinkItem)sourceBundleItem).LinkId.ToString();
							break;
						case LinkBundleItemType.Url:
							linkItem = new UrlLinkBundleItem();
							((UrlLinkBundleItem)linkItem).url = ((UrlItem)sourceBundleItem).Url;
							break;
						case LinkBundleItemType.Info:
							linkItem = new LinkBundleInfoItem();
							((LinkBundleInfoItem)linkItem).header = ((InfoItem)sourceBundleItem).Header;
							((LinkBundleInfoItem)linkItem).body = ((InfoItem)sourceBundleItem).Body;
							break;
						case LinkBundleItemType.Strategy:
							linkItem = new LinkBundleStrategyItem();
							((LinkBundleStrategyItem)linkItem).header = ((StrategyItem)sourceBundleItem).Header;
							((LinkBundleStrategyItem)linkItem).body = ((StrategyItem)sourceBundleItem).Body;
							break;
						case LinkBundleItemType.Revenue:
							linkItem = new LinkBundleRevenueItem();
							((LinkBundleRevenueItem)linkItem).revenueType = (Int32)((RevenueItem)sourceBundleItem).RevenueType;
							((LinkBundleRevenueItem)linkItem).infoItems = ((RevenueItem)sourceBundleItem).InfoItems
								.Select(sourceInfoItem =>
								{
									var infoItem = new LinkBundleRevenueInfoItem();
									infoItem.infoType = sourceInfoItem.Title;
									infoItem.value = (float)sourceInfoItem.Value;
									return infoItem;
								})
								.ToArray();
							((LinkBundleRevenueItem)linkItem).additionalInfo = ((RevenueItem)sourceBundleItem).AdditionalInfo;
							break;
						default:
							throw new ArgumentOutOfRangeException();
					}
					linkItem.id = sourceBundleItem.Id.ToString();
					linkItem.itemType = (Int32)sourceBundleItem.ItemType;
					linkItem.collectionOrder = sourceBundleItem.CollectionOrder;
					linkItem.title = sourceBundleItem.Title;
					linkItem.image = Convert.ToBase64String((byte[])imageConverter.ConvertTo(sourceBundleItem.Image, typeof(byte[])));
					linkItem.hoverTip = sourceBundleItem.HoverTip;
					return linkItem;
				})
				.ToArray();
		}