• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Builtins.RubyModule类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: InducedFrom

 public static decimal InducedFrom(RubyModule/*!*/ self, [NotNull]BigInteger value) {
     try {
         return (decimal)value;
     } catch (OverflowException) {
         throw RubyExceptions.CreateRangeError("number too big to convert into System::Decimal");
     }
 }
开发者ID:rudimk,项目名称:dlr-dotnet,代码行数:7,代码来源:DecimalOps.cs


示例17: RubyEventInfo

 public RubyEventInfo(EventTracker/*!*/ tracker, RubyMemberFlags flags, RubyModule/*!*/ declaringModule, bool isDetached)
     : base(flags, declaringModule)
 {
     Assert.NotNull(tracker, declaringModule);
     _tracker = tracker;
     _isDetached = isDetached;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:RubyEventInfo.cs


示例18: RubyFieldInfo

 public RubyFieldInfo(FieldInfo/*!*/ fieldInfo, RubyMemberFlags flags, RubyModule/*!*/ declaringModule, bool isSetter, bool isDetached)
     : base(flags, declaringModule) {
     Assert.NotNull(fieldInfo, declaringModule);
     _fieldInfo = fieldInfo;
     _isSetter = isSetter;
     _isDetached = isDetached;
 }
开发者ID:Hank923,项目名称:ironruby,代码行数:7,代码来源:RubyFieldInfo.cs


示例19: dosync

        public static object dosync(RubyModule/*!*/ self, RubyArray args)
        {
            object res = null;
            try
            {
                boolean bShowStatus = true;	
                String query_params = "";
                if ( args != null && args.Count > 0 )	
                {
                    String str = ((MutableString)args[0]).ToString();	
                    //bShowStatus = args[0].Equals(RubyConstant.QTRUE)||"true".equalsIgnoreCase(str);	
                    bShowStatus = "true".equalsIgnoreCase(str);	
                }
        
                if (args != null && args.Count > 1)
                    query_params = ((MutableString)args[1]).ToString();
                
                SyncThread.getInstance().addQueueCommand(new SyncThread.SyncCommand(SyncThread.scSyncAll, bShowStatus, query_params));

                res = SyncThread.getInstance().getRetValue();
            }
            catch (Exception ex)
            {
                Exception rubyEx = self.Context.CurrentException;
                if (rubyEx == null)
                {
                    rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
                }
                LOG.ERROR("dosync", ex);
                throw rubyEx;
            }

            return res;
        }
开发者ID:javiermurillo,项目名称:rhodes,代码行数:34,代码来源:RhoSyncEngine.cs


示例20: RubyAttributeAccessorInfo

 protected RubyAttributeAccessorInfo(RubyMemberFlags flags, RubyModule/*!*/ declaringModule, string/*!*/ variableName)
     : base(flags, declaringModule)
 {
     Assert.NotEmpty(variableName);
     Debug.Assert(variableName.StartsWith("@"));
     _instanceVariableName = variableName;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:RubyAccessorInfo.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Builtins.RubyStruct类代码示例发布时间:2022-05-26
下一篇:
C# Builtins.RubyIO类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap