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


C# RubyContext.GetIdentifierEncoding方法代码示例

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


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

示例1: Inspect

 public static MutableString/*!*/ Inspect(RubyContext/*!*/ context, char self) {
     return MutableString.Create(
         MutableString.AppendUnicodeRepresentation(
             new StringBuilder().Append('\''), self.ToString(), MutableString.Escape.Special, '\'', -1
         ).Append("' (Char)").ToString(),
         context.GetIdentifierEncoding()
     );
 }
开发者ID:ExpertsInside,项目名称:IronSP,代码行数:8,代码来源:CharOps.cs

示例2: TagUri

 public static MutableString/*!*/ TagUri(RubyContext/*!*/ context, object self) {
     var result = MutableString.Create(Tags.RubyObject, context.GetIdentifierEncoding());
     var selfClass = context.GetClassOf(self);
     if (selfClass != context.ObjectClass) {
         return result.Append(':').Append(context.GetClassName(self));
     } else {
         return result;
     }
 }
开发者ID:rudimk,项目名称:dlr-dotnet,代码行数:9,代码来源:BuiltinsOps.cs

示例3: Inspect

 public static MutableString/*!*/ Inspect(RubyContext/*!*/ context, RubyEncoding/*!*/ self) {
     // TODO: to_s overridden
     MutableString result = MutableString.CreateMutable(context.GetIdentifierEncoding());
     result.Append("#<");
     result.Append(context.GetClassDisplayName(self));
     result.Append(':');
     result.Append(self.Name);
     result.Append('>');
     return result;
 }
开发者ID:BrianGenisio,项目名称:ironruby,代码行数:10,代码来源:RubyEncodingOps.cs

示例4: GetTagUri

 internal static MutableString/*!*/ GetTagUri(RubyContext/*!*/ context, object/*!*/ obj, string/*!*/ baseTag, Type/*!*/ baseType) {
     var result = MutableString.Create(baseTag, context.GetIdentifierEncoding());
     if (obj.GetType() != baseType) {
         return result.Append(':').Append(context.GetClassName(obj));
     } else {
         return result;
     }
 }
开发者ID:ExpertsInside,项目名称:IronSP,代码行数:8,代码来源:RubyYaml.cs

示例5: Inspect

        public static MutableString/*!*/ Inspect(RubyContext/*!*/ context, TypeGroup/*!*/ self) {
            var result = MutableString.CreateMutable(context.GetIdentifierEncoding());
            result.Append("#<TypeGroup: ");

            bool isFirst = true;
            foreach (var entry in self.TypesByArity.ToSortedList((x, y) => x.Key - y.Key)) {
                Type type = entry.Value;

                if (!isFirst) {
                    result.Append(", ");
                } else {
                    isFirst = false;
                }

                result.Append(context.GetTypeName(type, true));
            }
            result.Append('>');

            return result;
        }
开发者ID:rudimk,项目名称:dlr-dotnet,代码行数:20,代码来源:TypeGroupOps.cs

示例6: GetName

 public static MutableString/*!*/ GetName(RubyContext/*!*/ context, TypeGroup/*!*/ self) {
     return MutableString.Create(self.Name, context.GetIdentifierEncoding());
 }
开发者ID:rudimk,项目名称:dlr-dotnet,代码行数:3,代码来源:TypeGroupOps.cs

示例7: ToS

        /*!*/
        internal static MutableString ToS(RubyContext/*!*/ context, string/*!*/ methodName, RubyModule/*!*/ declaringModule, RubyModule/*!*/ targetModule, 
            string/*!*/ classDisplayName)
        {
            MutableString result = MutableString.CreateMutable(context.GetIdentifierEncoding());

            result.Append("#<");
            result.Append(classDisplayName);
            result.Append(": ");

            if (ReferenceEquals(targetModule, declaringModule)) {
                result.Append(declaringModule.GetDisplayName(context, true));
            } else {
                result.Append(targetModule.GetDisplayName(context, true));
                result.Append('(');
                result.Append(declaringModule.GetDisplayName(context, true));
                result.Append(')');
            }

            result.Append('#');
            result.Append(methodName);
            result.Append('>');
            return result;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:24,代码来源:UnboundMethod.cs

示例8: GetDisplayName

        public MutableString GetDisplayName(RubyContext/*!*/ context, bool showEmptyName) {
            if (IsSingletonClass) {
                RubyClass c = (RubyClass)this;
                object singletonOf;
                MutableString result = MutableString.CreateMutable(context.GetIdentifierEncoding());

                int nestings = 0;
                while (true) {
                    nestings++;
                    result.Append("#<Class:");

                    singletonOf = c.SingletonClassOf;

                    RubyModule module = singletonOf as RubyModule;

                    if (module == null || !module.IsSingletonClass && module.Name == null) {
                        nestings++;
                        result.Append("#<");
                        result.Append(c.SuperClass.GetName(context));
                        result.Append(':');
                        RubyUtils.AppendFormatHexObjectId(result, RubyUtils.GetObjectId(_context, singletonOf));
                        break;
                    }

                    if (!module.IsSingletonClass) {
                        result.Append(module.GetName(context));
                        break;
                    }

                    c = (RubyClass)module;
                }
                return result.Append('>', nestings);
            } else if (_name == null) {
                if (showEmptyName) {
                    return null;
                } else {
                    MutableString result = MutableString.CreateMutable(context.GetIdentifierEncoding());
                    result.Append("#<");
                    result.Append(_context.GetClassOf(this).GetName(context));
                    result.Append(':');
                    RubyUtils.AppendFormatHexObjectId(result, RubyUtils.GetObjectId(_context, this));
                    result.Append('>');
                    return result;
                }
            } else {
                return MutableString.CreateMutable(GetName(context), context.GetIdentifierEncoding());
            }
        }
开发者ID:TerabyteX,项目名称:main,代码行数:48,代码来源:RubyModule.cs

示例9: Inspect

        public static MutableString Inspect(RubyContext/*!*/ context, Thread/*!*/ self)
        {
            RubyThreadInfo.RegisterThread(Thread.CurrentThread);

            MutableString result = MutableString.CreateMutable(context.GetIdentifierEncoding());
            result.Append("#<");
            result.Append(context.GetClassDisplayName(self));
            result.Append(':');
            RubyUtils.AppendFormatHexObjectId(result, RubyUtils.GetObjectId(context, self));
            result.Append(' ');

            RubyThreadStatus status = GetStatus(self);
            switch (status) {
                case RubyThreadStatus.Unstarted:
                    result.Append("unstarted");
                    break;
                case RubyThreadStatus.Running:
                    result.Append("run");
                    break;
                case RubyThreadStatus.Sleeping:
                    result.Append("sleep");
                    break;
                case RubyThreadStatus.Aborting:
                    result.Append("aborting");
                    break;
                case RubyThreadStatus.Completed:
                case RubyThreadStatus.Aborted:
                    result.Append("dead");
                    break;
            }

            result.Append('>');
            return result;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:34,代码来源:ThreadOps.cs

示例10: GetRubyName

 public static MutableString/*!*/ GetRubyName(RubyContext/*!*/ context, ClrName/*!*/ self) {
     return MutableString.Create(self.MangledName, context.GetIdentifierEncoding());
 }
开发者ID:ExpertsInside,项目名称:IronSP,代码行数:3,代码来源:ClrNameOps.cs

示例11: Inspect

 public static MutableString/*!*/ Inspect(RubyContext/*!*/ context, BigDecimal/*!*/ self) {
     MutableString str = MutableString.CreateMutable(context.GetIdentifierEncoding());
     str.AppendFormat("#<{0}:", context.GetClassOf(self).Name);
     RubyUtils.AppendFormatHexObjectId(str, RubyUtils.GetObjectId(context, self));
     str.AppendFormat(",'{0}',{1}({2})>", 
         self.ToString(10),
         self.PrecisionDigits,
         self.MaxPrecisionDigits
     );
     return str;
 }
开发者ID:ExpertsInside,项目名称:IronSP,代码行数:11,代码来源:BigDecimalOps.cs

示例12: TagUri

 public static MutableString TagUri(RubyContext/*!*/ context, object/*!*/ self)
 {
     var result = MutableString.Create(Tags.TimestampYmd, context.GetIdentifierEncoding());
     string className = context.GetClassName(self);
     if (className != "Date") {
         return result.Append(':').Append(className);
     } else {
         return result;
     }
 }
开发者ID:TerabyteX,项目名称:main,代码行数:10,代码来源:BuiltinsOps.cs

示例13: ReinitializeException

 public static Exception/*!*/ ReinitializeException(RubyContext/*!*/ context, Exception/*!*/ self, [DefaultParameterValue(null)]object message) {
     var instance = RubyExceptionData.GetInstance(self);
     instance.Backtrace = null;
     instance.Message = message ?? MutableString.Create(context.GetClassOf(self).Name, context.GetIdentifierEncoding());
     return self;
 }
开发者ID:Jaykul,项目名称:IronLangs,代码行数:6,代码来源:ExceptionOps.cs

示例14: GetClrName

 public static MutableString GetClrName(RubyContext/*!*/ context, ClrName/*!*/ self)
 {
     return MutableString.Create(self.ActualName, context.GetIdentifierEncoding());
 }
开发者ID:TerabyteX,项目名称:main,代码行数:4,代码来源:ClrNameOps.cs


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