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


C# RubyContext.GetClassName方法代码示例

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


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

示例1: Xor

        public static object/*!*/ Xor(RubyContext/*!*/ context, object/*!*/ self, [NotNull]object/*!*/ other) {
            Debug.Assert(self is Enum);

            var result = EnumUtils.ExclusiveOr(self, other);
            if (result != null) {
                return result;
            }
            throw RubyExceptions.CreateUnexpectedTypeError(context, other, context.GetClassName(self));
        }
开发者ID:jcteague,项目名称:ironruby,代码行数:9,代码来源:FlagEnumOps.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();
     result.Append("#<");
     result.Append(context.GetClassName(self));
     result.Append(':');
     result.Append(self.Name);
     result.Append(">");
     return result;
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:10,代码来源:RubyEncodingOps.cs

示例4: ToIo

 private static RubyIO/*!*/ ToIo(RubyContext/*!*/ context, object obj) {
     RubyIO io = obj as RubyIO;
     if (io == null) {
         throw RubyExceptions.CreateTypeConversionError(context.GetClassName(obj), "IO");
     }
     return io;
 }
开发者ID:m4dc4p,项目名称:ironruby,代码行数:7,代码来源:IoOps.cs

示例5: 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

示例6: TagUri

 public static MutableString/*!*/ TagUri(RubyContext/*!*/ context, object self) {
     return MutableString.Create("!ruby/object:", RubyEncoding.ClassName).
         Append(context.GetClassName(self)).
         Append(' ');
 }
开发者ID:techarch,项目名称:ironruby,代码行数:5,代码来源:BuiltinsOps.cs

示例7: Inspect

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

            MutableString result = MutableString.CreateMutable();
            result.Append("#<");
            result.Append(context.GetClassName(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:jcteague,项目名称:ironruby,代码行数:33,代码来源:ThreadOps.cs

示例8: ToYamlNode

 public static Node ToYamlNode(RubyContext/*!*/ context, object self, RubyRepresenter rep) {
     throw RubyExceptions.CreateTypeError("can't dump anonymous class " + context.GetClassName(self));
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:3,代码来源:BuiltinsOps.cs

示例9: CreateUnexpectedTypeError

 public static Exception/*!*/ CreateUnexpectedTypeError(RubyContext/*!*/ context, object param, string/*!*/ type) {
     return CreateTypeError(String.Format("wrong argument type {0} (expected {1})", context.GetClassName(param), type));
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:3,代码来源:RubyExceptions.cs

示例10: RequireWriteProtocol

        private object RequireWriteProtocol(RubyContext/*!*/ context, object value, string/*!*/ variableName) {
            if (!context.RespondTo(value, "write")) {
                throw RubyExceptions.CreateTypeError(String.Format("${0} must have write method, {1} given", variableName, context.GetClassName(value)));
            }

            return value;
        }
开发者ID:jcteague,项目名称:ironruby,代码行数:7,代码来源:SpecialGlobalVariableInfo.cs

示例11: 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

示例12: SquareRoot

 public static object SquareRoot(RubyContext/*!*/ context, BigDecimal/*!*/ self, object n) {
     throw RubyExceptions.CreateTypeError("wrong argument type " + context.GetClassName(n) + " (expected Fixnum)");
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:3,代码来源:BigDecimalOps.cs

示例13: MethodShouldReturnType

 public static Exception/*!*/ MethodShouldReturnType(RubyContext/*!*/ context, object param, string/*!*/ method, string/*!*/ targetType) {
     Assert.NotNull(context, method, targetType);
     return new InvalidOperationException(String.Format("{0}#{1} should return {2}",
         context.GetClassName(param), method, targetType
     ));
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:6,代码来源:RubyExceptions.cs

示例14: FormatMethodMissingMessage

        internal static string/*!*/ FormatMethodMissingMessage(RubyContext/*!*/ context, object obj, string/*!*/ name, string/*!*/ message) {
            Assert.NotNull(name);

            string str;
            if (obj == null) {
                str = "nil:NilClass";
            } else if (_disableMethodMissingMessageFormatting) {
                str = RubyUtils.ObjectToMutableString(context, obj).ToString();
            } else {
                _disableMethodMissingMessageFormatting = true;
                try {
                    str = context.Inspect(obj).ConvertToString();
                    if (!str.StartsWith("#", StringComparison.Ordinal)) {
                        str += ":" + context.GetClassName(obj);
                    }
                } catch (Exception) {
                    // MRI: swallows all exceptions
                    str = RubyUtils.ObjectToMutableString(context, obj).ToString();
                } finally {
                    _disableMethodMissingMessageFormatting = false;
                }
            }
            
            return FormatMessage(message, name, str);
        }
开发者ID:cleydson,项目名称:ironruby,代码行数:25,代码来源:RubyExceptions.cs

示例15: TagUri

 public static MutableString TagUri(RubyContext/*!*/ context, object self) {
     MutableString str = MutableString.Create("!ruby/object:");
     str.Append(context.GetClassName(self));
     str.Append(' ');
     return str;
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:6,代码来源:BuiltinsOps.cs


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