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


C# Builtins.RubyModule类代码示例

本文整理汇总了C#中IronRuby.Builtins.RubyModule的典型用法代码示例。如果您正苦于以下问题:C# RubyModule类的具体用法?C# RubyModule怎么用?C# RubyModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: RubyOverloadGroupInfo

        internal RubyOverloadGroupInfo(OverloadInfo/*!*/[]/*!*/ methods, RubyModule/*!*/ declaringModule,
            RubyOverloadGroupInfo/*!*/[] overloadOwners, bool isStatic)
            : base(methods, declaringModule, isStatic) {
            Debug.Assert(overloadOwners == null || methods.Length == overloadOwners.Length);

            _overloadOwners = overloadOwners;
        }
开发者ID:madpilot,项目名称:ironruby,代码行数:7,代码来源:RubyOverloadGroupInfo.cs

示例2: RubyLambdaMethodInfo

 internal RubyLambdaMethodInfo(Proc/*!*/ block, string/*!*/ definitionName, RubyMemberFlags flags, RubyModule/*!*/ declaringModule) 
     : base(flags, declaringModule) {
     Assert.NotNull(block, definitionName, declaringModule);
     _lambda = block.ToLambda(this);
     _definitionName = definitionName;
     _id = Interlocked.Increment(ref _Id);
 }
开发者ID:Jaykul,项目名称:IronLangs,代码行数:7,代码来源:RubyLambdaMethodInfo.cs

示例3: DefineGlobalClass

        protected RubyClass/*!*/ DefineGlobalClass(string/*!*/ name, Type/*!*/ type, RubyClass/*!*/ super, 
            Action<RubyModule> instanceTrait, Action<RubyModule> classTrait, RubyModule[]/*!*/ mixins, Delegate[] factories) {

            RubyClass result = _context.DefineLibraryClass(name, type, instanceTrait, classTrait, super, mixins, factories, _builtin);
            _context.ObjectClass.SetConstant(result.Name, result);
            return result;
        }
开发者ID:mscottford,项目名称:ironruby,代码行数:7,代码来源:Initializer.cs

示例4: get_property_by_name

 public static Object get_property_by_name(RubyModule/*!*/ self, [NotNull]String/*!*/ name)
 {
     if(name == "platform") return "WP7";
     else if(name == "os_version") return "7.0";
     else if(name == "country") return "us";
     else return "";
 }
开发者ID:raulvejar,项目名称:rhodes,代码行数:7,代码来源:RhoSystem.cs

示例5: MethodResolutionResult

 public MethodResolutionResult(RubyMemberInfo/*!*/ info, RubyModule/*!*/ owner, bool visible)
 {
     Assert.NotNull(info, owner);
     _info = info;
     _owner = owner;
     _visible = visible;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:MethodResolutionResult.cs

示例6: UnboundMethod

        internal UnboundMethod(RubyModule/*!*/ targetConstraint, string/*!*/ name, RubyMemberInfo/*!*/ info) {
            Assert.NotNull(targetConstraint, name, info);

            _name = name;
            _info = info;
            _targetConstraint = targetConstraint;
        }
开发者ID:Hank923,项目名称:ironruby,代码行数:7,代码来源:UnboundMethod.cs

示例7: AreIdentical

     public static bool AreIdentical(RubyModule/*!*/ self, [DefaultProtocol, NotNull]MutableString/*!*/ path1, [DefaultProtocol, NotNull]MutableString/*!*/ path2) {
         FileSystemInfo info1, info2;
 
         return RubyFileOps.RubyStatOps.TryCreate(self.Context, self.Context.DecodePath(path1), out info1) 
             && RubyFileOps.RubyStatOps.TryCreate(self.Context, self.Context.DecodePath(path2), out info2)
             && RubyFileOps.RubyStatOps.AreIdentical(self.Context, info1, info2);
     }
开发者ID:follesoe,项目名称:ironruby,代码行数:7,代码来源:FileTest.cs

示例8: RubyMethodGroupInfo

 // copy ctor
 private RubyMethodGroupInfo(RubyMethodGroupInfo/*!*/ info, RubyMemberFlags flags, RubyModule/*!*/ module)
     : base(info.MethodBases, flags, module) {
     _isStatic = info._isStatic;
     _hasVirtuals = info._hasVirtuals;
     _staticDispatchMethods = info._staticDispatchMethods;
     // Note: overloadOwners and maxCachedOverloadLevel are cleared whenever the group is copied.
 }
开发者ID:teejayvanslyke,项目名称:ironruby,代码行数:8,代码来源:RubyMethodGroupInfo.cs

示例9: Load

 public static object Load(RubyScope/*!*/ scope, RubyModule/*!*/ self, MutableString/*!*/ libraryName)
 {
     object loaded;
     scope.RubyContext.Loader.LoadFile(null, self, libraryName, LoadFlags.ResolveLoaded | LoadFlags.AnyLanguage, out loaded);
     Debug.Assert(loaded != null);
     return loaded;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:IronRubyOps.cs

示例10: AreIdentical

        public static bool AreIdentical(ConversionStorage<MutableString>/*!*/ toPath, RubyModule/*!*/ self, object path1, object path2) {
            FileSystemInfo info1, info2;

            return RubyFileOps.RubyStatOps.TryCreate(self.Context, self.Context.DecodePath(Protocols.CastToPath(toPath, path1)), out info1)
                && RubyFileOps.RubyStatOps.TryCreate(self.Context, self.Context.DecodePath(Protocols.CastToPath(toPath, path2)), out info2)
                && RubyFileOps.RubyStatOps.AreIdentical(self.Context, info1, info2);
        }
开发者ID:jschementi,项目名称:iron,代码行数:7,代码来源:FileTest.cs

示例11: EachObject

        public static object EachObject(BlockParam block, RubyModule/*!*/ self, [NotNull]RubyClass/*!*/ theClass) {
            Type classType = theClass.GetType();
            bool isClass = (classType == typeof(RubyClass));
            if (!isClass && classType != typeof(RubyModule)) {
                throw new NotSupportedException("each_object only supported for objects of type Class or Module");
            }
            if (block == null) {
                throw RubyExceptions.NoBlockGiven();
            }

            Dictionary<RubyModule, object> visited = new Dictionary<RubyModule, object>();
            Stack<RubyModule> modules = new Stack<RubyModule>();
            modules.Push(theClass.Context.ObjectClass);
            while (modules.Count > 0) {
                RubyModule next = modules.Pop();
                RubyClass asClass = next as RubyClass;

                if (!isClass || asClass != null) {
                    object result;
                    if (block.Yield(next, out result)) {
                        return result;
                    }
                }
                next.EnumerateConstants(delegate(RubyModule module, string name, object value) {
                    RubyModule constAsModule = (value as RubyModule);
                    if (constAsModule != null && !visited.ContainsKey(constAsModule)) {
                        modules.Push(constAsModule);
                        visited[module] = null;
                    }
                    return false;
                });
            }
            return visited.Count;
        }
开发者ID:joshholmes,项目名称:ironruby,代码行数:34,代码来源:ObjectSpace.cs

示例12: Dump

 public static object Dump(WriterSites/*!*/ sites, RubyModule/*!*/ self, object obj, [NotNull]RubyIO/*!*/ io, [Optional]int? limit)
 {
     BinaryWriter writer = io.GetBinaryWriter();
     MarshalWriter dumper = new MarshalWriter(sites, writer, self.Context, limit);
     dumper.Dump(obj);
     return io;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:Marshal.cs

示例13: choose

        public static void choose(RubyModule/*!*/ self, params object[] args)
        {
            try
            {
                if (args != null && args.Length != 4 && args.Length != 5)
                    throw RubyExceptionData.InitializeException(new RuntimeError("wrong number of arguments"), "wrong number of arguments");

                if (args.Length == 5)
                    m_opaque = args[4].ToString();

                m_fmt = int.Parse(args[3].ToString());

                m_callback = args[0].ToString();
                m_title = args[1].ToString();
                //long init = args[2].toRubyTime().getTime();

                RHODESAPP().MainPage.Dispatcher.BeginInvoke(() =>
                {
                    OpenPickerPage();
                });
            }
            catch (Exception ex)
            {
                Exception rubyEx = self.Context.CurrentException;
                if (rubyEx == null)
                {
                    rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
                }
                LOG.ERROR("choose", ex);
                throw rubyEx;
            }
        }
开发者ID:arissetyawan,项目名称:rhodes,代码行数:32,代码来源:RhoDateTimePicker.cs

示例14: RubyLibraryMethodInfo

 /// <summary>
 /// Creates a Ruby method implemented by a method group of CLR methods.
 /// </summary>
 internal RubyLibraryMethodInfo(LibraryOverload/*!*/[]/*!*/ overloads, RubyMemberFlags flags, RubyModule/*!*/ declaringModule)
     : base(null, flags, declaringModule)
 {
     Assert.NotNullItems(overloads);
     Assert.NotEmpty(overloads);
     _overloads = overloads;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:10,代码来源:RubyLibraryMethodInfo.cs

示例15: RubyMethodGroupBase

 protected RubyMethodGroupBase(OverloadInfo/*!*/[] methods, RubyMemberFlags flags, RubyModule/*!*/ declaringModule)
     : base(flags, declaringModule)
 {
     if (methods != null) {
         SetMethodBasesNoLock(methods);
     }
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:RubyMethodGroupBase.cs


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