// Custom UIPrintPageRenderer's may override this class to draw a custom print page header. // To illustrate that, this class sets the date in the header. public override void DrawHeaderForPage(int index, RectangleF headerRect) { NSDateFormatter dateFormatter = new NSDateFormatter(); dateFormatter.DateFormat = "MMMM d, yyyy 'at' h:mm a"; NSString dateString = new NSString(dateFormatter.ToString(NSDate.Now)); dateFormatter.Dispose(); dateString.DrawString(headerRect, SystemFont, UILineBreakMode.Clip, UITextAlignment.Right); dateString.Dispose(); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { fmt.Dispose(); fmt = null; if (DatePicker != null) { DatePicker.Dispose(); DatePicker = null; } } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (fmt != null) { fmt.Dispose(); fmt = null; } if (datePicker != null) { datePicker.Dispose(); datePicker = null; } } }
// Custom UIPrintPageRenderer's may override this class to draw a custom print page header. // To illustrate that, this class sets the date in the header. public override void DrawHeaderForPage (int index, RectangleF headerRect) { NSDateFormatter dateFormatter = new NSDateFormatter (); dateFormatter.DateFormat = "MMMM d, yyyy 'at' h:mm a"; NSString dateString = new NSString (dateFormatter.ToString (NSDate.Now)); dateFormatter.Dispose (); dateString.DrawString (headerRect, SystemFont, UILineBreakMode.Clip, UITextAlignment.Right); dateString.Dispose (); }