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


C# Span.InsertSpan方法代码示例

本文整理汇总了C#中Span.InsertSpan方法的典型用法代码示例。如果您正苦于以下问题:C# Span.InsertSpan方法的具体用法?C# Span.InsertSpan怎么用?C# Span.InsertSpan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Span的用法示例。


在下文中一共展示了Span.InsertSpan方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NoteRange

        private Span NoteRange(
            Span span,
            SourceRange range)
        {
            if (span == null || range.fileName == null)
                return span;

            span.WriteLine("{0}{1}", startSourceRange, range);
            var subSpan = span.InsertSpan();
            span.WriteLine(endSourceRange);
            return subSpan;
        }
开发者ID:spark-shading-language,项目名称:spark,代码行数:12,代码来源:EmitContextHLSL.cs

示例2: PushErrorMask

 public Span PushErrorMask(Span span, string error)
 {
     span.WriteLine("{0}{1}", PushErrorMaskString, error);
     var subSpan = span.InsertSpan();
     span.WriteLine(PopErrorMaskString);
     return subSpan;
 }
开发者ID:spark-shading-language,项目名称:spark,代码行数:7,代码来源:EmitContextHLSL.cs

示例3: EmitMethodCPP

        public EmitMethodCPP(
            EmitClassCPP clazz,
            string prefix,
            string name,
            string cconv,
            IEmitType resultType,
            Span headerSpan,
            Span sourceSpan)
        {
            _class = clazz;
            _name = name;
            _cconv = cconv;
            _resultType = resultType;
            _headerSpan = headerSpan;
            _sourceSpan = sourceSpan;

            _headerSpan.Write( "static " );
            _headerParamsSpan = CreateSignatureSpan(
                _name,
                _headerSpan);
            _headerSpan.WriteLine(";");

            _fullName = prefix + _name;

            _sourceParamsSpan = CreateSignatureSpan(
                prefix + _name,
                _sourceSpan);
            _sourceSpan.WriteLine();
            _sourceSpan.WriteLine("{");
            _bodySpan = _sourceSpan.IndentSpan();
            _sourceSpan.WriteLine("}");

            _thisParameter = (EmitValCPP) AddParameter(
                Target.Pointer( clazz ),
                "self" );
            _entryBlock = new EmitBlockCPP(this, _bodySpan.InsertSpan());
        }
开发者ID:spark-shading-language,项目名称:spark,代码行数:37,代码来源:EmitTargetCPP.cs

示例4: CreateSignatureSpan

        private Span CreateSignatureSpan(
            string qualifiedName,
            Span span )
        {
            var sigSpan = span.InsertSpan();

            if (_resultType != null)
            {
                sigSpan.Write("{0} ", _resultType);
            }
            sigSpan.Write("{0} {1}(", _cconv, qualifiedName);
            var paramsSpan = sigSpan.IndentSpan();
            sigSpan.Write(")");

            return paramsSpan;
        }
开发者ID:spark-shading-language,项目名称:spark,代码行数:16,代码来源:EmitTargetCPP.cs

示例5: EmitClassCPP

        public EmitClassCPP(
            EmitModuleCPP module,
            string name,
            EmitClassCPP baseClass,
            Span headerSpan,
            Span sourceSpan)
        {
            _module = module;
            _name = name;
            _base = baseClass;
            _headerSpan = headerSpan;
            _sourceSpan = sourceSpan;

            string baseClassString = "";
            if (baseClass != null)
                baseClassString = string.Format(" : public {0}", baseClass._name);

            _headerSpan.WriteLine("class {0}{1}", _name, baseClassString);
            _headerSpan.WriteLine("{");
            _headerSpan.WriteLine("public:");
            _publicSpan = _headerSpan.IndentSpan();
            _publicFieldsSpan = _publicSpan.InsertSpan();
            _headerSpan.WriteLine("protected:");
            _protectedSpan = _headerSpan.IndentSpan();
            _headerSpan.WriteLine("public:");
            _privateSpan = _headerSpan.IndentSpan();
            _headerSpan.WriteLine("};");

            _sourceSpan.WriteLine("// {0}", _name);
        }
开发者ID:spark-shading-language,项目名称:spark,代码行数:30,代码来源:EmitTargetCPP.cs


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