本文整理汇总了C#中ScalarValue.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# ScalarValue.Equals方法的具体用法?C# ScalarValue.Equals怎么用?C# ScalarValue.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScalarValue
的用法示例。
在下文中一共展示了ScalarValue.Equals方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetValueToEncode
public override ScalarValue GetValueToEncode(ScalarValue value_Renamed, ScalarValue priorValue, Scalar field)
{
if (value_Renamed == null)
{
return field.DefaultValue.Undefined ? null : ScalarValue.NULL;
}
return value_Renamed.Equals(field.DefaultValue)?null:value_Renamed;
}
示例2: GetValueToEncode
protected internal override ScalarValue GetValueToEncode(ScalarValue value_Renamed, ScalarValue priorValue, ScalarValue defaultValue)
{
if ((priorValue == ScalarValue.UNDEFINED) && value_Renamed.Equals(defaultValue))
{
return null;
}
return (value_Renamed.Equals(priorValue))?null:value_Renamed;
}
示例3: GetValueToEncode
public override ScalarValue GetValueToEncode(ScalarValue value, ScalarValue priorValue, Scalar field)
{
if (priorValue == null)
return value;
if (value == null)
{
if (!field.IsOptional)
throw new ArgumentNullException("value");
if (priorValue == ScalarValue.Undefined && field.DefaultValue.IsUndefined)
return null;
return ScalarValue.Null;
}
if (priorValue.IsUndefined)
return value.Equals(field.DefaultValue) ? null : value;
var inc = ((NumericValue) priorValue).Increment();
return !value.Equals(inc) ? value : null;
}
示例4: GetValueToEncode
public override ScalarValue GetValueToEncode(ScalarValue value_Renamed, ScalarValue priorValue, Scalar field)
{
if (priorValue == null)
{
return value_Renamed;
}
if (value_Renamed == null)
{
if (field.Optional)
{
if (priorValue == ScalarValue.UNDEFINED && field.DefaultValue.Undefined)
{
return null;
}
return ScalarValue.NULL;
}
throw new ArgumentException();
}
if (priorValue.Undefined)
{
if (value_Renamed.Equals(field.DefaultValue))
{
return null;
}
return value_Renamed;
}
if (!value_Renamed.Equals(((NumericValue) priorValue).Increment()))
{
return value_Renamed;
}
return null;
}
示例5: GetValueToEncode
public override ScalarValue GetValueToEncode(ScalarValue value, ScalarValue priorValue, Scalar field)
{
return value == null
? (field.DefaultValue.IsUndefined ? null : ScalarValue.Null)
: (value.Equals(field.DefaultValue) ? null : value);
}
示例6: GetValueToEncode
protected override ScalarValue GetValueToEncode(ScalarValue value, ScalarValue priorValue,
ScalarValue defaultValue)
{
if (ScalarValue.Undefined.Equals(priorValue) && value.Equals(defaultValue))
return null;
return value.Equals(priorValue) ? null : value;
}