Example #1
0
 public ConversationController(IContainer container, Model m)
 {
     windowController = container.Resolve<PopupWindowController>();
     model = m;
     this.container = container;
     uiConversations = new SafeObservingCollection<Conversation>(conversations);
     uiConversations.CollectionChanged += uiConversations_CollectionChanged;
     windowController.OnTabClosing += chatPopupController_OnTabClosing;
 }
Example #2
0
 public ConversationController(IContainer container, Model m)
 {
     windowController = container.Resolve <PopupWindowController>();
     model            = m;
     this.container   = container;
     uiConversations  = new SafeObservingCollection <Conversation>(conversations);
     uiConversations.CollectionChanged += uiConversations_CollectionChanged;
     windowController.OnTabClosing     += chatPopupController_OnTabClosing;
 }
Example #3
0
        public bool Load(bool server)
        {
            model.Load();
            model.LocalNode.Host = interfaceController.CheckAddress(model.LocalNode.Host);
            //User chose to quit rather than select an interface =s
            if (string.IsNullOrEmpty(model.LocalNode.Host))
                return false;

            model.CheckSetDefaults();

            updateChecker.Run();

            //Immediatly send model upates
            model.LocalNode.PropertyChanged += LocalNode_PropertyChanged;

            if (!server)
            {
                //Register FAP protocol
                string location = Assembly.GetCallingAssembly().Location;
                registerProtocolService.Register("fap", location, "-url \"%1\"");

                //Delete any empty folders in the incomplete folder
                RemoveEmptyFolders(model.IncompleteFolder);
                LogManager.GetLogger("faplog").Debug("Client started with ID: {0}", model.LocalNode.ID);

                model.DownloadQueue.Load();

                shareInfo = container.Resolve<ShareInfoService>();
                shareInfo.Load();

                shareController = new SharesController(container, model);
                shareController.Initalise();
                popupController = container.Resolve<PopupWindowController>();
                conversationController = (ConversationController) container.Resolve<IConversationController>();
                watchdogController = container.Resolve<WatchdogController>();
                watchdogController.Start();

                if (!model.DisplayedHelp)
                    ShowQuickStart();
            }
            return true;
        }