本文整理汇总了C#中Org.Append方法的典型用法代码示例。如果您正苦于以下问题:C# Org.Append方法的具体用法?C# Org.Append怎么用?C# Org.Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Org
的用法示例。
在下文中一共展示了Org.Append方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Append
public override void Append(ref Dictionary<string,object> variables, Org.Reddragonit.Stringtemplate.Outputs.IOutputWriter writer)
{
object obj = Utility.LocateObjectInVariables(_variable, variables);
_format = (Utility.LocateObjectInVariables(_format, variables) != null ? Utility.LocateObjectInVariables(_format, variables) : _format).ToString();
if (obj != null)
writer.Append(((IFormattable)Utility.LocateObjectInVariables(_variable, variables)).ToString(_format, null));
}
示例2: Append
public override void Append(ref Dictionary<string, object> variables, Org.Reddragonit.Stringtemplate.Outputs.IOutputWriter writer)
{
object obj = Utility.LocateObjectInVariables(val, variables);
if (obj == null)
throw new Exception("Unable to locate a variable of the name " + val + " in order to extract the type name");
writer.Append(obj.GetType().FullName);
}
示例3: Append
public override void Append(ref Dictionary<string, object> variables, Org.Reddragonit.Stringtemplate.Outputs.IOutputWriter writer)
{
StringOutputWriter swo = new StringOutputWriter();
Decimal? d = null;
try
{
_val.Append(ref variables, swo);
d = Decimal.Parse(swo.ToString());
}
catch (Exception e)
{
if (_val is GenericComponent)
{
swo.Clear();
_val.Append(ref variables, swo);
string str = Utility.GenerateStringFromObject(Utility.LocateObjectInVariables(swo.ToString(), variables));
if (str != null)
{
try
{
d = Decimal.Parse(str);
}
catch (Exception ex)
{
d = null;
}
}
}
}
if (d.HasValue)
{
if (d.Value % 2 == 0)
writer.Append(true.ToString());
else
writer.Append(false.ToString());
}
else
writer.Append(false.ToString());
}
示例4: Append
public override void Append(ref Dictionary<string, object> variables, Org.Reddragonit.Stringtemplate.Outputs.IOutputWriter writer)
{
StringOutputWriter swo = new StringOutputWriter();
_eval.Append(ref variables,swo);
string tmp = swo.ToString();
swo.Clear();
_search.Append(ref variables, swo);
string search = swo.ToString();
swo.Clear();
_replace.Append(ref variables, swo);
string replace = swo.ToString();
if ((tmp != null)&&(search!=null)&&(replace!=null))
{
if (search.StartsWith("\"") && search.EndsWith("\""))
search = search.Substring(1, search.Length - 2);
else if (search.StartsWith("'") && search.EndsWith("'"))
search = search.Substring(1, search.Length - 2);
if (replace.StartsWith("\"") && replace.EndsWith("\""))
replace = replace.Substring(1, replace.Length - 2);
else if (replace.StartsWith("'") && replace.EndsWith("'"))
replace = replace.Substring(1, replace.Length - 2);
writer.Append(tmp.Replace(search, replace));
}
}