本文整理汇总了C#中IronRuby.Builtins.RubyIO.SetStream方法的典型用法代码示例。如果您正苦于以下问题:C# RubyIO.SetStream方法的具体用法?C# RubyIO.SetStream怎么用?C# RubyIO.SetStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IronRuby.Builtins.RubyIO
的用法示例。
在下文中一共展示了RubyIO.SetStream方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Reopen
private static RubyIO/*!*/ Reopen(ConversionStorage<MutableString>/*!*/ toPath, RubyIO/*!*/ io, object pathObj, IOInfo info) {
MutableString path = Protocols.CastToPath(toPath, pathObj);
Stream newStream = RubyFile.OpenFileStream(io.Context, path.ToString(path.Encoding.Encoding), info.Mode);
io.Context.SetStream(io.GetFileDescriptor(), newStream);
io.SetStream(newStream);
io.Mode = info.Mode;
if (info.HasEncoding) {
io.ExternalEncoding = info.ExternalEncoding;
io.InternalEncoding = info.InternalEncoding;
}
return io;
}
示例2: InitializeCopy
public static RubyIO/*!*/ InitializeCopy(RubyIO/*!*/ self, [NotNull]RubyIO/*!*/ source) {
Stream stream = source.GetStream();
int descriptor = self.Context.DuplicateFileDescriptor(source.GetFileDescriptor());
self.SetStream(stream);
self.SetFileDescriptor(descriptor);
self.Mode = source.Mode;
self.ExternalEncoding = source.ExternalEncoding;
self.InternalEncoding = source.InternalEncoding;
return self;
}
示例3: Reinitialize
internal static RubyIO/*!*/ Reinitialize(RubyIO/*!*/ io, int descriptor, IOInfo info) {
io.Mode = info.Mode;
io.SetStream(GetDescriptorStream(io.Context, descriptor));
io.SetFileDescriptor(descriptor);
if (info.HasEncoding) {
io.ExternalEncoding = info.ExternalEncoding;
io.InternalEncoding = info.InternalEncoding;
}
return io;
}
示例4: Reinitialize
public static RubyIO/*!*/ Reinitialize(RubyIO/*!*/ self, [DefaultProtocol]int descriptor, int mode) {
self.Mode = (IOMode)mode;
self.SetStream(GetDescriptorStream(self.Context, descriptor));
self.SetFileDescriptor(descriptor);
return self;
}
示例5: Reopen
public static RubyIO/*!*/ Reopen(RubyIO/*!*/ self, [DefaultProtocol, NotNull]MutableString/*!*/ path, int mode) {
Stream newStream = RubyFile.OpenFileStream(self.Context, path.ConvertToString(), (IOMode)mode);
self.Context.SetStream(self.GetFileDescriptor(), newStream);
self.SetStream(newStream);
self.Mode = (IOMode)mode;
return self;
}