本文整理汇总了C#中Field.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Field.ToString方法的具体用法?C# Field.ToString怎么用?C# Field.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field.ToString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FilterDisplayName
public static string FilterDisplayName(Field filter)
{
switch (filter)
{
case Field.CompanyName:
return "Company";
case Field.Date:
return "Date";
case Field.EducationCode:
return "Education Code";
case Field.FieldOfStudy:
return "Field of Study";
case Field.JobTitle:
return "Job Title";
case Field.Keyword:
return "Keyword";
case Field.Location:
return "Location";
case Field.Salary:
return "Salary";
case Field.Source:
return "Source";
case Field.JobType:
return "Job Type";
default:
return filter.ToString();
}
}
示例2: Create_Field
public void Create_Field()
{
var field = new Field("Create_Field");
var expected = Comparer.Create_Field();
var actual = field.ToString();
Assert.AreEqual(expected, actual);
Console.WriteLine(actual);
}
示例3: Create_Field_ReadOnly
public void Create_Field_ReadOnly()
{
var field = new Field("Create_Field_ReadOnly")
.AddModifiers(MODIFIER.READ_ONLY);
var expected = Comparer.Create_Field_ReadOnly();
var actual = field.ToString();
Assert.AreEqual(expected, actual);
Console.WriteLine(actual);
}
示例4: Create_Field_With_Modifier_Type_And_Value
public void Create_Field_With_Modifier_Type_And_Value()
{
var field = new Field("Create_Field_With_Modifier_Type_And_Value")
.WithModifiers(MODIFIER.PROTECTED)
.WithType<Int32>()
.WithInitializer("42");
var expected = Comparer.Create_Field_With_Modifier_Type_And_Value();
var actual = field.ToString();
Assert.AreEqual(expected, actual);
Console.WriteLine(actual);
}
示例5: BuildParameterString
private string BuildParameterString(Field argName, Field argType, Field inOut)
{
var sb = new StringBuilder();
sb.Append(argName.ToString());
sb.Append(" ");
sb.Append(argType.ToString());
if (!inOut.IsNull)
sb.Append(" ")
.Append(inOut.Value);
return sb.ToString();
}
示例6: SetTrackerVal
public void SetTrackerVal(Field fieldName, object value){
handler._set(fieldName.ToString(), value);
}
示例7: ToString_FieldIsBlack_ContainsTheColorInString
public void ToString_FieldIsBlack_ContainsTheColorInString()
{
fTestObj = new Field(uiNumber, Field.Black);
StringAssert.Contains("black", fTestObj.ToString());
}
示例8: ToString_FieldIsRed_ContainsTheColorInString
public void ToString_FieldIsRed_ContainsTheColorInString()
{
fTestObj = new Field(uiNumber, Field.Red);
StringAssert.Contains("red", fTestObj.ToString());
}
示例9: ToString_FieldIsGreen_ContainsTheColorInString
public void ToString_FieldIsGreen_ContainsTheColorInString()
{
fTestObj = new Field(uiNumber, Field.Green);
StringAssert.Contains("green", fTestObj.ToString());
}
示例10: SetTrackerVal
internal void SetTrackerVal(Field fieldName, object value)
{
object[] args = new object[] { fieldName.ToString(), value };
tracker.Call("set", args);
}
示例11: handleAConstantInTerm
/// <summary>
/// OBSOLETE: Handles a scenario where there is a term in the condition
/// </summary>
/// <param name="left"></param>
/// <param name="right"></param>
/// <param name="binOp"></param>
/// <param name="fmt"></param>
private void handleAConstantInTerm(TermManager termManager, Term left, Term right,
BinaryOperator binOp, bool bNegated, SafeDictionary<Field, FieldValueHolder> fieldValues, Field culpritField,
out FieldModificationType fmt, out int fitnessval)
{
fitnessval = Int32.MaxValue;
fmt = FieldModificationType.UNKNOWN;
Term non_constant_term = null;
Term constant_term = null;
bool bleftRightMaintainted = true;
if (termManager.IsValue(left))
{
non_constant_term = right;
constant_term = left;
bleftRightMaintainted = true;
}
else if (termManager.IsValue(right))
{
non_constant_term = left;
constant_term = right;
bleftRightMaintainted = false;
}
int value;
if (termManager.TryGetI4Constant(constant_term, out value))
{
fmt = FieldModificationType.INCREMENT;
FieldValueHolder fvh;
if (fieldValues.TryGetValue(culpritField, out fvh))
{
int non_constant_field_value = fvh.intValue; //TODO: Assuming that the fieldType is Int32
if (bleftRightMaintainted)
fitnessval = FitnessMeasure.ComputeFitnessValue(this.host, binOp, value, non_constant_field_value, bNegated);
else
fitnessval = FitnessMeasure.ComputeFitnessValue(this.host, binOp, non_constant_field_value, value, bNegated);
}
else
this.host.Log.LogWarning(WikiTopics.MissingWikiTopic, "fitness measure",
"Failed to retrieve value for field " + culpritField.ToString());
}
else if (termManager.IsDefaultValue(constant_term))
{
if (binOp == BinaryOperator.Ceq)
{
if (culpritField.Type.ToString() == "System.Boolean")
{
fmt = bNegated ? FieldModificationType.TRUE_SET : FieldModificationType.FALSE_SET;
}
else
fmt = bNegated ? FieldModificationType.NON_NULL_SET : FieldModificationType.NULL_SET;
}
}
Term objectValue;
ObjectProperty objectProperty;
if (termManager.TryGetObjectProperty(constant_term, out objectValue, out objectProperty))
{
//TODO??? How to handle this scenario?
}
}