本文整理汇总了C#中Field.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Field.Equals方法的具体用法?C# Field.Equals怎么用?C# Field.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field.Equals方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnumerateColumnValues
public void EnumerateColumnValues(string columnName, int rowOffset, object expected)
{
var table = AdminQuery.Access().GetTable(tableName);
Assert.IsNotNull(table);
var column = table.GetColumn(columnName);
Assert.IsNotNull(column);
Assert.IsNotNull(column.ColumnInfo);
Assert.IsNotNull(column.Table);
Assert.IsNotNull(column.Index);
Assert.AreEqual(columnName, column.Name);
var cellValue = column.ElementAt(rowOffset);
var fieldValue = new Field(column.Type, column.Type.CreateFrom(expected));
Assert.IsFalse(Field.IsNullField(cellValue));
Assert.IsTrue(fieldValue.Equals(cellValue));
}
示例2: IsVisibleEffect
bool IsVisibleEffect(IPTAnalysisNode n, Field f)
{
bool isVisibleEffect = true;
if (IsVisibleNode(n))
{
if (n.IsParameterNode)
{
PNode pn = (PNode)n;
if (pn.IsByValue && (f.Equals(PTGraph.asterisk) || pn.IsStruct))
isVisibleEffect = false;
}
}
else
isVisibleEffect = false;
return isVisibleEffect;
}
示例3: ApplyFieldName
/// <summary>
/// Used to give format to a field dereference (.f, [.], *)
/// </summary>
/// <param name="pathString"></param>
/// <param name="f"></param>
/// <returns></returns>
private static string ApplyFieldName(string pathString, Field f)
{
if (f.Equals(PTGraph.arrayField))
{
pathString += "[.]";
}
else
{
if (f.Equals(PTGraph.allFields))
{
pathString = pathString + "." + "*";
}
else if (f.Equals(PTGraph.allFieldsNotOwned))
{
pathString = pathString + "." + "$";
}
else
{
if (!f.Equals(PTGraph.asterisk))
{
pathString = pathString + "." + f.Name.Name;
}
else
{
pathString = "*(" + pathString + ")";
}
}
}
return pathString;
}
示例4: ResolveCell
/// <summary>
/// Resolves a cell.
/// </summary>
/// <param name="ob"></param>
/// <returns></returns>
private Field ResolveCell(Field 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;
}
示例5: Search
//////////
// search a key word in mutiple fields
//////////
public List<BookInfo> Search( List<string> texts, Field field)
{
if (field.Equals(Field.TIME))
{
List<int> times = new List<int>();
foreach(string time in texts)
{
times.Add(Int32.Parse(time));
}
return Search(times,Global.Field2String(field), 2);
}
return Search(texts,Global.Field2String(field));
}
示例6: PositionOfRangePoint
private int PositionOfRangePoint(RangeFieldOffset position, Field val)
{
int p;
Field 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.");
}
}