private void InnerSave() { if (maximized) { MaximizedSchema.Set(true); return; } if (x < 0 || y < 0 || width <= 0 || height <= 0) { return; } MaximizedSchema.Set(false); XPosSchema.Set(x); YPosSchema.Set(y); WidthSchema.Set(width); HeightSchema.Set(height); }
public void Restore() { if ((options & WindowPersistOptions.Size) != 0) { int width = WidthSchema.Get(); int height = HeightSchema.Get(); if (width != 0 && height != 0) { window.Resize(width, height); } } if ((options & WindowPersistOptions.Position) != 0) { int x = XPosSchema.Get(); int y = YPosSchema.Get(); if (x == 0 && y == 0) { window.SetPosition(Gtk.WindowPosition.Center); } else { window.Move(x, y); } } if ((options & WindowPersistOptions.Size) != 0) { if (MaximizedSchema.Get()) { window.Maximize(); } else { window.Unmaximize(); } } }