Exemplo n.º 1
0
        public void Dispose()
        {
            if (this._container != null && !this._container.IsDisposed)
            {
                this._container.Dispose();
            }

            this._container = null;
        }
Exemplo n.º 2
0
        private static void ConnectAndLoadPlugins(IGameConnector[] connectors)
        {
            KernelWrapper           kernelWrapper               = new KernelWrapper();
            IPluginSettingsProvider pluginSettingsProvider      = kernelWrapper.Get <IPluginSettingsProvider>();
            IEnumerable <ISimulatorDateSetVisitor> dataVisitors = kernelWrapper.GetAll <ISimulatorDateSetVisitor>();
            PluginsManager pluginManager = new PluginsManager(pluginSettingsProvider, connectors, dataVisitors);

            pluginManager.InitializePlugins();
            pluginManager.Start();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the cluster size of the given drive
        /// </summary>
        /// <param name="driveRootPath"></param>
        /// <returns>the cluster size of the given drive, -1 if it couldn't be determined</returns>
        public static int GetClusterSize(string driveRootPath)
        {
            ulong sectorsPerCluster;
            ulong bytesPerSector;
            ulong numberOfFreeClusters;
            ulong totalNumberOfClusters;
            bool  result = KernelWrapper.GetDiskFreeSpace(driveRootPath, out sectorsPerCluster, out bytesPerSector, out numberOfFreeClusters, out totalNumberOfClusters);

            return(result ? (int)(sectorsPerCluster * bytesPerSector) : -1);
        }
Exemplo n.º 4
0
 public TimingApplicationController()
 {
     _kernelWrapper                          = new KernelWrapper();
     _displaySettingsLoader                  = new DisplaySettingsLoader();
     _ratingApplicationController            = _kernelWrapper.Get <IRatingApplicationController>();
     _settingsProvider                       = _kernelWrapper.Get <ISettingsProvider>();
     _simulatorContentController             = _kernelWrapper.Get <ISimulatorContentController>();
     _trackRecordsController                 = _kernelWrapper.Get <ITrackRecordsController>();
     _championshipController                 = _kernelWrapper.Get <IChampionshipController>();
     _sessionEventsController                = _kernelWrapper.Get <ISessionEventsController>();
     _sessionEventProvider                   = _kernelWrapper.Get <ISessionEventProvider>();
     _championshipCurrentEventPointsProvider = _kernelWrapper.Get <IChampionshipCurrentEventPointsProvider>();
 }
Exemplo n.º 5
0
        public RemoteConnector()
        {
            _formatter = new BinaryFormatter();
            _listener  = new EventBasedNetListener();
            _client    = new NetManager(_listener, DatagramPayload.Version)
            {
                DiscoveryEnabled = true
            };;
            KernelWrapper kernelWrapper = new KernelWrapper();

            _remoteConfiguration     = new Lazy <RemoteConfiguration>(() => kernelWrapper.Get <IPluginSettingsProvider>().RemoteConfiguration);
            _datagramPayloadUnPacker = kernelWrapper.Get <IDatagramPayloadUnPacker>();
            _firstPackage            = true;
        }
        public MainTestWindowViewModel()
        {
            _kernelWrapper    = new KernelWrapper();
            _viewModelFactory = _kernelWrapper.Get <IViewModelFactory>();

            CalendarTemplateGroupViewModel = _viewModelFactory.Create <PredefinedCalendarSelectionViewModel>();
            CalendarTemplateGroupViewModel.FromModel(AllGroups.MainGroup);

            SequenceViewTestViewModel = new SequenceViewTestViewModel();
            TrophyViewModel           = new TrophyViewModel()
            {
                DriverName = "Fooo Foookovic",
                Position   = 3,
            };
        }
Exemplo n.º 7
0
        protected override async void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            try
            {
                AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
                PluginsSettingsWindow          pluginsSettingsWindow         = new PluginsSettingsWindow();
                IPluginConfigurationController pluginConfigurationController = new KernelWrapper().Get <IPluginConfigurationController>(new ConstructorArgument("mainWindow", pluginsSettingsWindow));
                pluginsSettingsWindow.Closed += async(sender, args) =>
                {
                    await pluginConfigurationController.StopControllerAsync();

                    Current.Shutdown();
                };
                await pluginConfigurationController.StartControllerAsync();

                pluginsSettingsWindow.Show();
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Error Occured");
                Environment.Exit(1);
            }
        }
Exemplo n.º 8
0
 private void InputBox_URLInfoUpdate(string url, KernelWrapper.ITXDataRead pUrlInfo)
 {
     if (this.urlInfoDownloading.ContainsKey(url))
     {
         List<ImageHyperlink> list = this.urlInfoDownloading[url];
         foreach (ImageHyperlink hyperlink in list)
         {
             this.SetURLInfo(hyperlink, pUrlInfo);
         }
         this.urlInfoDownloading.Remove(url);
     }
 }
Exemplo n.º 9
0
        private void SetURLInfo(ImageHyperlink hyperlink, KernelWrapper.ITXDataRead txData)
        {
            GrayURL.URLType dWord = (GrayURL.URLType)TXDataHelper.GetDWord(txData, "eURLType");
            bool @bool = TXDataHelper.GetBool(txData, "bShowURLReportNum");
            string appPath = CoreMessenger.Instance.GetAppPath(KernelWrapper.APP_PATH_TYPE.GlobalSys_Path_Misc);
            string path = null;
            bool flag2 = false;
            switch (dWord)
            {
                case GrayURL.URLType.URLType_Gray:
                    if (!@bool)
                    {
                        path = appPath + @"Safe\main_QQdoctortip14_help.png";
                        flag2 = true;
                    }
                    else
                    {
                        path = appPath + @"Safe\main_QQdoctortip14_attention.png";
                    }
                    break;

                case GrayURL.URLType.URLType_Black:
                    path = appPath + @"Safe\main_QQdoctortip14_alert.png";
                    break;

                case GrayURL.URLType.URLType_TencentWhite:
                    path = appPath + @"Safe\main_tencent14_normal.png";
                    flag2 = true;
                    break;

                case GrayURL.URLType.URLType_NonTencentWhite:
                    path = appPath + @"Safe\main_QQdoctortip14_good.png";
                    flag2 = true;
                    break;

                default:
                    path = appPath + @"Safe\main_QQdoctortip14_help.png";
                    break;
            }
            if (!flag2)
            {
                hyperlink.DisabledHyperLink();
            }
            ushort word = TXDataHelper.GetWord(txData, "wURLTipsID");
            string tips = ComponentManager.GetGrayURLMgr().QueryURLTips(word);
            hyperlink.InsertImage(path);
            hyperlink.SetToolTip(tips);
        }
 public DataBroadcasterPluginController()
 {
     _kernel = new KernelWrapper();
     _serverOverviewViewModel = _kernel.Get <IServerOverviewViewModel>();
     _pluginSettingsProvider  = _kernel.Get <IPluginSettingsProvider>();;
 }
Exemplo n.º 11
0
        static PluginsManager()
        {
            KernelWrapper kernelWrapper = new KernelWrapper();

            PluginSettingsProvider = kernelWrapper.Get <IPluginSettingsProvider>();
        }
Exemplo n.º 12
0
        public ContainerManager()
        {
            _container = new KernelWrapper();

            _container.Settings.Set("InjectAttribute", typeof(InjectAttribute));
        }
Exemplo n.º 13
0
        public ContainerManager()
        {
            _container = new KernelWrapper();

            _container.Settings.Set("InjectAttribute", typeof(Kooboo.Common.ObjectContainer.Dependency.InjectAttribute));
        }