本文整理汇总了C#中GLib类的典型用法代码示例。如果您正苦于以下问题:C# GLib类的具体用法?C# GLib怎么用?C# GLib使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GLib类属于命名空间,在下文中一共展示了GLib类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public unsafe long Write(byte[] buffer, ulong count, GLib.Cancellable cancellable) {
IntPtr error = IntPtr.Zero;
IntPtr raw_ret = g_output_stream_write(Handle, buffer, new UIntPtr (count), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
long ret = (long) raw_ret;
if (error != IntPtr.Zero) throw new GLib.GException (error);
return ret;
}
示例2: AppChooserDialog
public AppChooserDialog (Gtk.Window parent, Gtk.DialogFlags flags, GLib.IFile file) : base (IntPtr.Zero)
{
if (GetType () != typeof (AppChooserDialog)) {
throw new InvalidOperationException ("Can't override this constructor.");
}
Raw = gtk_app_chooser_dialog_new(parent == null ? IntPtr.Zero : parent.Handle, (int) flags, file == null ? IntPtr.Zero : ((file is GLib.Object) ? (file as GLib.Object).Handle : (file as GLib.FileAdapter).Handle));
}
示例3: Load
public GLib.InputStream Load(int size, string type, GLib.Cancellable cancellable) {
IntPtr error = IntPtr.Zero;
IntPtr raw_ret = g_loadable_icon_load(Handle, size, GLib.Marshaller.StringToPtrGStrdup(type), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
GLib.InputStream ret = GLib.Object.GetObject(raw_ret) as GLib.InputStream;
if (error != IntPtr.Zero) throw new GLib.GException (error);
return ret;
}
示例4: Value
public Value(GLib.GType gtype)
{
type = IntPtr.Zero;
pad1 = new Padding ();
pad2 = new Padding ();
g_value_init (ref this, gtype.Val);
}
示例5: BufferedOutputStream
public BufferedOutputStream (GLib.OutputStream base_stream, ulong size) : base (IntPtr.Zero)
{
if (GetType () != typeof (BufferedOutputStream)) {
throw new InvalidOperationException ("Can't override this constructor.");
}
Raw = g_buffered_output_stream_new_sized(base_stream == null ? IntPtr.Zero : base_stream.Handle, new UIntPtr (size));
}
示例6: AppendTo
public GLib.FileOutputStream AppendTo(GLib.FileCreateFlags flags, GLib.Cancellable cancellable) {
IntPtr error = IntPtr.Zero;
IntPtr raw_ret = g_file_append_to(Handle, (int) flags, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
GLib.FileOutputStream ret = GLib.Object.GetObject(raw_ret) as GLib.FileOutputStream;
if (error != IntPtr.Zero) throw new GLib.GException (error);
return ret;
}
示例7: DesktopAppInfo
public DesktopAppInfo (GLib.KeyFile key_file) : base (IntPtr.Zero)
{
if (GetType () != typeof (DesktopAppInfo)) {
throw new InvalidOperationException ("Can't override this constructor.");
}
Raw = g_desktop_app_info_new_from_keyfile(key_file == null ? IntPtr.Zero : key_file.Handle);
}
示例8: Truncate
public bool Truncate(long offset, GLib.Cancellable cancellable) {
IntPtr error = IntPtr.Zero;
bool raw_ret = g_seekable_truncate(Handle, offset, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
bool ret = raw_ret;
if (error != IntPtr.Zero) throw new GLib.GException (error);
return ret;
}
示例9: MemoryInputStream
public MemoryInputStream (IntPtr data, long len, GLib.DestroyNotify destroy) : base (IntPtr.Zero)
{
if (GetType () != typeof (MemoryInputStream)) {
throw new InvalidOperationException ("Can't override this constructor.");
}
Raw = g_memory_input_stream_new_from_data(data, new IntPtr (len), destroy);
}
示例10: ConnectFinish
public GLib.IOStream ConnectFinish(GLib.IAsyncResult result) {
IntPtr error = IntPtr.Zero;
IntPtr raw_ret = g_proxy_connect_finish(Handle, result == null ? IntPtr.Zero : ((result is GLib.Object) ? (result as GLib.Object).Handle : (result as GLib.AsyncResultAdapter).Handle), out error);
GLib.IOStream ret = GLib.Object.GetObject(raw_ret) as GLib.IOStream;
if (error != IntPtr.Zero) throw new GLib.GException (error);
return ret;
}
示例11: Image
public Image (GLib.IIcon icon, Gtk.IconSize size) : base (IntPtr.Zero)
{
if (GetType () != typeof (Image)) {
throw new InvalidOperationException ("Can't override this constructor.");
}
Raw = gtk_image_new_from_gicon(icon == null ? IntPtr.Zero : ((icon is GLib.Object) ? (icon as GLib.Object).Handle : (icon as GLib.IconAdapter).Handle), (int) size);
}
示例12: Connect
public GLib.IOStream Connect(GLib.IOStream connection, GLib.ProxyAddress proxy_address, GLib.Cancellable cancellable) {
IntPtr error = IntPtr.Zero;
IntPtr raw_ret = g_proxy_connect(Handle, connection == null ? IntPtr.Zero : connection.Handle, proxy_address == null ? IntPtr.Zero : proxy_address.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
GLib.IOStream ret = GLib.Object.GetObject(raw_ret) as GLib.IOStream;
if (error != IntPtr.Zero) throw new GLib.GException (error);
return ret;
}
示例13: EmblemedIcon
public EmblemedIcon (GLib.IIcon icon, GLib.Emblem emblem) : base (IntPtr.Zero)
{
if (GetType () != typeof (EmblemedIcon)) {
throw new InvalidOperationException ("Can't override this constructor.");
}
Raw = g_emblemed_icon_new(icon == null ? IntPtr.Zero : ((icon is GLib.Object) ? (icon as GLib.Object).Handle : (icon as GLib.IconAdapter).Handle), emblem == null ? IntPtr.Zero : emblem.Handle);
}
示例14: CopyRecursive
public static bool CopyRecursive(this GLib.File source, GLib.File target, GLib.FileCopyFlags flags, GLib.Cancellable cancellable, GLib.FileProgressCallback callback)
{
bool result = true;
GLib.FileType ft = source.QueryFileType (GLib.FileQueryInfoFlags.None, cancellable);
if (ft != GLib.FileType.Directory) {
Hyena.Log.DebugFormat ("Copying \"{0}\" to \"{1}\"", source.Path, target.Path);
return source.Copy (target, flags, cancellable, callback);
}
if (!target.Exists) {
Hyena.Log.DebugFormat ("Creating directory: \"{0}\"", target.Path);
result = result && target.MakeDirectoryWithParents (cancellable);
}
GLib.FileEnumerator fe = source.EnumerateChildren ("standard::name", GLib.FileQueryInfoFlags.None, cancellable);
GLib.FileInfo fi = fe.NextFile ();
while (fi != null) {
GLib.File source_file = GLib.FileFactory.NewForPath (Path.Combine (source.Path, fi.Name));
GLib.File target_file = GLib.FileFactory.NewForPath (Path.Combine (target.Path, fi.Name));
result = result && source_file.CopyRecursive(target_file, flags, cancellable, callback);
fi = fe.NextFile ();
}
fe.Close (cancellable);
return result;
}
示例15: QueryInfoFinish
public unsafe GLib.FileInfo QueryInfoFinish(GLib.AsyncResult result) {
IntPtr error = IntPtr.Zero;
IntPtr raw_ret = g_file_io_stream_query_info_finish(Handle, result == null ? IntPtr.Zero : result.Handle, out error);
GLib.FileInfo ret = GLib.Object.GetObject(raw_ret) as GLib.FileInfo;
if (error != IntPtr.Zero) throw new GLib.GException (error);
return ret;
}