コード例 #1
0
        void RouteEdit()
        {
            int i = TableRoutes.SelectedRow;

            if (i != -1)
            {
                TableRoutingControllerItem item = TableRoutingController.Items [i];

                WindowPreferencesRouteController.Item = item;
                WindowPreferencesRouteController dlg = new WindowPreferencesRouteController();
                dlg.Window.ReleasedWhenClosed = true;
                NSApplication.SharedApplication.RunModalForWindow(dlg.Window);
                dlg.Window.Close();

                TableRoutingController.RefreshUI();
                this.EnableIde();
            }
        }
コード例 #2
0
        void RouteAdd()
        {
            TableRoutingControllerItem item = new TableRoutingControllerItem();

            item.Ip     = "";
            item.Icon   = "out";
            item.Action = "out";
            item.Notes  = "";

            WindowPreferencesRouteController.Item = item;
            WindowPreferencesRouteController dlg = new WindowPreferencesRouteController();

            dlg.Window.ReleasedWhenClosed = true;
            NSApplication.SharedApplication.RunModalForWindow(dlg.Window);
            dlg.Window.Close();

            if (dlg.Accepted)
            {
                TableRoutingController.Items.Add(item);
                TableRoutingController.RefreshUI();
            }

            this.EnableIde();
        }