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


C# GLib类代码示例

本文整理汇总了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;
		}
开发者ID:Yetangitu,项目名称:f-spot,代码行数:7,代码来源:OutputStream.cs

示例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));
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:7,代码来源:AppChooserDialog.cs

示例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;
		}
开发者ID:Yetangitu,项目名称:f-spot,代码行数:7,代码来源:FileIcon.cs

示例4: Value

 public Value(GLib.GType gtype)
 {
     type = IntPtr.Zero;
     pad1 = new Padding ();
     pad2 = new Padding ();
     g_value_init (ref this, gtype.Val);
 }
开发者ID:saraa,项目名称:fishtastic,代码行数:7,代码来源:Value.cs

示例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));
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:7,代码来源:BufferedOutputStream.cs

示例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;
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:7,代码来源:FileAdapter.cs

示例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);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:7,代码来源:DesktopAppInfo.cs

示例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;
		}
开发者ID:Yetangitu,项目名称:f-spot,代码行数:7,代码来源:MemoryInputStream.cs

示例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);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:7,代码来源:MemoryInputStream.cs

示例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;
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:7,代码来源:Socks4aProxy.cs

示例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);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:7,代码来源:Image.cs

示例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;
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:7,代码来源:Socks4aProxy.cs

示例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);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:7,代码来源:EmblemedIcon.cs

示例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;
        }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:27,代码来源:FileExtensions.cs

示例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;
		}
开发者ID:Yetangitu,项目名称:f-spot,代码行数:7,代码来源:FileIOStream.cs


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