Represents a document that can be printed
Constructors
Fields
Properties
Remarks: This can sometimes be useful to get the platform-specific object. Some handlers may not have any backing object for its functionality, so this may be null. It is more preferred to use the Widget.Handler and cast that to the platform-specific handler class which can give you additional methods and helpers to do common tasks. For example, the Application object's handler for OS X has a AddFullScreenMenuItem property to specify if you want full screen support in your app.
IsDisposed
Gets or sets a value indicating whether this Widget has been disposed.
Remarks: When the widget is disposed, it can no longer be used.
Value:
true if this instance has been disposed; otherwise, false.Name
#Gets or sets the name of the document to show in the printer queue
Value: The name of the document
NativeHandle
public nint NativeHandle { get; }
Gets the native platform-specific handle for integration purposes
Value: The native handle.
PageCount
#Gets or sets the total number of pages available to be printed in this document.
Remarks: This must be set to the number of pages your document contains before printing or showing the print dialog.
Value: The page count.
inherited fromWidget
Remarks: This gets set to the current Platform.Instance during the construction of the object
PrintSettings
#Gets or sets the print settings for the document when printing.
Remarks: You can adjust the settings using the PrintDialog, or use PrintDialog.ShowDialog(Control, PrintDocument) to allow the user to adjust the settings before printing.
Value: The print settings.
Remarks: Styles allow you to attach custom platform-specific logic to a widget. In your platform-specific assembly, use Add{H} to add the style logic with the same id.
Example:
// in your UI
var control = new Button { Style = "mystyle" };
// in your platform assembly
using Eto.Mac.Forms.Controls;
Styles.AddHandler<ButtonHandler>("mystyle", handler => {
// this is where you can use handler.Control to set properties, handle events, etc.
handler.Control.BezelStyle = NSBezelStyle.SmallSquare;
});Methods
Dispose
public void Dispose()
Disposes of this widget, supressing the finalizer
Parameters:
| disposing (bool) | True if the caller called Widget.Dispose() manually, false if being called from a finalizer |
GetCallback
#Gets an instance of an object used to perform callbacks to the widget from handler implementations
Returns: The callback instance to use for this widget
Overrides: Widget.GetCallback
Initialize
protected void Initialize()
Initializes the widget handler
Remarks: This is typically called from the constructor after all of the logic is completed to construct the object. If your handler interface has the AutoInitializeAttribute set to false, then you are responsible for calling this method in your constructor after calling the creation method on your custom handler.
inherited fromWidget
public void Print()
Prints this document immediately using the current PrintSettings
Remarks: This skips the print dialog, so if you want the user to adjust settings before printing, use PrintDialog.ShowDialog(Control, PrintDocument).
ToString
Gets a string that represents the current object with its ID if specified.
Returns: A string value indicating the type and ID (if specified) of this widget.
Overrides: Object.ToString
Events
inherited fromWidget