本文整理汇总了C#中DataObject.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# DataObject.Equals方法的具体用法?C# DataObject.Equals怎么用?C# DataObject.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataObject
的用法示例。
在下文中一共展示了DataObject.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComplexObjectWithArrays_1
public void ComplexObjectWithArrays_1()
{
using(var ms = new MemoryStream())
{
var s = new PODSlimSerializer();
var data = new DataObject();
data.Populate();
s.Serialize(ms, data);
ms.Seek(0, SeekOrigin.Begin);
var result = s.Deserialize(ms);
Assert.IsTrue( data.Equals( result));
}
}
示例2: PositionOfRangePoint
private int PositionOfRangePoint(RangeFieldOffset position, DataObject val)
{
int p;
DataObject cell;
switch (position) {
case RangeFieldOffset.FirstValue:
if (val.Equals(IndexRange.FirstInSet)) {
return 0;
}
if (val.Equals(IndexRange.LastInSet)) {
// Get the last value and search for the first instance of it.
cell = Last;
} else {
cell = val;
}
p = SearchFirst(cell);
// (If value not found)
if (p < 0)
return -(p + 1);
return p;
case RangeFieldOffset.LastValue:
if (val.Equals(IndexRange.LastInSet))
return Count - 1;
if (val.Equals(IndexRange.FirstInSet)) {
// Get the first value.
cell = First;
} else {
cell = val;
}
p = SearchLast(cell);
// (If value not found)
if (p < 0) {
return -(p + 1) - 1;
}
return p;
case RangeFieldOffset.BeforeFirstValue:
if (val.Equals(IndexRange.FirstInSet))
return -1;
if (val.Equals(IndexRange.LastInSet)) {
// Get the last value and search for the first instance of it.
cell = Last;
} else {
cell = val;
}
p = SearchFirst(cell);
// (If value not found)
if (p < 0) {
return -(p + 1) - 1;
}
return p - 1;
case RangeFieldOffset.AfterLastValue:
if (val.Equals(IndexRange.LastInSet)) {
return Count;
}
if (val.Equals(IndexRange.FirstInSet)) {
// Get the first value.
cell = First;
} else {
cell = val;
}
p = SearchLast(cell);
// (If value not found)
if (p < 0) {
return -(p + 1);
}
return p + 1;
default:
throw new InvalidOperationException("Unrecognised position.");
}
}
示例3: ResolveCell
/// <summary>
/// Resolves a cell.
/// </summary>
/// <param name="ob"></param>
/// <returns></returns>
private DataObject ResolveCell(DataObject ob)
{
if (ob.Equals(IndexRange.FirstInSet)) {
ResolveSortedSet();
return scheme.GetValue(sortedSet.First());
}
if (ob.Equals(IndexRange.LastInSet)) {
ResolveSortedSet();
return scheme.GetValue(sortedSet.Last());
}
return ob;
}