当前位置: 首页>>代码示例>>C#>>正文


C# IApplicationPaths类代码示例

本文整理汇总了C#中IApplicationPaths的典型用法代码示例。如果您正苦于以下问题:C# IApplicationPaths类的具体用法?C# IApplicationPaths怎么用?C# IApplicationPaths使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IApplicationPaths类属于命名空间,在下文中一共展示了IApplicationPaths类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PismoIsoManager

 /// <summary>
 /// Initializes a new instance of the <see cref="PismoIsoManager" /> class.
 /// </summary>
 public PismoIsoManager(ILogger logger, IHttpClient httpClient, IApplicationPaths appPaths, IZipClient zipClient)
 {
     _logger = logger;
     _httpClient = httpClient;
     _appPaths = appPaths;
     _zipClient = zipClient;
 }
开发者ID:AshleyYakeley,项目名称:MediaBrowser.IsoMounting,代码行数:10,代码来源:PismoIsoManager.cs

示例2: SqliteItemRepository

        /// <summary>
        /// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
        /// </summary>
        /// <param name="appPaths">The app paths.</param>
        /// <param name="jsonSerializer">The json serializer.</param>
        /// <param name="logManager">The log manager.</param>
        /// <exception cref="System.ArgumentNullException">
        /// appPaths
        /// or
        /// jsonSerializer
        /// </exception>
        public SqliteItemRepository(IApplicationPaths appPaths, IJsonSerializer jsonSerializer, ILogManager logManager)
        {
            if (appPaths == null)
            {
                throw new ArgumentNullException("appPaths");
            }
            if (jsonSerializer == null)
            {
                throw new ArgumentNullException("jsonSerializer");
            }

            _appPaths = appPaths;
            _jsonSerializer = jsonSerializer;

            _criticReviewsPath = Path.Combine(_appPaths.DataPath, "critic-reviews");

            _logger = logManager.GetLogger(GetType().Name);

            var chapterDbFile = Path.Combine(_appPaths.DataPath, "chapters.db");
            var chapterConnection = SqliteExtensions.ConnectToDb(chapterDbFile, _logger).Result;
            _chapterRepository = new SqliteChapterRepository(chapterConnection, logManager);

            var mediaStreamsDbFile = Path.Combine(_appPaths.DataPath, "mediainfo.db");
            var mediaStreamsConnection = SqliteExtensions.ConnectToDb(mediaStreamsDbFile, _logger).Result;
            _mediaStreamsRepository = new SqliteMediaStreamsRepository(mediaStreamsConnection, logManager);

            var providerInfosDbFile = Path.Combine(_appPaths.DataPath, "providerinfo.db");
            var providerInfoConnection = SqliteExtensions.ConnectToDb(providerInfosDbFile, _logger).Result;
            _providerInfoRepository = new SqliteProviderInfoRepository(providerInfoConnection, logManager);
        }
开发者ID:RomanDengin,项目名称:MediaBrowser,代码行数:41,代码来源:SqliteItemRepository.cs

示例3: PluginUpdater

 /// <summary>
 /// Initializes a new instance of the <see cref="PluginUpdater" /> class.
 /// </summary>
 /// <param name="appHost">The app host.</param>
 /// <param name="logger">The logger.</param>
 public PluginUpdater(IApplicationHost appHost, ILogger logger, IApplicationPaths appPaths, ApiClient apiClient)
 {
     _appHost = appHost;
     _logger = logger;
     _appPaths = appPaths;
     _apiClient = apiClient;
 }
开发者ID:EchoDemon,项目名称:MediaBrowser.Theater,代码行数:12,代码来源:PluginUpdater.cs

示例4: ScheduledTaskWorker

        /// <summary>
        /// Initializes a new instance of the <see cref="ScheduledTaskWorker" /> class.
        /// </summary>
        /// <param name="scheduledTask">The scheduled task.</param>
        /// <param name="applicationPaths">The application paths.</param>
        /// <param name="taskManager">The task manager.</param>
        /// <param name="jsonSerializer">The json serializer.</param>
        /// <param name="logger">The logger.</param>
        /// <exception cref="System.ArgumentNullException">
        /// scheduledTask
        /// or
        /// applicationPaths
        /// or
        /// taskManager
        /// or
        /// jsonSerializer
        /// or
        /// logger
        /// </exception>
        public ScheduledTaskWorker(IScheduledTask scheduledTask, IApplicationPaths applicationPaths, ITaskManager taskManager, IJsonSerializer jsonSerializer, ILogger logger, IFileSystem fileSystem)
        {
            if (scheduledTask == null)
            {
                throw new ArgumentNullException("scheduledTask");
            }
            if (applicationPaths == null)
            {
                throw new ArgumentNullException("applicationPaths");
            }
            if (taskManager == null)
            {
                throw new ArgumentNullException("taskManager");
            }
            if (jsonSerializer == null)
            {
                throw new ArgumentNullException("jsonSerializer");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            ScheduledTask = scheduledTask;
            ApplicationPaths = applicationPaths;
            TaskManager = taskManager;
            JsonSerializer = jsonSerializer;
            Logger = logger;
            _fileSystem = fileSystem;

            InitTriggerEvents();
        }
开发者ID:t-andre,项目名称:Emby,代码行数:51,代码来源:ScheduledTaskWorker.cs

示例5: UpdateApplication

        public void UpdateApplication(MBApplication app, IApplicationPaths appPaths, string archive)
        {
            // First see if there is a version file and read that in
            var version = "Unknown";
            if (File.Exists(archive + ".ver"))
            {
                version = File.ReadAllText(archive + ".ver");
            }

            // Use our installer passing it the specific archive
            // We need to copy to a temp directory and execute it there
            var source = Path.Combine(appPaths.ProgramSystemPath, UpdaterExe);
            var tempUpdater = Path.Combine(Path.GetTempPath(), UpdaterExe);
            File.Copy(source, tempUpdater, true);
            source = Path.Combine(appPaths.ProgramSystemPath, UpdaterDll);
            var tempUpdaterDll = Path.Combine(Path.GetTempPath(), UpdaterDll);
            File.Copy(source, tempUpdaterDll, true);
            var product = app == MBApplication.MBTheater ? "mbt" : "server";
            // Our updater needs SS and ionic
            source = Path.Combine(appPaths.ProgramSystemPath, "ServiceStack.Text.dll");
            File.Copy(source, Path.Combine(Path.GetTempPath(), "ServiceStack.Text.dll"), true);
            source = Path.Combine(appPaths.ProgramSystemPath, "Ionic.Zip.dll");
            File.Copy(source, Path.Combine(Path.GetTempPath(), "Ionic.Zip.dll"), true);
            Process.Start(tempUpdater, string.Format("product={0} archive=\"{1}\" caller={2} pismo=false version={3}", product, archive, Process.GetCurrentProcess().Id, version));

            // That's it.  The installer will do the work once we exit
        }
开发者ID:snap608,项目名称:MediaBrowser,代码行数:27,代码来源:ApplicationUpdater.cs

示例6: InternalDirectShowPlayer

        //public URCOMLoader PrivateCom
        //{
        //    get
        //    {
        //        return _privateCom;
        //    }
        //}

        public InternalDirectShowPlayer(
            ILogManager logManager
            , MainBaseForm hostForm
            //, IPresentationManager presentation
            //, ISessionManager sessionManager
            , IApplicationPaths appPaths
            , IIsoManager isoManager
            //, IUserInputManager inputManager
            , IZipClient zipClient
            , IHttpClient httpClient, IConfigurationManager configurationManager)
        {
            _logger = logManager.GetLogger("InternalDirectShowPlayer");
            _hostForm = hostForm;
            //_presentation = presentation;
            //_sessionManager = sessionManager;
            _httpClient = httpClient;
            _config = configurationManager;
            _isoManager = isoManager;
            //_inputManager = inputManager;
            _zipClient = zipClient;

            var config = GetConfiguration();

            config.VideoConfig.SetDefaults();
            config.AudioConfig.SetDefaults();
            config.SubtitleConfig.SetDefaults();
            config.COMConfig.SetDefaults();

            //use a static object so we keep the libraries in the same place. Doesn't usually matter, but the EVR Presenter does some COM hooking that has problems if we change the lib address.
            //if (_privateCom == null)
            //    _privateCom = new URCOMLoader(_config, _zipClient);
            URCOMLoader.Instance.Initialize(appPaths.ProgramDataPath, _zipClient, logManager, configurationManager);

            EnsureMediaFilters(appPaths.ProgramDataPath);
        }
开发者ID:kabellrics,项目名称:Emby.Theater.Windows,代码行数:43,代码来源:InternalDirectShowPlayer.cs

示例7: PismoInstaller

 public PismoInstaller(IHttpClient httpClient, ILogger logger, IApplicationPaths appPaths, IZipClient zipClient)
 {
     _httpClient = httpClient;
     _logger = logger;
     _appPaths = appPaths;
     _zipClient = zipClient;
 }
开发者ID:AshleyYakeley,项目名称:MediaBrowser.IsoMounting,代码行数:7,代码来源:PismoInstaller.cs

示例8: ImageManager

        /// <summary>
        /// Initializes a new instance of the <see cref="ImageManager" /> class.
        /// </summary>
        /// <param name="apiClient">The API client.</param>
        /// <param name="paths">The paths.</param>
        /// <param name="config"></param>
        public ImageManager(Func<IApiClient> apiClient, IApplicationPaths paths, ITheaterConfigurationManager config)
        {
            _apiClient = apiClient;
            _config = config;

            _remoteImageCache = new FileSystemRepository(Path.Combine(paths.CachePath, "remote-images"));
        }
开发者ID:TomGillen,项目名称:MediaBrowser.Theater,代码行数:13,代码来源:ImageManager.cs

示例9: UpdateApplication

        public void UpdateApplication(IApplicationPaths appPaths, string archive, ILogger logger, string restartServiceName)
        {
            // First see if there is a version file and read that in
            var version = "Unknown";
            if (File.Exists(archive + ".ver"))
            {
                version = File.ReadAllText(archive + ".ver");
            }

            // Use our installer passing it the specific archive
            // We need to copy to a temp directory and execute it there
            var source = Path.Combine(appPaths.ProgramSystemPath, UpdaterExe);

            logger.Info("Copying updater to temporary location");
            var tempUpdater = Path.Combine(Path.GetTempPath(), UpdaterExe);
            File.Copy(source, tempUpdater, true);
            source = Path.Combine(appPaths.ProgramSystemPath, UpdaterDll);
            var tempUpdaterDll = Path.Combine(Path.GetTempPath(), UpdaterDll);

            logger.Info("Copying updater dependencies to temporary location");
            File.Copy(source, tempUpdaterDll, true);
            var product = "mbt";
            // Our updater needs SS and ionic
            source = Path.Combine(appPaths.ProgramSystemPath, "ServiceStack.Text.dll");
            File.Copy(source, Path.Combine(Path.GetTempPath(), "ServiceStack.Text.dll"), true);
            source = Path.Combine(appPaths.ProgramSystemPath, "SharpCompress.dll");
            File.Copy(source, Path.Combine(Path.GetTempPath(), "SharpCompress.dll"), true);

            logger.Info("Starting updater process.");
            Process.Start(tempUpdater, string.Format("product={0} archive=\"{1}\" caller={2} pismo=false version={3} service={4} installpath=\"{5}\"", product, archive, Process.GetCurrentProcess().Id, version, restartServiceName ?? string.Empty, appPaths.ProgramDataPath));

            // That's it.  The installer will do the work once we exit
        }
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:33,代码来源:ApplicationUpdater.cs

示例10: Init

        public static void Init(IApplicationPaths appPaths, INetworkManager networkManager)
        {
            // Ugly alert (static init)

            _appPaths = appPaths;
            _networkManager = networkManager;
        }
开发者ID:Jon-theHTPC,项目名称:MediaBrowser,代码行数:7,代码来源:MBRegistration.cs

示例11: DeviceRepository

 public DeviceRepository(IApplicationPaths appPaths, IJsonSerializer json, ILogger logger, IFileSystem fileSystem)
 {
     _appPaths = appPaths;
     _json = json;
     _logger = logger;
     _fileSystem = fileSystem;
 }
开发者ID:Cyrre,项目名称:Emby,代码行数:7,代码来源:DeviceRepository.cs

示例12: MBLicenseFile

        public MBLicenseFile(IApplicationPaths appPaths)
        {
            _appPaths = appPaths;

            UpdateRecords = new Dictionary<Guid, DateTime>();
            Load();
        }
开发者ID:jscorrea,项目名称:MediaBrowser,代码行数:7,代码来源:MBLicenseFile.cs

示例13: SqliteDisplayPreferencesRepository

 public SqliteDisplayPreferencesRepository(ILogManager logManager, IJsonSerializer jsonSerializer, IApplicationPaths appPaths, IDbConnector dbConnector, IMemoryStreamProvider memoryStreamProvider)
     : base(logManager, dbConnector)
 {
     _jsonSerializer = jsonSerializer;
     _memoryStreamProvider = memoryStreamProvider;
     DbFilePath = Path.Combine(appPaths.DataPath, "displaypreferences.db");
 }
开发者ID:t-andre,项目名称:Emby,代码行数:7,代码来源:SqliteDisplayPreferencesRepository.cs

示例14: ServerConfigurationManager

 /// <summary>
 /// Initializes a new instance of the <see cref="ServerConfigurationManager" /> class.
 /// </summary>
 /// <param name="applicationPaths">The application paths.</param>
 /// <param name="logManager">The log manager.</param>
 /// <param name="xmlSerializer">The XML serializer.</param>
 public ServerConfigurationManager(IApplicationPaths applicationPaths, ILogManager logManager, IXmlSerializer xmlSerializer)
     : base(applicationPaths, logManager, xmlSerializer)
 {
     UpdateItemsByNamePath();
     UpdateTranscodingTempPath();
     UpdateMetadataPath();
 }
开发者ID:bigjohn322,项目名称:MediaBrowser,代码行数:13,代码来源:ServerConfigurationManager.cs

示例15: ExtractFont

		internal static string ExtractFont(string name, IApplicationPaths paths, IFileSystem fileSystem)
        {
            var filePath = Path.Combine(paths.ProgramDataPath, "fonts", name);

			if (fileSystem.FileExists(filePath))
            {
                return filePath;
            }

            var namespacePath = typeof(PlayedIndicatorDrawer).Namespace + ".fonts." + name;
            var tempPath = Path.Combine(paths.TempDirectory, Guid.NewGuid().ToString("N") + ".ttf");
			fileSystem.CreateDirectory(Path.GetDirectoryName(tempPath));

            using (var stream = typeof(PlayedIndicatorDrawer).Assembly.GetManifestResourceStream(namespacePath))
            {
                using (var fileStream = new FileStream(tempPath, FileMode.Create, FileAccess.Write, FileShare.Read))
                {
                    stream.CopyTo(fileStream);
                }
            }

			fileSystem.CreateDirectory(Path.GetDirectoryName(filePath));

            try
            {
				fileSystem.CopyFile(tempPath, filePath, false);
            }
            catch (IOException)
            {

            }

            return tempPath;
        }
开发者ID:rezafouladian,项目名称:Emby,代码行数:34,代码来源:PlayedIndicatorDrawer.cs


注:本文中的IApplicationPaths类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。