• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IDataItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IDataItem的典型用法代码示例。如果您正苦于以下问题:C# IDataItem类的具体用法?C# IDataItem怎么用?C# IDataItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IDataItem类属于命名空间,在下文中一共展示了IDataItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FillInternal

		void FillInternal (DataRow row,IDataItem item)
		{
			if (item != null)
			{
				BaseImageItem bi = item as BaseImageItem;
				if (bi != null) {
					using (System.IO.MemoryStream memStream = new System.IO.MemoryStream()){
						Byte[] val = row[bi.ColumnName] as Byte[];
						if (val != null) {
							if ((val[78] == 66) && (val[79] == 77)){
								memStream.Write(val, 78, val.Length - 78);
							} else {
								memStream.Write(val, 0, val.Length);
							}
							System.Drawing.Image image = System.Drawing.Image.FromStream(memStream);
							bi.Image = image;
						}
					}
				}
				else
				{
					var dataItem = item as BaseDataItem;
					if (dataItem != null) {
						dataItem.DBValue = ExtractDBValue(row,dataItem).ToString();
					}
					return;
				}
			}
		}
开发者ID:OmerRaviv,项目名称:SharpDevelop,代码行数:29,代码来源:TableStrategy.cs


示例2: GetValue

        /// <inheritdoc />
        public object GetValue(IDataItem item)
        {
            if (item == null)
                throw new ArgumentNullException("item");

            return GetValueImpl(item);
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:BaseDataAccessor.cs


示例3: Transform

        public IDataItem Transform(IDataItem dataItem)
        {
            foreach (var transformation in transformations)
                dataItem = transformation.Transform(dataItem);

            return dataItem;
        }
开发者ID:kingkino,项目名称:azure-documentdb-datamigrationtool,代码行数:7,代码来源:TransformationPipeline.cs


示例4: Join

        /// <inheritdoc />
        public IEnumerable<IList<IDataItem>> Join(IList<IDataProvider> providers, IList<ICollection<DataBinding>> bindingsPerProvider,
            bool includeDynamicItems)
        {
            var enumerators = new IEnumerator<IDataItem>[providers.Count];
            for (int i = 0; i < providers.Count; i++)
                enumerators[i] = providers[i].GetItems(bindingsPerProvider[i], includeDynamicItems).GetEnumerator();

            int providerCount = providers.Count;
            for (;;)
            {
                var itemList = new IDataItem[providerCount];
                bool gotOne = false;

                for (int i = 0; i < providerCount; i++)
                {
                    if (enumerators[i].MoveNext())
                    {
                        itemList[i] = enumerators[i].Current;
                        gotOne = true;
                    }
                    else
                    {
                        itemList[i] = NullDataItem.Instance;
                    }
                }

                if (! gotOne)
                    break;

                yield return itemList;
            }
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:33,代码来源:SequentialJoinStrategy.cs


示例5: HandlesDegenerateCaseWithOneProvider

        public void HandlesDegenerateCaseWithOneProvider()
        {
            DataBinding[][] bindingsPerProvider = new DataBinding[][] {
                new DataBinding[] { new DataBinding(0, null) },
            };

            IDataProvider[] providers = new IDataProvider[] {
                Mocks.StrictMock<IDataProvider>()
            };

            IDataItem[][] itemsPerProvider = new IDataItem[][] {
                new IDataItem[] {
                    new ScalarDataItem<int>(1, null, true),
                    new ScalarDataItem<int>(2, null, false)
                },
            };

            using (Mocks.Record())
            {
                SetupResult.For(providers[0].GetItems(bindingsPerProvider[0], true)).Return(itemsPerProvider[0]);
            }

            using (Mocks.Playback())
            {
                List<IList<IDataItem>> items = new List<IList<IDataItem>>(PairwiseJoinStrategy.Instance.Join(providers, bindingsPerProvider, true));
                Assert.Count(2, items);

                Assert.AreSame(itemsPerProvider[0][0], items[0][0]);
                Assert.AreSame(itemsPerProvider[0][1], items[1][0]);
            }
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:31,代码来源:PairwiseJoinStrategyTest.cs


示例6: RemappedFieldsDataItem

 public RemappedFieldsDataItem(IDataItem dataItem, IReadOnlyMap<string, string> fieldsMapping)
     : base(dataItem)
 {
     Guard.NotNull("fieldsMapping", fieldsMapping);
     this.fieldsMapping = fieldsMapping;
     inactiveMappings = GetNonExistingMappingFields(fieldsMapping);
 }
开发者ID:kingkino,项目名称:azure-documentdb-datamigrationtool,代码行数:7,代码来源:RemappedFieldsDataItem.cs


示例7: CancelNotificationForDataItem

		/// <summary>
		/// Deletes the check-in notification when the DataITem is deleted
		/// </summary>
		/// <param name="dataItem">Used only for logging in this sample, but could be used to identify which notifications to cancel
		/// (in this case there is at most 1 notification)</param>
		void CancelNotificationForDataItem(IDataItem dataItem)
		{
			if (Log.IsLoggable (Constants.TAG, LogPriority.Verbose)) {
				Log.Verbose(Constants.TAG, "OnDataItemDeleted: DataItem = " + dataItem.Uri);
			}
			GetSystemService(NotificationService).JavaCast<NotificationManager>().Cancel(Constants.NOTIFICATION_ID);
		}
开发者ID:WalterVale,项目名称:monodroid-samples,代码行数:12,代码来源:HomeListenerService.cs


示例8: JoinsItemsCombinatorially

        public void JoinsItemsCombinatorially()
        {
            DataBinding[][] bindingsPerProvider = new DataBinding[][] {
                new DataBinding[] { new DataBinding(0, null) },
                new DataBinding[] { },
                new DataBinding[] { new DataBinding(0, null) },
            };

            IDataProvider[] providers = new IDataProvider[] {
                Mocks.StrictMock<IDataProvider>(),
                Mocks.StrictMock<IDataProvider>(),
                Mocks.StrictMock<IDataProvider>()
            };

            IDataItem[][] itemsPerProvider = new IDataItem[][] {
                new IDataItem[] {
                    new ScalarDataItem<int>(1, null, false),
                    new ScalarDataItem<int>(2, null, true)
                },
                new IDataItem[] {
                    new ScalarDataItem<int>(1, null, false),
                    new ScalarDataItem<int>(2, null, false),
                    new ScalarDataItem<int>(3, null, false)
                },
                new IDataItem[] {
                    new ScalarDataItem<int>(1, null, false),
                    new ScalarDataItem<int>(2, null, true)
                }
            };

            using (Mocks.Record())
            {
                Expect.Call(providers[0].GetItems(bindingsPerProvider[0], true)).Return(itemsPerProvider[0]);
                Expect.Call(providers[1].GetItems(bindingsPerProvider[1], true)).Return(itemsPerProvider[1]);
                Expect.Call(providers[2].GetItems(bindingsPerProvider[2], true)).Return(itemsPerProvider[2]);
            }

            using (Mocks.Playback())
            {
                List<IList<IDataItem>> items = new List<IList<IDataItem>>(CombinatorialJoinStrategy.Instance.Join(providers, bindingsPerProvider, true));
                Assert.Count(12, items);

                int index = 0;
                for (int i = 0; i < itemsPerProvider[0].Length; i++)
                {
                    for (int j = 0; j < itemsPerProvider[1].Length; j++)
                    {
                        for (int k = 0; k < itemsPerProvider[2].Length; k++)
                        {
                            Assert.AreSame(itemsPerProvider[0][i], items[index][0]);
                            Assert.AreSame(itemsPerProvider[1][j], items[index][1]);
                            Assert.AreSame(itemsPerProvider[2][k], items[index][2]);

                            index += 1;
                        }
                    }
                }
            }
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:59,代码来源:CombinatorialJoinStrategyTest.cs


示例9: CreateDetailsViewModel

        /// <inheritdoc />
        public override ContentDetailsViewModel CreateDetailsViewModel(IDataItem item)
        {
            var viewModel = base.CreateDetailsViewModel(item);

            viewModel.ProviderName = this.GetManagerInstance().Provider.Name;

            return viewModel;
        }
开发者ID:rhullah,项目名称:feather-widgets,代码行数:9,代码来源:DynamicContentModel.cs


示例10: Fill

		public override void Fill(IDataItem item)
		{
			DataRow row = this.Current as DataRow;
			if (row != null)
			{
				this.FillInternal (row,item);
			}
		}
开发者ID:OmerRaviv,项目名称:SharpDevelop,代码行数:8,代码来源:TableStrategy.cs


示例11: WriteAsync

        public Task WriteAsync(IDataItem dataItem, CancellationToken cancellation)
        {
            if (writeCallback != null)
                writeCallback(dataItem);

            receivedData.Add(dataItem);
            return TaskHelper.NoOp;
        }
开发者ID:kingkino,项目名称:azure-documentdb-datamigrationtool,代码行数:8,代码来源:DataSinkAdapterMock.cs


示例12: Open

		public static double Open(IDataItem data)
		{
			System.Diagnostics.Debug.Assert(data != null);
			if (data == null)
				throw new ArgumentNullException();

			return data.Open;
		}
开发者ID:bpe78,项目名称:OldStuff,代码行数:8,代码来源:PriceUtilities.cs


示例13: ComparableDataItem

        public ComparableDataItem(IDataItem dataItem)
        {
            if (dataItem == null)
                throw new ArgumentNullException("dataItem");

            this.dataItem = dataItem;
            hash = GetDataItemHash(dataItem);
        }
开发者ID:kingkino,项目名称:azure-documentdb-datamigrationtool,代码行数:8,代码来源:ComparableDataItem.cs


示例14: MedianPrice

		public static double MedianPrice(IDataItem data)
		{
			System.Diagnostics.Debug.Assert(data != null);
			if (data == null)
				throw new ArgumentNullException();

			System.Diagnostics.Debug.Assert(((data.High + data.Low) / 2) == (((double)data.High + data.Low) / 2.0));
			return (data.High + data.Low) / 2;
		}
开发者ID:bpe78,项目名称:OldStuff,代码行数:9,代码来源:PriceUtilities.cs


示例15: WeightedPrice

		public static double WeightedPrice(IDataItem data)
		{
			System.Diagnostics.Debug.Assert(data != null);
			if (data == null)
				throw new ArgumentNullException();

			System.Diagnostics.Debug.Assert(((data.High + data.Low + data.Close + data.Close) / 4) == (((double)data.High + data.Low + data.Close + data.Close) / 4.0));
			return (data.High + data.Low + data.Close + data.Close) / 4;
		}
开发者ID:bpe78,项目名称:OldStuff,代码行数:9,代码来源:PriceUtilities.cs


示例16: VerifyDataItem

        protected static void VerifyDataItem(IReadOnlyDictionary<string, object> expected, IDataItem actual)
        {
            var actualColumns = actual.GetFieldNames().ToList();

            foreach (var key in expected.Keys)
            {
                Assert.IsTrue(actualColumns.Contains(key), TestResources.PropertyMissingFormat, key);
                Assert.AreEqual(expected[key], actual.GetValue(key), TestResources.InvalidPropertyValueFormat, key);
            }
        }
开发者ID:phil000,项目名称:azure-documentdb-datamigrationtool,代码行数:10,代码来源:SqlTestsBase.cs


示例17: GetItemDefaultUrl

        /// <summary>
        /// Returns the item content item defautl Url usign the location service
        /// </summary>
        /// <param name="helper">The Html helper</param>
        /// <param name="item">The IDataItem for which the defautl Url will be searched</param>
        /// /// <param name="alternativeUrl">Alternative Url of the dataItem. It will be used if the default Url is not resolved</param>
        /// <returns>The default Url of the item</returns>
        public static string GetItemDefaultUrl(this HtmlHelper helper, IDataItem item, string alternativeUrl = null)
        {
            // first we need to get an instance of the location service
            var contentService = SystemManager.GetContentLocationService();

            // use the location service to get the item location
            var defaultLocation = contentService.GetItemDefaultLocation(item);

            return UrlHtmlHelperExtensions.GetItemDefaultUrl(helper, defaultLocation, alternativeUrl);
        }
开发者ID:jonathanread,项目名称:feather-samples,代码行数:17,代码来源:UrlHtmlHelperExtensions.cs


示例18: Item

 public Item(IDataItem orig) {
   foreach (var attr in orig.Attributes)
   {
     _attrs[attr.Name] = attr.Value;
   }
   foreach (var prop in orig.Properties)
   {
     _props[prop.Name] = new Property(prop);
   }
 }
开发者ID:rneuber1,项目名称:InnovatorAdmin,代码行数:10,代码来源:Item.cs


示例19: CommentsCount

        public static MvcHtmlString CommentsCount(this HtmlHelper helper, string navigateUrl, IDataItem item)
        {
            if (item == null)
                return MvcHtmlString.Empty;

            var contentItem = item as Content;
            bool? allowComments = contentItem != null ? contentItem.AllowComments : null;
            var threadKey = ControlUtilities.GetLocalizedKey(item.Id, null, CommentsBehaviorUtilities.GetLocalizedKeySuffix(item.GetType().FullName));
            var itemTypeFullName = item.GetType().FullName;

            return CommentsHelpers.CommentsCount(helper, navigateUrl, threadKey, itemTypeFullName, allowComments);
        }
开发者ID:RifasRazick,项目名称:feather,代码行数:12,代码来源:CommentsHelpers.cs


示例20: JoinsItemsSequentiallyAndPadsWithNullsUntilExhausted

        public void JoinsItemsSequentiallyAndPadsWithNullsUntilExhausted()
        {
            DataBinding[][] bindingsPerProvider = new DataBinding[][] {
                new DataBinding[] { new DataBinding(0, null) },
                new DataBinding[] { },
                new DataBinding[] { new DataBinding(0, null) },
            };

            IDataProvider[] providers = new IDataProvider[] {
                Mocks.StrictMock<IDataProvider>(),
                Mocks.StrictMock<IDataProvider>(),
                Mocks.StrictMock<IDataProvider>()
            };

            IDataItem[][] itemsPerProvider = new IDataItem[][] {
                new IDataItem[] {
                    new ScalarDataItem<int>(1, null, true),
                    new ScalarDataItem<int>(2, null, false)
                },
                new IDataItem[] { },
                new IDataItem[] {
                    new ScalarDataItem<int>(1, null, false),
                    new ScalarDataItem<int>(2, null, false),
                    new ScalarDataItem<int>(3, null, false)
                }
            };

            using (Mocks.Record())
            {
                Expect.Call(providers[0].GetItems(bindingsPerProvider[0], true)).Return(itemsPerProvider[0]);
                Expect.Call(providers[1].GetItems(bindingsPerProvider[1], true)).Return(itemsPerProvider[1]);
                Expect.Call(providers[2].GetItems(bindingsPerProvider[2], true)).Return(itemsPerProvider[2]);
            }

            using (Mocks.Playback())
            {
                List<IList<IDataItem>> items = new List<IList<IDataItem>>(SequentialJoinStrategy.Instance.Join(providers, bindingsPerProvider, true));
                Assert.Count(3, items);

                Assert.AreSame(itemsPerProvider[0][0], items[0][0]);
                Assert.AreSame(NullDataItem.Instance, items[0][1]);
                Assert.AreSame(itemsPerProvider[2][0], items[0][2]);

                Assert.AreSame(itemsPerProvider[0][1], items[1][0]);
                Assert.AreSame(NullDataItem.Instance, items[1][1]);
                Assert.AreSame(itemsPerProvider[2][1], items[1][2]);

                Assert.AreSame(NullDataItem.Instance, items[2][0]);
                Assert.AreSame(NullDataItem.Instance, items[2][1]);
                Assert.AreSame(itemsPerProvider[2][2], items[2][2]);
            }
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:52,代码来源:SequentialJoinStrategyTest.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IDataManager类代码示例发布时间:2022-05-24
下一篇:
C# IDataDescriptor类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap