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


C# ConversionStorage类代码示例

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


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

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

示例2: GetGroup

 public static RubyArray GetGroup(ConversionStorage<int>/*!*/ fixnumCast, MatchData/*!*/ self, [NotNull]Range/*!*/ range) {
     int begin, count;
     if (!IListOps.NormalizeRange(fixnumCast, self.Groups.Count, range, out begin, out count)) {
         return null;
     }
     return GetGroup(fixnumCast.Context, self, begin, count);
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:7,代码来源:MatchDataOps.cs

示例3: ToPrintedString

 public static MutableString/*!*/ ToPrintedString(ConversionStorage<MutableString>/*!*/ tosConversion, object obj) {
     if (obj == null) {
         return MutableString.CreateAscii("nil");
     } else {
         return Protocols.ConvertToString(tosConversion, obj);
     }
 }
开发者ID:rudimk,项目名称:dlr-dotnet,代码行数:7,代码来源:PrintOps.cs

示例4: Connect

        public static int Connect(ConversionStorage<MutableString>/*!*/ stringCast, ConversionStorage<int>/*!*/ fixnumCast, 
            RubyContext/*!*/ context, UDPSocket/*!*/ self, object hostname, object port) {

            string strHostname = ConvertToHostString(stringCast, context, hostname);
            int iPort = ConvertToPortNum(stringCast, fixnumCast, context, port);
            self.Socket.Connect(strHostname, iPort);
            return 0;
        }
开发者ID:tnachen,项目名称:ironruby,代码行数:8,代码来源:UDPSocket.cs

示例5: PrintFormatted

 public static void PrintFormatted(
     StringFormatterSiteStorage/*!*/ storage,
     ConversionStorage<MutableString>/*!*/ stringCast,
     BinaryOpStorage/*!*/ writeStorage,
     object/*!*/ self, [DefaultProtocol, NotNull]MutableString/*!*/ format, params object[]/*!*/ args)
 {
     KernelOps.PrintFormatted(storage, stringCast, writeStorage, null, self, format, args);
 }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:PrintOps.cs

示例6: CastToInt64Unchecked

        public static long CastToInt64Unchecked(ConversionStorage<IntegerValue>/*!*/ integerConversion, object obj)
        {
            if (obj == null) {
                throw RubyExceptions.CreateTypeError("no implicit conversion from nil to integer");
            }

            return CastToInteger(integerConversion, obj).ToInt64();
        }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:Protocols.cs

示例7: Reinitialize

        public static TCPServer/*!*/ Reinitialize(ConversionStorage<MutableString>/*!*/ stringCast, ConversionStorage<int>/*!*/ fixnumCast,
            TCPServer/*!*/ self,
            [DefaultProtocol]MutableString remoteHost, object remotePort,
            [DefaultProtocol]MutableString localHost, object localPort) {

            self.Socket = CreateSocket(remoteHost, ConvertToPortNum(stringCast, fixnumCast, remotePort));
            BindLocalEndPoint(self, localHost, ConvertToPortNum(stringCast, fixnumCast, localPort));
            return self;
        }
开发者ID:kevinkeeney,项目名称:ironruby,代码行数:9,代码来源:TCPSocket.cs

示例8: CreateTCPSocket

        public static TCPSocket/*!*/ CreateTCPSocket(ConversionStorage<MutableString>/*!*/ stringCast, ConversionStorage<int>/*!*/ fixnumCast, 
            RubyClass/*!*/ self, [DefaultProtocol, NotNull]MutableString/*!*/ remoteHost, object remotePort) {
            int port = ConvertToPortNum(stringCast, fixnumCast, self.Context, remotePort);

            Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            socket.Connect(remoteHost.ConvertToString(), port);

            return new TCPSocket(self.Context, socket);
        }
开发者ID:tnachen,项目名称:ironruby,代码行数:9,代码来源:TCPSocket.cs

示例9: Scan

 public static Object Scan(ConversionStorage<MutableString>/*!*/ toMutableStringStorage, RespondToStorage/*!*/ respondsTo, 
     BinaryOpStorage/*!*/ readIOStorage, BlockParam block, RubyModule/*!*/ self, Object/*!*/ source, Hash/*!*/ options)
 {
     Object elementContent;
     if (!self.TryGetConstant(null, "ElementContent", out elementContent) && !(elementContent is Hash)) {
         throw new Exception("Hpricot::ElementContent is missing or it is not an Hash");
     }
     var scanner = new HpricotScanner(toMutableStringStorage, readIOStorage, block);
     return scanner.Scan(source, options, elementContent as Hash);
 }
开发者ID:nrk,项目名称:ironruby-hpricot,代码行数:10,代码来源:Hpricot.cs

示例10: ReceiveFromNonBlocking

 public static RubyArray/*!*/ ReceiveFromNonBlocking(ConversionStorage<int>/*!*/ fixnumCast, RubyContext/*!*/ context, IPSocket/*!*/ self, int length, object/*Numeric*/ flags) {
     bool blocking = self.Socket.Blocking;
     try {
         self.Socket.Blocking = false;
         return ReceiveFrom(fixnumCast, context, self, length, flags);
     } finally {
         // Reset the blocking
         self.Socket.Blocking = blocking;
     }
 }
开发者ID:tnachen,项目名称:ironruby,代码行数:10,代码来源:UDPSocket.cs

示例11: ReceiveFromNonBlocking

 public static RubyArray/*!*/ ReceiveFromNonBlocking(ConversionStorage<int>/*!*/ fixnumCast, IPSocket/*!*/ self, int length) {
     bool blocking = self.Socket.Blocking;
     try {
         self.Socket.Blocking = false;
         return ReceiveFrom(fixnumCast, self, length, null);
     } finally {
         // Reset the blocking
         self.Socket.Blocking = blocking;
     }
 }
开发者ID:atczyc,项目名称:ironruby,代码行数:10,代码来源:UDPSocket.cs

示例12: Bind

        public static int Bind(ConversionStorage<MutableString>/*!*/ stringCast, ConversionStorage<int>/*!*/ fixnumCast, 
            RubyContext/*!*/ context, UDPSocket/*!*/ self, object hostNameOrAddress, object port) {

            int iPort = ConvertToPortNum(stringCast, fixnumCast, context, port);
            IPAddress address = (hostNameOrAddress != null) ? 
                GetHostAddress(ConvertToHostString(stringCast, context, hostNameOrAddress)) : IPAddress.Loopback;

            IPEndPoint ep = new IPEndPoint(address, iPort);
            self.Socket.Bind(ep);
            return 0;
        }
开发者ID:tnachen,项目名称:ironruby,代码行数:11,代码来源:UDPSocket.cs

示例13: CreateTCPSocket

        public static TCPSocket/*!*/ CreateTCPSocket(ConversionStorage<MutableString>/*!*/ stringCast, ConversionStorage<int>/*!*/ fixnumCast, 
            RubyClass/*!*/ self, [DefaultProtocol]MutableString remoteHost, object remotePort, [Optional]int localPort) {

            // Not sure what the semantics should be in this case but we make sure not to blow up.
            // Real-world code (Server.connect_to in memcache.rb in the memcache-client gem) does do "TCPSocket.new(host, port, 0)"
            if (localPort != 0) {
                throw new NotImplementedError();
            }

            return new TCPSocket(self.Context, CreateSocket(remoteHost, ConvertToPortNum(stringCast, fixnumCast, remotePort)));
        }
开发者ID:kevinkeeney,项目名称:ironruby,代码行数:11,代码来源:TCPSocket.cs

示例14: CreateFile

        public static RubyIO/*!*/ CreateFile(
            ConversionStorage<int?>/*!*/ toInt,
            ConversionStorage<IDictionary<object, object>>/*!*/ toHash,
            ConversionStorage<MutableString>/*!*/ toStr,
            RubyClass/*!*/ self,
            object descriptor,
            [Optional]object optionsOrMode,
            [DefaultParameterValue(null), DefaultProtocol]IDictionary<object, object> options) {

            return Reinitialize(toInt, toHash, toStr, new RubyIO(self.Context), descriptor, optionsOrMode, options);
        }
开发者ID:rpattabi,项目名称:ironruby,代码行数:11,代码来源:IoOps.cs

示例15: CreateSubclass

 public static Hash/*!*/ CreateSubclass(ConversionStorage<IList>/*!*/ toAry, RubyClass/*!*/ self, [NotNull]IList/*!*/ list) {
     Hash result = Hash.CreateInstance(self);
     var toArySite = toAry.GetSite(TryConvertToArrayAction.Make(toAry.Context));
     foreach (object item in list) {
         IList pair = toArySite.Target(toArySite, item);
         if (pair != null && pair.Count >= 1 && pair.Count <= 2) {
             RubyUtils.SetHashElement(self.Context, result, pair[0], (pair.Count == 2) ? pair[1] : null);
         }
     }
     return result;
 }
开发者ID:jschementi,项目名称:iron,代码行数:11,代码来源:HashOps.cs


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