예제 #1
0
 /// <remarks/>
 public void mockUrlLinkBundleItemAsync(UrlLinkBundleItem item, object userState) {
     if ((this.mockUrlLinkBundleItemOperationCompleted == null)) {
         this.mockUrlLinkBundleItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnmockUrlLinkBundleItemOperationCompleted);
     }
     this.InvokeAsync("mockUrlLinkBundleItem", new object[] {
                 item}, this.mockUrlLinkBundleItemOperationCompleted, userState);
 }
예제 #2
0
 public void mockUrlLinkBundleItem(UrlLinkBundleItem item) {
     this.Invoke("mockUrlLinkBundleItem", new object[] {
                 item});
 }
예제 #3
0
 /// <remarks/>
 public void mockUrlLinkBundleItemAsync(UrlLinkBundleItem item) {
     this.mockUrlLinkBundleItemAsync(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();
		}