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


C# Gtk.Destroy方法代码示例

本文整理汇总了C#中Gtk.Destroy方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Destroy方法的具体用法?C# Gtk.Destroy怎么用?C# Gtk.Destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk的用法示例。


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

示例1: GrabWindow

        public static void GrabWindow( Gtk.Window window )
        {
            window.GrabFocus();

            Grab.Add(window);

            Gdk.GrabStatus grabbed   = Gdk.Pointer.Grab(window.GdkWindow, true,
                                        Gdk.EventMask.ButtonPressMask
                                        | Gdk.EventMask.ButtonReleaseMask
                                        | Gdk.EventMask.PointerMotionMask, null, null, CURRENT_TIME);

            if (grabbed == Gdk.GrabStatus.Success)
            {
                grabbed = Gdk.Keyboard.Grab(window.GdkWindow, true, CURRENT_TIME);

                if (grabbed != Gdk.GrabStatus.Success)
                {
                    Grab.Remove(window);
                    window.Destroy();
                }
            }
            else
            {
                Grab.Remove(window);
                window.Destroy();
            }
        }
开发者ID:tizianomanni,项目名称:holly-gtk-widgets,代码行数:27,代码来源:GrabUtil.cs

示例2: ShowCustomDialog

		public static int ShowCustomDialog (Gtk.Dialog dialog, Gtk.Window parent)
		{
			try {
				return RunCustomDialog (dialog, parent);
			} finally {
				if (dialog != null)
					dialog.Destroy ();
			}
		}
开发者ID:m13253,项目名称:xwt,代码行数:9,代码来源:MessageService.cs

示例3: Fade

 public static void Fade(Gtk.Window w)
 {
     //Fadein (w);
     //Thread.Sleep (5000);
     //Fadeout (w);
     //w.HideAll ();
     //w.Destroy ();
     Thread th = new Thread (delegate() {
         Thread.Sleep(5000);
         w.HideAll ();
         w.Destroy ();
     });
     th.Start ();
 }
开发者ID:niwakazoider,项目名称:unicast,代码行数:14,代码来源:WindowController.cs

示例4: PopulateFixes

		public void PopulateFixes (Gtk.Menu menu, ref int items)
		{
			int mnemonic = 1;
			bool gotImportantFix = false, addedSeparator = false;
			var fixesAdded = new List<string> ();
			foreach (var fix_ in Fixes.OrderByDescending (i => Tuple.Create (IsAnalysisOrErrorFix(i), (int)i.Severity, GetUsage (i.IdString)))) {
				// filter out code actions that are already resolutions of a code issue
				if (fixesAdded.Any (f => fix_.IdString.IndexOf (f, StringComparison.Ordinal) >= 0))
					continue;
				fixesAdded.Add (fix_.IdString);
				if (IsAnalysisOrErrorFix (fix_))
					gotImportantFix = true;
				if (!addedSeparator && gotImportantFix && !IsAnalysisOrErrorFix(fix_)) {
					menu.Add (new Gtk.SeparatorMenuItem ());
					addedSeparator = true;
				}

				var fix = fix_;
				var escapedLabel = fix.Title.Replace ("_", "__");
				var label = (mnemonic <= 10)
					? "_" + (mnemonic++ % 10).ToString () + " " + escapedLabel
					: "  " + escapedLabel;
				var thisInstanceMenuItem = new MenuItem (label);
				thisInstanceMenuItem.Activated += new ContextActionRunner (fix, document, currentSmartTagBegin).Run;
				thisInstanceMenuItem.Activated += delegate {
					ConfirmUsage (fix.IdString);
					menu.Destroy ();
				};
				menu.Add (thisInstanceMenuItem);
				items++;
			}

			bool first = true;
			var settingsMenuFixes = Fixes
				.OfType<AnalysisContextActionProvider.AnalysisCodeAction> ()
				.Where (f => f.Result is InspectorResults)
				.GroupBy (f => ((InspectorResults)f.Result).Inspector);
			foreach (var analysisFixGroup_ in settingsMenuFixes) {
				var analysisFixGroup = analysisFixGroup_;
				var arbitraryFixInGroup = analysisFixGroup.First ();
				var ir = (InspectorResults)arbitraryFixInGroup.Result;

				if (first) {
					menu.Add (new Gtk.SeparatorMenuItem ());
					first = false;
				}

				var subMenu = new Gtk.Menu ();
				foreach (var analysisFix_ in analysisFixGroup) {
					var analysisFix = analysisFix_;
					if (analysisFix.SupportsBatchRunning) {
						var batchRunMenuItem = new Gtk.MenuItem (string.Format (GettextCatalog.GetString ("Apply in file: {0}"), analysisFix.Title));
						batchRunMenuItem.Activated += delegate {
							ConfirmUsage (analysisFix.IdString);
							menu.Destroy ();
						};
						batchRunMenuItem.Activated += new ContextActionRunner (analysisFix, document, this.currentSmartTagBegin).BatchRun;
						subMenu.Add (batchRunMenuItem);
						subMenu.Add (new Gtk.SeparatorMenuItem ());
					}
				}

				var inspector = ir.Inspector;
				if (inspector.CanSuppressWithAttribute) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Suppress with attribute"));
					menuItem.Activated += delegate {
						inspector.SuppressWithAttribute (document, arbitraryFixInGroup.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableWithPragma) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Suppress with #pragma"));
					menuItem.Activated += delegate {
						inspector.DisableWithPragma (document, arbitraryFixInGroup.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableOnce) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Disable Once"));
					menuItem.Activated += delegate {
						inspector.DisableOnce (document, arbitraryFixInGroup.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableAndRestore) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("Disable _and Restore"));
					menuItem.Activated += delegate {
						inspector.DisableAndRestore (document, arbitraryFixInGroup.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}
				var label = GettextCatalog.GetString ("_Options for \"{0}\"", InspectorResults.GetTitle (ir.Inspector));
				var subMenuItem = new Gtk.MenuItem (label);

				var optionsMenuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Configure Rule"));
				optionsMenuItem.Activated += arbitraryFixInGroup.ShowOptions;

//.........这里部分代码省略.........
开发者ID:vitorelli,项目名称:monodevelop,代码行数:101,代码来源:CodeActionEditorExtension.cs

示例5: PopulateFixes

		public void PopulateFixes (Gtk.Menu menu)
		{
			int mnemonic = 1;
			foreach (var fix_ in fixes.OrderByDescending (i => GetUsage (i.IdString))) {
				var fix = fix_;
				var escapedLabel = fix.Title.Replace ("_", "__");
				var label = (mnemonic <= 10)
						? "_" + (mnemonic++ % 10).ToString () + " " + escapedLabel
						: "  " + escapedLabel;
				var menuItem = new Gtk.MenuItem (label);
				menuItem.Activated += new ContextActionRunner (fix, document, loc).Run;
				menuItem.Activated += delegate {
					ConfirmUsage (fix.IdString);
					menu.Destroy ();
				};
				menu.Add (menuItem);
			}
			var first = true;
			var alreadyInserted = new HashSet<CodeIssueProvider> ();
			foreach (var analysisFix_ in fixes.OfType <AnalysisContextActionProvider.AnalysisCodeAction>().Where (f => f.Result is InspectorResults)) {
				var analysisFix = analysisFix_;
				var ir = analysisFix.Result as InspectorResults;
				if (ir == null)
					continue;
			
				if (first) {
					menu.Add (new Gtk.SeparatorMenuItem ());
					first = false;
				}
				if (alreadyInserted.Contains (ir.Inspector))
					continue;
				alreadyInserted.Add (ir.Inspector);
			
				var label = GettextCatalog.GetString ("_Inspection options for \"{0}\"", ir.Inspector.Title);
				var menuItem = new Gtk.MenuItem (label);
				menuItem.Activated += analysisFix.ShowOptions;
				menuItem.Activated += delegate {
					menu.Destroy ();
				};
				menu.Add (menuItem);
			}

		}
开发者ID:gary-b,项目名称:monodevelop,代码行数:43,代码来源:CodeActionWidget.cs

示例6: PopulateFixes

		public void PopulateFixes (Gtk.Menu menu, ref int items)
		{
			int mnemonic = 1;
			foreach (var fix_ in fixes.OrderByDescending (i => GetUsage (i.IdString))) {
				var fix = fix_;
				var escapedLabel = fix.Title.Replace ("_", "__");
				var label = (mnemonic <= 10)
					? "_" + (mnemonic++ % 10).ToString () + " " + escapedLabel
						: "  " + escapedLabel;
				var menuItem = new Gtk.MenuItem (label);
				menuItem.Activated += new ContextActionRunner (fix, document, loc).Run;
				menuItem.Activated += delegate {
					ConfirmUsage (fix.IdString);
					menu.Destroy ();
				};
				menu.Add (menuItem);
				items++;
			}
			var first = true;
			var alreadyInserted = new HashSet<CodeIssueProvider> ();
			foreach (var analysisFix_ in fixes.OfType <AnalysisContextActionProvider.AnalysisCodeAction>().Where (f => f.Result is InspectorResults)) {
				var analysisFix = analysisFix_;
				var ir = analysisFix.Result as InspectorResults;
				if (ir == null)
					continue;
			
				if (first) {
					menu.Add (new Gtk.SeparatorMenuItem ());
					first = false;
				}
				if (alreadyInserted.Contains (ir.Inspector))
					continue;
				alreadyInserted.Add (ir.Inspector);
				
				var label = GettextCatalog.GetString ("_Inspection options for \"{0}\"", ir.Inspector.Title);
				var menuItem = new Gtk.MenuItem (label);
				menuItem.Activated += analysisFix.ShowOptions;
				menuItem.Activated += delegate {
					menu.Destroy ();
				};
				menu.Add (menuItem);
				items++;
			}

			foreach (var fix_ in fixes.Where (f => f.BoundToIssue != null)) {
				var fix = fix_;
				foreach (var inspector_ in RefactoringService.GetInspectors (document.Editor.MimeType).Where (i => i.GetSeverity () != ICSharpCode.NRefactory.CSharp.Severity.None)) {
					var inspector = inspector_;

					if (inspector.IdString.IndexOf (fix.BoundToIssue.FullName, StringComparison.Ordinal) < 0)
						continue;
					if (first) {
						menu.Add (new Gtk.SeparatorMenuItem ());
						first = false;
					}
					if (alreadyInserted.Contains (inspector))
						continue;
					alreadyInserted.Add (inspector);
					
					var label = GettextCatalog.GetString ("_Inspection options for \"{0}\"", inspector.Title);
					var menuItem = new Gtk.MenuItem (label);
					menuItem.Activated += delegate {
						MessageService.RunCustomDialog (new CodeIssueOptionsDialog (inspector), MessageService.RootWindow);
						menu.Destroy ();
					};
					menu.Add (menuItem);
					break;
				}

				items++;
			}
		}
开发者ID:pvergara,项目名称:monodevelop,代码行数:72,代码来源:CodeActionWidget.cs

示例7: Destroy

        public static void Destroy(ref Gtk.Window window)
        {
            #if DEBUG
            Console.WriteLine("Window.Destroy");
            #endif
            if (window == null)
                return;

            if (window == Variables.Window.splash)
            {
                int counterIndex = (int)CounterType.COUNT_HINT_NUMBER;
                Variables.Counters[counterIndex] = (Variables.Counters[counterIndex] + 1) % Variables.hints.list.Count;
                SplashWindow.SaveHintNumber();
            }

            window.Destroy();
            window = null;
        }
开发者ID:kashifsoofi,项目名称:bygfoot,代码行数:18,代码来源:Window.cs

示例8: Drop

		public virtual void Drop (Gtk.Widget widget, object faultId)
		{
			widget.Destroy ();
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:Widget.cs

示例9: ReplaceChild

		internal protected void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild, bool destroyOld)
		{
			ReplaceChild (oldChild, newChild);
			if (destroyOld)
				oldChild.Destroy ();
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:6,代码来源:Container.cs

示例10: Logout

		static void Logout (object sender, EventArgs e, ref Gtk.Window window)
		{
			window.Destroy ();
			Settings.SetSettings ("", "");
			LoginRequest ();
		}
开发者ID:takoyaki-hunter,项目名称:niconama-feeder,代码行数:6,代码来源:Program.cs

示例11: PopulateFixes

		public void PopulateFixes (Gtk.Menu menu, ref int items)
		{
			int mnemonic = 1;
			bool gotImportantFix = false, addedSeparator = false;
			var fixesAdded = new List<string> ();
			foreach (var fix_ in fixes.OrderByDescending (i => Tuple.Create (IsAnalysisOrErrorFix(i), (int)i.Severity, GetUsage (i.IdString)))) {
				// filter out code actions that are already resolutions of a code issue
				if (fixesAdded.Any (f => fix_.IdString.IndexOf (f, StringComparison.Ordinal) >= 0))
					continue;
				fixesAdded.Add (fix_.IdString);
				if (IsAnalysisOrErrorFix (fix_))
					gotImportantFix = true;
				if (!addedSeparator && gotImportantFix && !IsAnalysisOrErrorFix(fix_)) {
					menu.Add (new Gtk.SeparatorMenuItem ());
					addedSeparator = true;
				}

				var fix = fix_;
				var escapedLabel = fix.Title.Replace ("_", "__");
				var label = (mnemonic <= 10)
					? "_" + (mnemonic++ % 10).ToString () + " " + escapedLabel
						: "  " + escapedLabel;
				var thisInstanceMenuItem = new Gtk.MenuItem (label);
				thisInstanceMenuItem.Activated += new ContextActionRunner (fix, document, loc).Run;
				thisInstanceMenuItem.Activated += delegate {
					ConfirmUsage (fix.IdString);
					menu.Destroy ();
				};
				menu.Add (thisInstanceMenuItem);
				items++;
			}

			bool first = true;
			var alreadyInserted = new HashSet<BaseCodeIssueProvider> ();
			foreach (var analysisFix_ in fixes.OfType <AnalysisContextActionProvider.AnalysisCodeAction>().Where (f => f.Result is InspectorResults)) {
				var analysisFix = analysisFix_;
				var ir = analysisFix.Result as InspectorResults;
				if (ir == null)
					continue;
			
				if (first) {
					menu.Add (new Gtk.SeparatorMenuItem ());
					first = false;
				}
				if (alreadyInserted.Contains (ir.Inspector))
					continue;
				alreadyInserted.Add (ir.Inspector);

				var subMenu = new Gtk.Menu ();
				if (analysisFix.SupportsBatchRunning) {
					var batchRunMenuItem = new Gtk.MenuItem (GettextCatalog.GetString ("Fix all in this file"));
					batchRunMenuItem.Activated += delegate {
						ConfirmUsage (analysisFix.IdString);
						menu.Destroy ();
					};
					batchRunMenuItem.Activated += new ContextActionRunner (analysisFix, document, loc).BatchRun;
					subMenu.Add (batchRunMenuItem);
					subMenu.Add (new Gtk.SeparatorMenuItem ());
				}

				var inspector = ir.Inspector;
				if (inspector.CanSuppressWithAttribute) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Suppress with attribute"));
					menuItem.Activated += delegate {
						inspector.SuppressWithAttribute (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableWithPragma) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Suppress with #pragma"));
					menuItem.Activated += delegate {
						inspector.DisableWithPragma (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableOnce) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Disable once with comment"));
					menuItem.Activated += delegate {
						inspector.DisableOnce (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableAndRestore) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("Disable _and restore with comments"));
					menuItem.Activated += delegate {
						inspector.DisableAndRestore (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}
				var label = GettextCatalog.GetString ("_Options for \"{0}\"", InspectorResults.GetTitle (ir.Inspector));
				var subMenuItem = new Gtk.MenuItem (label);

				var optionsMenuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Configure inspection"));
				optionsMenuItem.Activated += analysisFix.ShowOptions;
				optionsMenuItem.Activated += delegate {
					menu.Destroy ();
				};
//.........这里部分代码省略.........
开发者ID:pavlos256,项目名称:monodevelop,代码行数:101,代码来源:CodeActionWidget.cs

示例12: PopulateFixes

		public void PopulateFixes (Gtk.Menu menu, ref int items)
		{
			int mnemonic = 1;
			foreach (var fix_ in fixes.OrderByDescending (i => GetUsage (i.IdString))) {
				var fix = fix_;
				var escapedLabel = fix.Title.Replace ("_", "__");
				var label = (mnemonic <= 10)
					? "_" + (mnemonic++ % 10).ToString () + " " + escapedLabel
						: "  " + escapedLabel;
				var thisInstanceMenuItem = new Gtk.MenuItem (label);
				thisInstanceMenuItem.Activated += new ContextActionRunner (fix, document, loc).Run;
				thisInstanceMenuItem.Activated += delegate {
					ConfirmUsage (fix.IdString);
					menu.Destroy ();
				};
				menu.Add (thisInstanceMenuItem);
				items++;
			}
			var first = true;
			var alreadyInserted = new HashSet<BaseCodeIssueProvider> ();
			foreach (var analysisFix_ in fixes.OfType <AnalysisContextActionProvider.AnalysisCodeAction>().Where (f => f.Result is InspectorResults)) {
				var analysisFix = analysisFix_;
				var ir = analysisFix.Result as InspectorResults;
				if (ir == null)
					continue;
			
				if (first) {
					menu.Add (new Gtk.SeparatorMenuItem ());
					first = false;
				}
				if (alreadyInserted.Contains (ir.Inspector))
					continue;
				alreadyInserted.Add (ir.Inspector);

				var subMenu = new Gtk.Menu ();
				if (analysisFix.SupportsBatchRunning) {
					var batchRunMenuItem = new Gtk.MenuItem (GettextCatalog.GetString ("Fix all in this file"));
					batchRunMenuItem.Activated += delegate {
						ConfirmUsage (analysisFix.IdString);
						menu.Destroy ();
					};
					batchRunMenuItem.Activated += new ContextActionRunner (analysisFix, document, loc).BatchRun;
					subMenu.Add (batchRunMenuItem);
					subMenu.Add (new Gtk.SeparatorMenuItem ());
				}

				var inspector = ir.Inspector;
				if (inspector.CanSuppressWithAttribute) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Suppress with attribute"));
					menuItem.Activated += delegate {
						inspector.SuppressWithAttribute (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableWithPragma) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Suppress with #pragma"));
					menuItem.Activated += delegate {
						inspector.DisableWithPragma (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableOnce) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Disable once with comment"));
					menuItem.Activated += delegate {
						inspector.DisableOnce (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableAndRestore) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("Disable _and restore with comments"));
					menuItem.Activated += delegate {
						inspector.DisableAndRestore (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}
				var label = GettextCatalog.GetString ("_Options for \"{0}\"", InspectorResults.GetTitle (ir.Inspector));
				var subMenuItem = new Gtk.MenuItem (label);

				var optionsMenuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Configure inspection severity"));
				optionsMenuItem.Activated += analysisFix.ShowOptions;
				optionsMenuItem.Activated += delegate {
					menu.Destroy ();
				};
				subMenu.Add (optionsMenuItem);
				subMenuItem.Submenu = subMenu;
				menu.Add (subMenuItem);
				items++;
			}

			foreach (var fix_ in fixes.Where (f => f.BoundToIssue != null)) {
				var fix = fix_;
				foreach (var inspector_ in RefactoringService.GetInspectors (document.Editor.MimeType).Where (i => i.GetSeverity () != Severity.None)) {
					var inspector = inspector_;

					if (inspector.IdString.IndexOf (fix.BoundToIssue.FullName, StringComparison.Ordinal) < 0)
						continue;
					if (first) {
//.........这里部分代码省略.........
开发者ID:jrhtcg,项目名称:monodevelop,代码行数:101,代码来源:CodeActionWidget.cs

示例13: OnDestroyWidget

		protected virtual void OnDestroyWidget (Gtk.Widget w) { w.Destroy (); }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:1,代码来源:PluggableWidget.cs


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