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


C# GLib.Value类代码示例

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


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

示例1: OnNewWindowPolicyDecisionRequested

		protected virtual bool OnNewWindowPolicyDecisionRequested (WebFrame frame, NetworkRequest request, WebNavigationAction action, WebPolicyDecision decision)
		{
			var val = new Value (GType.Int);
			var valueArray = new ValueArray (5u);
			var array = new Value[5];

			array [0] = new Value (this);
			valueArray.Append (array [0]);
			array [1] = new Value (frame);
			valueArray.Append (array [1]);
			array [2] = new Value (request);
			valueArray.Append (array [2]);
			array [3] = new Value (action);
			valueArray.Append (array [3]);
			array [4] = new Value (decision);
			valueArray.Append (array [4]);
			GLib.Object.g_signal_chain_from_overridden (valueArray.ArrayPtr, ref val);
			var array2 = array;
			for (int i = 0; i < array2.Length; i++) {
				var value = array2 [i];
				value.Dispose ();
			}
			bool result = (bool)val;
			val.Dispose ();
			return result;
		}
开发者ID:gene-l-thomas,项目名称:Eto,代码行数:26,代码来源:EtoWebView.cs

示例2: RowSeparatorFunc

		bool RowSeparatorFunc (Gtk.TreeModel model, Gtk.TreeIter iter)
		{
			GLib.Value val = new GLib.Value ();
			model.GetValue (iter, 0, ref val);
			bool sep = ((string)val) == "";
			val.Dispose ();
			return sep;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:GroupPicker.cs

示例3: Refresh

		public void Refresh () {
			store.Clear ();
			memberRecords.Clear ();
			if (factory != null && factory.Info != null) {
				Hashtable count = new Hashtable ();
				Hashtable parent = new Hashtable ();
				TreeIter iter;

				foreach (MemberRecord mr in factory.Info) {
					if (factory.HideDuplicates && count [mr.Name] != null) {
						if ((int) count [mr.Name] == 1) {
							TreeIter orig = (TreeIter) parent [mr.Name];
							TreeIter root;
							object name, value;
							GLib.Value image = new Value ();

							name = store.GetValue (orig, 0);
							value = store.GetValue (orig, 1);
							store.GetValue (orig, 2, image);
							store.Remove (out orig);

							store.Append (out root);
							store.SetValue (root, 0, new GLib.Value (mr.Name));
							store.SetValue (root, 1, new GLib.Value (mr.Name + " (2)"));

							parent [mr.Name] = root;

							store.Append (out orig, root);
							store.SetValue (orig, 0, name);
							store.SetValue (orig, 1, value);
							store.SetValue (orig, 2, image);

							store.Append (out iter, root);
							memberRecords [orig] = memberRecords [root];
							memberRecords [root] = null;
						} else {
							//Console.WriteLine ("4");
							store.Append (out iter, (TreeIter) parent [mr.Name]);
							store.SetValue ((TreeIter) parent [mr.Name], 0, new GLib.Value (mr.Name));
							store.SetValue ((TreeIter) parent [mr.Name], 1, new GLib.Value (mr.Name
															+ " (" + ((int) count [mr.Name] + 1) + ")"));
						}
						
						count [mr.Name] = 1 + (int) count [mr.Name];

					} else {
						store.Append (out iter);
						count [mr.Name] = 1;
						parent [mr.Name] = iter;
					}

					memberRecords [iter] = mr;
					store.SetValue (iter, 0, mr.Name);
					store.SetValue (iter, 1, mr.Label);
					store.SetValue (iter, 2, mr.Icon);
				}
			}
		}
开发者ID:emtees,项目名称:old-code,代码行数:58,代码来源:MemberView.cs

示例4: TagByIter

	public Tag TagByIter (TreeIter iter)
	{
		GLib.Value val = new GLib.Value ();
 
		Model.GetValue (iter, IdColumn, ref val);
		uint tag_id = (uint) val;
 
		return tag_store.Get (tag_id) as Tag;
 	}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:9,代码来源:TagSelectionWidget.cs

示例5: GetCollectionAtPathString

	public string GetCollectionAtPathString (string str_path)
	{
		Gtk.TreeIter iter = new Gtk.TreeIter ();

		if (!this.GetIterFromString (out iter, str_path)) {
			Console.WriteLine ("Spurious NameEditedHandler for unknown path " + str_path);
			return null;
		}

		GLib.Value gval = new GLib.Value ();
		this.GetValue (iter, (int) ColNames.InternalIDCol, ref gval);
		return (string) gval;
	}
开发者ID:emtees,项目名称:old-code,代码行数:13,代码来源:CollectionsTreeStore.cs

示例6: PropertyInfo

        public PropertyInfo(IntPtr pspec_ptr)
        {
            GParamSpec pspec = (GParamSpec) Marshal.PtrToStructure (pspec_ptr, typeof (GParamSpec));
              IntPtr name = g_param_spec_get_name (pspec_ptr);
              IntPtr nick = g_param_spec_get_nick (pspec_ptr);
              IntPtr blurb = g_param_spec_get_blurb (pspec_ptr);

              this.name = GLib.Marshaller.Utf8PtrToString (name);
              this.nick = GLib.Marshaller.Utf8PtrToString (nick);
              this.blurb = GLib.Marshaller.Utf8PtrToString (blurb);

              this.readable = ( (pspec.Flags & (1 << 0)) != 0);
              this.writeable = ( (pspec.Flags & (1 << 1)) != 0);
              this.controllable = ( (pspec.Flags & (1 << 9)) != 0);
              /* TODO: Add more flags later, like the mutable flags */

              this.gtype = new GLib.GType (pspec.ValueType);
              this.type = (System.Type) this.gtype;

              this.dflt = this.min = this.max = null;

              try {
            GLib.Value v = new GLib.Value (new GLib.GType (pspec.ValueType));
            g_param_value_set_default (pspec_ptr, ref v);
            this.dflt = v.Val;
            v.Dispose ();

            if (EnumInfo.IsEnumType (this.gtype)) {
              EnumInfo ei = new EnumInfo (this.gtype);
              this.min = ei.Min;
              this.max = ei.Max;
            } else {
              GLib.Value min = new GLib.Value (new GLib.GType (pspec.ValueType));
              GLib.Value max = new GLib.Value (new GLib.GType (pspec.ValueType));
              if (gstsharp_g_param_spec_get_range (pspec_ptr, ref min, ref max)) {
            this.min = (object) min.Val;
            this.max = (object) max.Val;
              }
              min.Dispose ();
              max.Dispose ();
            }
              } catch (Exception) {}
        }
开发者ID:Forage,项目名称:gstreamer-sharp,代码行数:43,代码来源:PropertyInfo.cs

示例7: HandleSend

    protected void HandleSend(object sender, EventArgs e)
    {
        if (txtRecipient.ActiveText == "all") {

            Gtk.TreeIter iter;
            if (txtRecipient.Model.GetIterFirst (out iter)) {
                do {
                    GLib.Value thisRow = new GLib.Value ();
                    txtRecipient.Model.GetValue (iter, 0, ref thisRow);
                    string recipient = (thisRow.Val as string);
                    Send (recipient, txtSubject.Text, txtMessage.Text);
                } while (txtRecipient.Model.IterNext (ref iter));
            }

        } else {

            Send (txtRecipient.ActiveText, txtSubject.Text, txtMessage.Text);

            bool conflict = false;
            Gtk.TreeIter iter;
            if (txtRecipient.Model.GetIterFirst (out iter)) {
                do {
                    GLib.Value thisRow = new GLib.Value ();
                    txtRecipient.Model.GetValue (iter, 0, ref thisRow);
                    if ((thisRow.Val as string).Equals (txtRecipient.ActiveText)) {
                        conflict = true;
                        break;
                    }
                } while (txtRecipient.Model.IterNext (ref iter));
            }
            if (!conflict) {
                txtRecipient.AppendText (txtRecipient.ActiveText);
            }

        }
        txtMessage.Text = "";
    }
开发者ID:SirJonthe,项目名称:KodIM,代码行数:37,代码来源:MainWindow.cs

示例8: SetPathDef

 public void SetPathDef(CanvasPathDef path_def)
 {
     GLib.Value val = new GLib.Value(path_def, "GnomeCanvasPathDef");
     SetProperty("bpath", val);
 }
开发者ID:schani,项目名称:bwprocessor,代码行数:5,代码来源:CurveWidget.cs

示例9: SetGValue

 public void SetGValue(ref GLib.Value val)
 {
     GLib.Value min = new GLib.Value (Min);
     GLib.Value max = new GLib.Value (Max);
     gst_value_set_fraction_range (ref val, ref min, ref max);
     min.Dispose ();
     max.Dispose ();
 }
开发者ID:GStreamer,项目名称:gstreamer-sharp,代码行数:8,代码来源:Value.cs

示例10: g_value_get_flags

		static extern uint g_value_get_flags (ref Value val);
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:1,代码来源:Value.cs

示例11: g_value_get_uint

		static extern uint g_value_get_uint (ref Value val);
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:1,代码来源:Value.cs

示例12: g_value_get_pointer

		static extern IntPtr g_value_get_pointer (ref Value val);
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:1,代码来源:Value.cs

示例13: g_value_get_object

		static extern IntPtr g_value_get_object (ref Value val);
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:1,代码来源:Value.cs

示例14: g_value_set_flags

		static extern void g_value_set_flags (ref Value val, uint data);
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:1,代码来源:Value.cs

示例15: g_value_set_enum

		static extern void g_value_set_enum (ref Value val, int data);
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:1,代码来源:Value.cs


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