本文整理汇总了C#中Value.getType方法的典型用法代码示例。如果您正苦于以下问题:C# Value.getType方法的具体用法?C# Value.getType怎么用?C# Value.getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Value
的用法示例。
在下文中一共展示了Value.getType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: assign
public void assign(java.lang.Object par0, Value par1)
{
java.lang.Object obj = lookup(par0);
if (obj is Variable)
{
Variable var = (Variable)obj;
var.setValue(session, par1.getType(), par1.getValueAsString());
return;
}
throw new NotImplementedException();
}
示例2: assign
public void assign(Object par0, Value par1)
{
Variable var = lookup(par0) as Variable;
if (var != null)
{
int type = var.getValue().getType();
if (type == VariableType_.BOOLEAN || type == VariableType_.NUMBER || type == VariableType_.STRING)
var.setValue(session, par1.getType(), par1.getValueAsString());
else
throw new NotSupportedException(TextHelper.GetString("Error.NoScalar"));
}
else
throw new NoSuchVariableException(System.String.Format(TextHelper.GetString("Error.NoSuchVariable"), par0));
}
示例3: FormatValue
public java.lang.String FormatValue(Value val)
{
java.lang.String ret = "";
if (val == null) return "null";
int type = val.getType();
if (type == VariableType_.MOVIECLIP || type == VariableType_.OBJECT)
{
ret = val.getTypeName();
}
else
{
ret = val.getValueAsString();
}
return ret;
}
示例4: GetInstance
/// <summary>
/// This creates a <c>Map</c> object instance from the type
/// provided. If the type provided is abstract or an interface then
/// this can promote the type to a map object type that can be
/// instantiated. This is done by asking the type to convert itself.
/// </summary>
/// <param name="value">
/// the type used to instantiate the map object
/// </param>
/// <returns>
/// this returns a compatible map object instance
/// </returns>
public Instance GetInstance(Value value) {
Class type = value.getType();
if(!isInstantiable(type)) {
type = GetConversion(type);
}
if(!IsMap(type)) {
throw new InstantiationException("Type is not a map %s", type);
}
return new ConversionInstance(context, value, type);
}