public ListenerService(IContainer c, bool _isServer) { container = c; http = c.Resolve<HTTPHandler>(); isServer = _isServer; model = container.Resolve<Model>(); }
public SharesController(IContainer c, Model m) { logger = LogManager.GetLogger("faplog"); model = m; container = c; scanner = c.Resolve<ShareInfoService>(); }
public WatchdogController(Model m, SharesController s, BufferService b, OverlordManagerService o) { model = m; shareController = s; bufferService = b; logger = LogManager.GetLogger("faplog"); overlordLauncherService = o; }
public HTTPHandler(ShareInfoService i, Model m, BufferService b, ServerUploadLimiterService u) { infoService = i; model = m; bufferService = b; uploadLimiter = u; AddDefaultMimeTypes(); }
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; }
public FAPClientHandler(Model m, ShareInfoService s, IConversationController c, BufferService b, ServerUploadLimiterService sl) { model = m; shareInfoService = s; chatController = c; bufferService = b; serverUploadLimiterService = sl; logger = LogManager.GetLogger("faplog"); }
public LogService(Model m) { LoggingConfiguration config = LogManager.Configuration; target = new LogServiceTarget(m.Messages); target.Layout = "${level}=> ${message} ${exception:format=Message} ${exception:format=Type} ${exception:format=StackTrace}"; target.Name = "LogService"; var wrapper = new AsyncTargetWrapper(target); config.AddTarget("LogService", wrapper); rule = new LoggingRule("*", LogLevel.Trace, target); config.LoggingRules.Add(rule); LogManager.Configuration = config; if (Debugger.IsAttached) target.Filter = LogLevel.Debug; }
private void Run() { if(Compose()) { logService = container.Resolve<LogService>(); logService.Filter = LogLevel.Trace; model = container.Resolve<Model>(); model.Messages.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Messages_CollectionChanged); ApplicationCore core = new ApplicationCore(container); core.Load(true); core.StartOverlordServer(); System.Console.WriteLine("Server started"); System.Console.ReadKey(); } else { System.Console.WriteLine("Program composition failed"); System.Console.ReadKey(); } }
public UpdateCheckerService(Model m) { model = m; }
public DownloadWorkerService(Node n, Model m, BufferService b) { remoteNode = n; model = m; bufferService = b; }
public CompareController(IContainer c) { viewModel = c.Resolve<CompareViewModel>(); model = c.Resolve<Model>(); }
protected override void OnStartup(StartupEventArgs e) { if(e.Args.Contains("WAIT")) Thread.Sleep(5000); SplashScreen appSplash = null; Fap.Foundation.SafeObservableStatic.Dispatcher = System.Windows.Application.Current.Dispatcher; SafeObservingCollectionManager.Start(); this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException); FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); base.OnStartup(e); if (Compose()) { if (e.Args.Length == 1 && e.Args[0] == "WAIT") { //Delay the application starting up, used when restarting. Thread.Sleep(3000); } ApplicationCore core = container.Resolve<ApplicationCore>(); if (!core.CheckSingleInstance()) { //An instance of fap is already running. //If we got a download url then forward onto the runing instance of FAP if (e.Args.Length == 2 && e.Args[0] == "-url") { Model model = new Model(); model.Load(); Client client = new Client(model.LocalNode); AddDownload verb = new AddDownload(); verb.URL = e.Args[1]; if (client.Execute(verb, model.LocalNode)) { //Download sent successfully Shutdown(0); return; } else { //Unsuccessful - Notify user WPFMessageBox.Show("FAP", "Failed to add download via RPC!"); Shutdown(1); return; } } else { //Inform the user they cannot run multiple instances WPFMessageBox.Show("FAP", "An instance of FAP is already running"); Shutdown(1); return; } } string img = GetImage(); appSplash = new SplashScreen(img); appSplash.Show(true); if (core.Load(false)) { core.StartClient(); core.StartGUI(!(e.Args.Contains("STARTUP"))); //Was a url passed on startup? if (e.Args.Length == 2 && e.Args[0] == "-url") { core.AddDownloadUrlWhenConnected(e.Args[1]); } } else { Shutdown(1); } } else { Shutdown(1); } if (null != appSplash) appSplash.Close(TimeSpan.FromSeconds(0)); }
public SearchController(IContainer c, Model m) { container = c; model = m; }
public OverlordManagerService(IContainer c) { container = c; model = c.Resolve<Model>(); }
public SettingsController(IContainer c, Model m, ApplicationCore ac) { container = c; model = m; core = ac; }
public CompareVerb(Model m) { model = m; }
public ServerUploadLimiterService(Model model) { this.model = model; }
public ShareInfoService(Model m) { model = m; }
public DownloadQueueController(DownloadQueueViewModel vm, Model model) { this.vm = vm; this.model = model; }