C# Класс SourceWriter.EditorWidowDelegate

Defines a delegate for handling events on our text editor window such as asking the user to save changes to a document before closing the window.
Please see our Modified Windows Content Docs for more info: https://developer.xamarin.com/guides/mac/user-interface/working-with-windows/#Modified_Windows_Content
Наследование: NSWindowDelegate
Показать файл Открыть проект

Открытые методы

Метод Описание
DidBecomeKey ( NSNotification notification ) : void

Called when the window gains focus and becomes the active window.

We are using this method to update the preview of the document and to populate the Formatting Menu with any extra commands from the document's AppKit.TextKit.Formatter.LanguageFormatter.

DidResignKey ( NSNotification notification ) : void

Called when the window loses focus and falls into the background.

We are using this method to remove any custom commands added to the Formatting Menu by the AppKit.TextKit.Formatter.LanguageFormatter.

EditorWidowDelegate ( NSWindow window ) : System

Initializes a new instance of the SourceWriter.EditorWidowDelegate class.

WindowShouldClose ( Foundation sender ) : bool

Called before an NSWindow is closed. If the contents of the window has changed and not been saved, display a dialog allowing the user to: a) Cancel the closing, b) Close without saving, c) Save the changes to the document.

Описание методов

DidBecomeKey() публичный Метод

Called when the window gains focus and becomes the active window.
We are using this method to update the preview of the document and to populate the Formatting Menu with any extra commands from the document's AppKit.TextKit.Formatter.LanguageFormatter.
public DidBecomeKey ( NSNotification notification ) : void
notification NSNotification Notification.
Результат void

DidResignKey() публичный Метод

Called when the window loses focus and falls into the background.
We are using this method to remove any custom commands added to the Formatting Menu by the AppKit.TextKit.Formatter.LanguageFormatter.
public DidResignKey ( NSNotification notification ) : void
notification NSNotification Notification.
Результат void

EditorWidowDelegate() публичный Метод

Initializes a new instance of the SourceWriter.EditorWidowDelegate class.
public EditorWidowDelegate ( NSWindow window ) : System
window NSWindow The NSWindow being managed by the NSWindowController this delegate /// is attached to.
Результат System

WindowShouldClose() публичный Метод

Called before an NSWindow is closed. If the contents of the window has changed and not been saved, display a dialog allowing the user to: a) Cancel the closing, b) Close without saving, c) Save the changes to the document.
public WindowShouldClose ( Foundation sender ) : bool
sender Foundation The NSWindowController calling this method.
Результат bool