本文整理汇总了C#中StringBuilder.RemoveEnd方法的典型用法代码示例。如果您正苦于以下问题:C# StringBuilder.RemoveEnd方法的具体用法?C# StringBuilder.RemoveEnd怎么用?C# StringBuilder.RemoveEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringBuilder
的用法示例。
在下文中一共展示了StringBuilder.RemoveEnd方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeParametersList
private string MakeParametersList(ParameterListSyntax syntax)
{
var args = syntax.Parameters;
StringBuilder str = new StringBuilder();
if (args.Count > 0)
{
var fstArg = args[0];
if (fstArg.IsExtensionParameter())
this.AppendCompileIssue(syntax, IssueType.Error, IssueId.ExtensionMethodNotSupport);
foreach (var arg in args)
{
var info = _semanticModel.GetDeclaredSymbol(arg);
if (!info.Type.IsScriptSymbol())
{
this.AppendCompileIssue(syntax, IssueType.Error, IssueId.UseNonScript, info.Type);
}
if (arg.Default != null)
{
this.AppendCompileIssue(syntax, IssueType.Error, IssueId.DefaultParamNotSupport);
}
str.Append(_semanticModel.GetParameterSymbolName(arg)).Append(", ");
}
str.RemoveEnd(", ");
}
return str.ToString();
}
示例2: BuildSelectColumns
public virtual StringBuilder BuildSelectColumns(IObjectMapInfo map)
{
StringBuilder b = new StringBuilder();
foreach (var pmi in map.PropertyMaps)
{
b.Append(_tr.GetEscapedColumnName(pmi.ColumnName)).Append(_tr.ColumnDelimiter);
}
b.RemoveEnd(_tr.ColumnDelimiter);
return b;
}
示例3: BuildInsertColumns
public override StringBuilder BuildInsertColumns(MappingInfo.IObjectMapInfo map, object entity)
{
StringBuilder b = new StringBuilder();
foreach (var pmi in map.PropertyMaps)
{
b.Append(_tr.GetEscapedColumnName(pmi.ColumnName)).Append(_tr.ColumnDelimiter);
}
b.RemoveEnd(_tr.ColumnDelimiter);
return b;
}
示例4: BuildOrderSelectColumns
public virtual StringBuilder BuildOrderSelectColumns(OrderCollection order, IEnumerable<SingleEntityView> svList)
{
_str = new StringBuilder();
foreach (var o in order)
{
_str.Append(_oev.GetOrderByClause(o.OrderExpression, svList));
_str.Append(_tr.ColumnDelimiter);
}
_str.RemoveEnd(_tr.ColumnDelimiter);
return _str;
}
示例5: ToJsonString
public string ToJsonString(object instance)
{
var dict = instance as IEnumerable;
StringBuilder str = new StringBuilder();
foreach (dynamic kvp in dict)
{
str.AppendFormat("\"{0}\":{1},", kvp.Key, JsonExtension.ToJsonString(kvp.Value));
}
if (str.Length > 0)
str.RemoveEnd(',');
return str.Bracketing(StringPair.CurlyBracket).ToString();
}
示例6: BuildUpdateSets
public virtual StringBuilder BuildUpdateSets(IObjectMapInfo map, object entity)
{
StringBuilder b = new StringBuilder();
IReflector r = Reflector.Bind(entity);
foreach (var pmi in map.NonPKPropertyMaps)
{
b.Append(_tr.GetEscapedColumnName(pmi.ColumnName));
b.Append(_tr.Equal).Append(_tr.GetValueString(r.GetPropertyValue(pmi.PropertyName)));
b.Append(_tr.ColumnDelimiter);
}
b.RemoveEnd(_tr.ColumnDelimiter);
return b;
}
示例7: BuildInsertColumns
public virtual StringBuilder BuildInsertColumns(IObjectMapInfo map, object entity)
{
StringBuilder b = new StringBuilder();
foreach (var pmi in map.PropertyMaps)
{
if (map.PrimaryKeyGenerate == PrimaryKeyGenerate.Auto && map.PrimaryKeyMaps.Contains(pmi))
continue;
b.Append(_tr.GetEscapedColumnName(pmi.ColumnName)).Append(_tr.ColumnDelimiter);
}
b.RemoveEnd(_tr.ColumnDelimiter);
return b;
}
示例8: ToJsonString
public string ToJsonString(object instance)
{
var list = instance as IEnumerable;
StringBuilder str = new StringBuilder();
foreach (var item in list)
{
str.Append(item.ToJsonString()).Append(",");
}
if (str.Length > 0)
str.RemoveEnd(',');
return str.Bracketing(StringPair.SquareBracket).ToString();
}
示例9: BuildInsertValues
public override StringBuilder BuildInsertValues(MappingInfo.IObjectMapInfo map, object entity)
{
StringBuilder b = new StringBuilder();
IReflector r = Reflector.Bind(entity);
foreach (var pmi in map.PropertyMaps)
{
if (map.PrimaryKeyGenerate == PrimaryKeyGenerate.Customized && map.PrimaryKeyMaps.Contains(pmi))
{
string sequenceName = map.PKGenerateString.RemoveBegin(ConstantString.SEQ_Prefix);
b.Append(sequenceName).Append(_tr.MemberAccess).Append(ConstantString.SEQ_NextVal).Append(_tr.ColumnDelimiter);
continue;
}
b.Append(_tr.GetValueString(r.GetPropertyValue(pmi.PropertyName))).Append(_tr.ColumnDelimiter);
}
b.RemoveEnd(_tr.ColumnDelimiter);
return b;
}
示例10: MakeInterfacesList
private string MakeInterfacesList(ClassDeclarationSyntax syntax)
{
var interfaces = _semanticModel.GetDeclaredSymbol(syntax).Interfaces;
StringBuilder str = new StringBuilder();
foreach (var info in interfaces)
{
if (!info.IsScriptSymbol())
{
this.AppendCompileIssue(syntax, IssueType.Error, IssueId.UseNonScript, info);
}
str.AppendFormat("{0}, ", info.GetTypeSymbolName());
}
if (interfaces.Count() > 0)
str.RemoveEnd(", ");
return str.ToString();
}
示例11: BuildInsertValues
public virtual StringBuilder BuildInsertValues(IObjectMapInfo map, object entity)
{
StringBuilder b = new StringBuilder();
IReflector r = Reflector.Bind(entity);
foreach (var pmi in map.PropertyMaps)
{
if (map.PrimaryKeyGenerate == PrimaryKeyGenerate.Auto && map.PrimaryKeyMaps.Contains(pmi))
continue;
//Note:special handling Guid when insert, must use '*', not same as WHERE {Guid{*}}
object val = r.GetPropertyValue(pmi.PropertyName);
if (val is Guid)
b.Append(_tr.GetValueString(val.ToString())).Append(_tr.ColumnDelimiter);
else
b.Append(_tr.GetValueString(val)).Append(_tr.ColumnDelimiter);
}
b.RemoveEnd(_tr.ColumnDelimiter);
return b;
}
示例12: BuildWherePrimaryKey
public virtual StringBuilder BuildWherePrimaryKey(IObjectMapInfo map, object entity)
{
StringBuilder b = new StringBuilder();
IReflector r = Reflector.Bind(entity);
foreach (var pki in map.PrimaryKeyMaps)
{
b.Append(_tr.GetEscapedColumnName(pki.ColumnName));
object right = r.GetPropertyValue(pki.PropertyName);
if (right == null)
b.Append(_tr.Is);
else
b.Append(_tr.Equal);
b.Append(_tr.GetValueString(right));
b.Append(_tr.And);
}
b.RemoveEnd(_tr.And);
return b;
}