Beispiel #1
0
        public override NSObject GetObjectValue(NSTableView tableView,
                                                NSTableColumn tableColumn,
                                                int row)
        {
            TableRoutingControllerItem i = Items [row];

            if (tableColumn.Identifier == "Icon")
            {
                if (i.Icon == "in")
                {
                    return(NSImage.ImageNamed("routes_in.png"));
                }
                else
                {
                    return(NSImage.ImageNamed("routes_out.png"));
                }
            }
            else if (tableColumn.Identifier == "Ip")
            {
                return(new NSString(i.Ip));
            }
            else if (tableColumn.Identifier == "Action")
            {
                return(new NSString(WindowPreferencesController.RouteDirectionToDescription(i.Action)));
            }
            else if (tableColumn.Identifier == "Notes")
            {
                return(new NSString(i.Notes));
            }
            else
            {
                throw new NotImplementedException(string.Format("{0} is not recognized", tableColumn.Identifier));
            }
        }
Beispiel #2
0
 public void ShowPreferences()
 {
     if ((windowPreferences == null) || (windowPreferences.Window.IsVisible == false))
     {
         windowPreferences = new WindowPreferencesController();
     }
     GuiUtils.ShowWindowWithFocus(windowPreferences, this);
 }
Beispiel #3
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            Window.Title = Constants.Name + " - " + Messages.WindowsSettingsRouteTitle;

            LblHelp.StringValue = Messages.WindowsSettingsRouteTitle;

            CboAction.RemoveAllItems();
            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();
        }
 public TableAdvancedEventsDelegate(WindowPreferencesController main)
 {
     m_main = main;
 }
Beispiel #5
0
 public TableRoutingDelegate(WindowPreferencesController main)
 {
     m_main = main;
 }
 public TableProtocolsDelegate(WindowPreferencesController main)
 {
     m_main = main;
 }
Beispiel #7
0
 public TableDnsServersDelegate(WindowPreferencesController main)
 {
     m_main = main;
 }