예제 #1
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);
        }