本文整理汇总了C#中TextManager类的典型用法代码示例。如果您正苦于以下问题:C# TextManager类的具体用法?C# TextManager怎么用?C# TextManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextManager类属于命名空间,在下文中一共展示了TextManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFor
public override ISwitchConditionEvaluator GetFor(string spelling, PatternDialect dialect, TextManager manager)
{
Match m;
if ((m = matcher.Match(spelling)).Success)
{
var ops = new List<ArithmeticCondition.Operation>();
foreach (Match op in operation.Matches(m.Groups["Ops"].Value))
{
ops.Add(new ArithmeticCondition.Operation
{
Number = double.Parse(op.Groups["Number"].Value, dialect.Parser.PatternCulture),
Operator = Arithmetic.GetArithmeticOperator(op.Groups["Op"].Value)
});
}
return new ArithmeticCondition
{
Operations = ops,
CompareOperator = Arithmetic.GetCompareOperator(m.Groups["Op"].Value),
TargetValue = int.Parse(m.Groups["TargetValue"].Value)
};
}
return null;
}
示例2: Parse
/// <summary>
/// Parses the specified pattern returned by the reader and localizes error messages with the text manager specified
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="textManager">The text manager.</param>
/// <returns></returns>
public override Expression Parse(TextReader reader, TextManager textManager)
{
try
{
_reader = reader.ReadToEnd();
_pos = -1;
MoveNext();
var expr = ParseExpression();
if (_current != Eof)
{
UnexpectedToken("Expression", "" + _current);
}
expr.Accept(_trimmer);
return expr;
}
catch (InnerParserException template)
{
throw new SyntaxErrorException(template.Message, template.Construct, template.Pos);
}
}
示例3: Parse
public override Expression Parse(System.IO.TextReader reader, TextManager manager)
{
var expr = new Expression();
expr.Parts.Add(new Text { Spelling = reader.ReadToEnd() });
return expr;
}
示例4: Start
// Use this for initialization
void Start()
{
rb2d = gameObject.GetComponent<Rigidbody2D> ();
animator = gameObject.GetComponent<Animator> ();
movement = getDefaultMovement ();
dragon = GameObject.FindGameObjectWithTag ("Dragon").GetComponent<Dragon> ();
textManager = GameObject.FindGameObjectWithTag ("TextManager").GetComponent<TextManager> ();
}
示例5: GetFor
public IValueFormatter GetFor(string formatExpression, PatternDialect dialect, TextManager manager)
{
if (!string.IsNullOrEmpty(formatExpression))
{
return new StringFormatFormatter(formatExpression);
}
return null;
}
示例6: GetFor
public IValueFormatter GetFor(string formatExpression, PatternDialect dialect, TextManager manager)
{
if (!string.IsNullOrEmpty(formatExpression) && formatExpression.Equals("roman", StringComparison.InvariantCulture))
{
return new RomanNumberFormatter();
}
return null;
}
示例7: GetEvaluator
public override PatternEvaluator GetEvaluator(string pattern, TextManager manager)
{
lock (_parseLock)
{
var expr = Parser.Parse(pattern, manager);
return new PatternEvaluator(expr);
}
}
示例8: GetFor
public override ISwitchConditionEvaluator GetFor(string spelling, PatternDialect dialect, TextManager manager)
{
if (string.IsNullOrEmpty(spelling) || spelling.Equals("true", StringComparison.InvariantCultureIgnoreCase))
{
return new TakeAllCondition();
}
return null;
}
示例9: GetSwitchConditionEvaluator
public virtual ISwitchConditionEvaluator GetSwitchConditionEvaluator(Expression expr, TextManager manager)
{
ISwitchConditionEvaluator sc = null;
if (!SwitchConditionEvaluators.Any(x => (sc = x.GetFor(expr, this, manager)) != null))
{
throw new LocalizedKeyNotFoundException("Exceptions.SwitchConditionNotFound", "No switch condition evaluator found for {0}", new { Spec = expr });
}
return sc;
}
示例10: Start
// Use this for initialization
void Start()
{
networkManager = gameObject.GetComponent<NetworkManager>();
collisionManager = gameObject.GetComponent<CollisionManager>();
textManager = gameObject.GetComponent<TextManager>();
notificationManager = gameObject.GetComponent<NotificationManager>();
panelManager = GameObject.Find("Panel");
scaleChilds(panelManager);
}
示例11: GetValueFormatter
public virtual IValueFormatter GetValueFormatter(string spelling, TextManager manager)
{
IValueFormatter formatter = null;
if (!ValueFormatters.Any(x => (formatter = x.GetFor(spelling, this, manager)) != null))
{
throw new LocalizedKeyNotFoundException("Exceptions.ValueFormatterNotFound", "No parameter evaluator found for {0}", new { Text = spelling});
}
return formatter;
}
示例12: GetParameterEvaluator
public virtual IParameterEvaluator GetParameterEvaluator(ParameterSpec spec, TextManager manager)
{
IParameterEvaluator evaluator = null;
if (!ParameterEvaluators.Any(x => (evaluator = x.GetFor(spec, this, manager)) != null))
{
throw new LocalizedKeyNotFoundException("Exceptions.ParameterEvaluatorNotFound", "No parameter evaluator found for {0}", new { Text = spec });
}
return evaluator;
}
示例13: GetFor
public IParameterEvaluator GetFor(ParameterSpec spec, PatternDialect dialect, TextManager manager)
{
var parts = spec.ParameterName.Split('.');
if (parts.Length > 1)
{
return new ReflectionParameterEvaluator(parts[0], parts.Skip(1).ToArray());
}
return null;
}
示例14: GetFor
public IValueFormatter GetFor(string formatExpression, PatternDialect dialect, TextManager manager)
{
StringCaseTransformationType type;
if (!string.IsNullOrEmpty(formatExpression)
&& _transformationTypes.TryGetValue(formatExpression.ToLowerInvariant(), out type))
{
return new StringCaseFormatter { TransformationType = type };
}
return null;
}
示例15: Start
void Start()
{
root = GameObject.Find("UI Root");
ps = transform.GetComponent<PanelSwitch>();
tm = transform.GetComponent<TextManager>();
im = transform.GetComponent<ImageManager>();
playerdata = new UserData();
for(int i = 0; i < 7; i++)
{
girl[i] = new GirlData(i);
}
}