C# Class SourceWriter.AppDelegate

Datei anzeigen Open project: xamarin/mac-samples

Private Properties

Property Type Description
OpenDialog void
OpenFile bool
ReleaseDesignerOutlets void

Public Methods

Method Description
AppDelegate ( ) : AppKit

Initializes a new instance of the SourceWriter.AppDelegate class.

ApplicationShouldTerminate ( NSApplication sender ) : NSApplicationTerminateReply

Called before the app terminates to allow the app to cancel the termination based on state, such as a file not being saved.

For more details, see: https://developer.xamarin.com/guides/mac/user-interface/working-with-windows/#Modified_Windows_Content

DidFinishLaunching ( NSNotification notification ) : void

Called when the app has finished lanuching.

This routine is manually taking control of the Format Menu. For more information, please see our Enabling and Disabling Menus and Items documentation: https://developer.xamarin.com/guides/mac/user-interface/working-with-menus/#Enabling_and_Disabling_Menus_and_Items

OpenFile ( NSApplication sender, string filename ) : bool

This method is called when the user selects a file from the Open Recent menu item.

For more details, see: https://developer.xamarin.com/guides/mac/user-interface/working-with-menus/#Working_with_the_Open_Recent_Menu

UpdateWindowPreferences ( ) : void

For any open windows, redefine the language to pick up any changes to the user preferences and reformat all of the text in the document.

For more details, see: https://developer.xamarin.com/guides/mac/user-interface/working-with-dialogs/#Creating_a_Preferences_Dialog

WillTerminate ( NSNotification notification ) : void

Called before the app terminates to allow for cleanup such as saving files.

For more details, see: https://developer.xamarin.com/guides/mac/user-interface/working-with-windows/#Modified_Windows_Content

Private Methods

Method Description
OpenDialog ( NSObject sender ) : void
OpenFile ( NSUrl url ) : bool

Attempts to open the file at the specified URL. If the file is currently open in a window, that will be brought to the front and selected instead of opening another copy of the file.

ReleaseDesignerOutlets ( ) : void

Method Details

AppDelegate() public method

Initializes a new instance of the SourceWriter.AppDelegate class.
public AppDelegate ( ) : AppKit
return AppKit

ApplicationShouldTerminate() public method

Called before the app terminates to allow the app to cancel the termination based on state, such as a file not being saved.
For more details, see: https://developer.xamarin.com/guides/mac/user-interface/working-with-windows/#Modified_Windows_Content
public ApplicationShouldTerminate ( NSApplication sender ) : NSApplicationTerminateReply
sender NSApplication A pointer to the app.
return NSApplicationTerminateReply

DidFinishLaunching() public method

Called when the app has finished lanuching.
This routine is manually taking control of the Format Menu. For more information, please see our Enabling and Disabling Menus and Items documentation: https://developer.xamarin.com/guides/mac/user-interface/working-with-menus/#Enabling_and_Disabling_Menus_and_Items
public DidFinishLaunching ( NSNotification notification ) : void
notification NSNotification Information about the launch state.
return void

OpenFile() public method

This method is called when the user selects a file from the Open Recent menu item.
For more details, see: https://developer.xamarin.com/guides/mac/user-interface/working-with-menus/#Working_with_the_Open_Recent_Menu
public OpenFile ( NSApplication sender, string filename ) : bool
sender NSApplication A pointer to the app.
filename string The full path and filename of the file to open.
return bool

UpdateWindowPreferences() public method

For any open windows, redefine the language to pick up any changes to the user preferences and reformat all of the text in the document.
For more details, see: https://developer.xamarin.com/guides/mac/user-interface/working-with-dialogs/#Creating_a_Preferences_Dialog
public UpdateWindowPreferences ( ) : void
return void

WillTerminate() public method

Called before the app terminates to allow for cleanup such as saving files.
For more details, see: https://developer.xamarin.com/guides/mac/user-interface/working-with-windows/#Modified_Windows_Content
public WillTerminate ( NSNotification notification ) : void
notification NSNotification Information about the termination state.
return void