public override void AwakeFromNib() { base.AwakeFromNib(); Window.Title = Constants.Name + " - " + LanguageManager.GetText("WindowsSettingsRouteTitle"); GuiUtils.SetButtonCancel(Window, CmdCancel); GuiUtils.SetButtonDefault(Window, CmdOk); LblHelp.StringValue = LanguageManager.GetText("WindowsSettingsRouteTitle"); CboAction.RemoveAllItems(); CboAction.AddItem(WindowPreferencesController.RouteDirectionToDescription("none")); CboAction.AddItem(WindowPreferencesController.RouteDirectionToDescription("in")); CboAction.AddItem(WindowPreferencesController.RouteDirectionToDescription("out")); TxtIP.Changed += (object sender, EventArgs e) => { EnableIde(); }; CmdOk.Activated += (object sender, EventArgs e) => { Accepted = true; Item.Ip = TxtIP.StringValue; Item.Action = WindowPreferencesController.RouteDescriptionToDirection(GuiUtils.GetSelected(CboAction)); Item.Icon = Item.Action; Item.Notes = TxtNotes.StringValue; Window.Close(); NSApplication.SharedApplication.StopModal(); }; CmdCancel.Activated += (object sender, EventArgs e) => { Accepted = false; Window.Close(); NSApplication.SharedApplication.StopModal(); }; TxtIP.StringValue = Item.Ip; GuiUtils.SetSelected(CboAction, WindowPreferencesController.RouteDirectionToDescription(Item.Action)); TxtNotes.StringValue = Item.Notes; EnableIde(); }
void ReleaseDesignerOutlets() { if (TxtIP != null) { TxtIP.Dispose(); TxtIP = null; } if (LblHelp != null) { LblHelp.Dispose(); LblHelp = null; } if (CboAction != null) { CboAction.Dispose(); CboAction = null; } if (TxtNotes != null) { TxtNotes.Dispose(); TxtNotes = null; } if (CmdOk != null) { CmdOk.Dispose(); CmdOk = null; } if (CmdCancel != null) { CmdCancel.Dispose(); CmdCancel = null; } }