Exemplo n.º 1
0
        public static ConnectionController Instance(WindowController parent)
        {
            ConnectionController c;

            if (!Controllers.TryGetValue(parent, out c))
            {
                c = new ConnectionController(new Host(
                                                 ProtocolFactory.forName(PreferencesFactory.get().getProperty("connection.protocol.default")),
                                                 PreferencesFactory.get().getProperty("connection.hostname.default"),
                                                 PreferencesFactory.get().getInteger("connection.port.default")));
                Controllers.Add(parent, c);
                parent.View.ViewClosedEvent += delegate
                {
                    Controllers.Remove(parent);
                    c.View.Close();
                };
            }
            return(c);
        }