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


C# IDataItem类代码示例

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


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


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