当前位置: 首页>>代码示例>>C#>>正文


C# StringBuilder.RemoveEnd方法代码示例

本文整理汇总了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();
        }
开发者ID:rexzh,项目名称:SharpJs,代码行数:29,代码来源:Rewriter_Misc.cs

示例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;
 }
开发者ID:rexzh,项目名称:RexToy,代码行数:10,代码来源:AbstractMappingColumnsBuilder.cs

示例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;
 }
开发者ID:rexzh,项目名称:RexToy,代码行数:10,代码来源:MappingColumnsBuilder.cs

示例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;
 }
开发者ID:rexzh,项目名称:RexToy,代码行数:11,代码来源:AbstractQueryOrderVisitor.cs

示例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();
        }
开发者ID:rexzh,项目名称:RexToy,代码行数:13,代码来源:DictionaryConverter.cs

示例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;
 }
开发者ID:rexzh,项目名称:RexToy,代码行数:13,代码来源:AbstractMappingColumnsBuilder.cs

示例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;
        }
开发者ID:rexzh,项目名称:RexToy,代码行数:13,代码来源:AbstractMappingColumnsBuilder.cs

示例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();
        }
开发者ID:rexzh,项目名称:RexToy,代码行数:13,代码来源:ListConverter.cs

示例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;
        }
开发者ID:rexzh,项目名称:RexToy,代码行数:18,代码来源:MappingColumnsBuilder.cs

示例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();
        }
开发者ID:rexzh,项目名称:SharpJs,代码行数:18,代码来源:Rewriter_Misc.cs

示例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;
        }
开发者ID:rexzh,项目名称:RexToy,代码行数:19,代码来源:AbstractMappingColumnsBuilder.cs

示例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;
 }
开发者ID:rexzh,项目名称:RexToy,代码行数:18,代码来源:AbstractMappingColumnsBuilder.cs


注:本文中的StringBuilder.RemoveEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。