Exemplo n.º 1
0
        public MainForm(Controller controller, Header header, SubscriptionInfoBar subscriptionInfoBar)
        {
            InitializeComponent();
            
            Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);

            _controller = controller;
            _header = header;
            _subscriptionInfoBar = subscriptionInfoBar;

            panelHeaderContainer.Controls.Add(_header);
            panelSubscriptionInfoBar.Controls.Add(_subscriptionInfoBar);
        }
Exemplo n.º 2
0
        public Controller()
        {
            _header = new Header(this);
            _homePage = new HomePage(this);
            _subscriptionInfoBar = new SubscriptionInfoBar(this);
            _mainForm = new MainForm(this, _header, _subscriptionInfoBar);

            //SyncAccounts();

            var serverAccounts = Model.ServerAccounts.Find(new ServerAccount());
            foreach (var serverAccount in serverAccounts)
            {
                _syncServers.Add(serverAccount.Id, new Sync(this, serverAccount.Id));
                _syncServers[serverAccount.Id].Start();
            }

            var managementAccount = Model.ServerManagementAccounts.Find(new ServerManagementAccount()).FirstOrDefault();
            if (managementAccount != null)
            {
                _syncManagement = new SyncManagement(this, managementAccount.Id);
                _syncManagement.Start();
            }
        }