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


C# IUserSettingService.GetUserSetting方法代码示例

本文整理汇总了C#中IUserSettingService.GetUserSetting方法的典型用法代码示例。如果您正苦于以下问题:C# IUserSettingService.GetUserSetting方法的具体用法?C# IUserSettingService.GetUserSetting怎么用?C# IUserSettingService.GetUserSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IUserSettingService的用法示例。


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

示例1: EncodeBase

 /// <summary>
 /// Initializes a new instance of the <see cref="EncodeBase"/> class.
 /// </summary>
 /// <param name="userSettingService">
 /// The user Setting Service.
 /// </param>
 public EncodeBase(IUserSettingService userSettingService)
 {
     this.userSettingService = userSettingService;
     this.logBuffer = new StringBuilder();
     header =
         GeneralUtilities.CreateCliLogHeader(
             userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion),
             userSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild));
 }
开发者ID:evolver56k,项目名称:HandBrake,代码行数:15,代码来源:EncodeBase.cs

示例2: LibScan

        /// <summary>
        /// Initializes a new instance of the <see cref="LibScan"/> class. 
        /// </summary>
        /// <param name="userSettingService">
        /// The user Setting Service.
        /// </param>
        /// <param name="handBrakeInstance">
        /// The hand Brake Instance.
        /// </param>
        public LibScan(IUserSettingService userSettingService, IHandBrakeInstance handBrakeInstance)
        {
            logging = new StringBuilder();

            header = GeneralUtilities.CreateCliLogHeader(
                userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion),
                userSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild));

            instance = handBrakeInstance;
            instance.Initialize(1);
            instance.ScanProgress += this.InstanceScanProgress;
            instance.ScanCompleted += this.InstanceScanCompleted;

            HandBrakeUtils.MessageLogged += this.HandBrakeInstanceMessageLogged;
            HandBrakeUtils.ErrorLogged += this.HandBrakeInstanceErrorLogged;
        }
开发者ID:evolver56k,项目名称:HandBrake,代码行数:25,代码来源:LibScan.cs

示例3: EncodeServiceWrapper

        /// <summary>
        /// Initializes a new instance of the <see cref="EncodeServiceWrapper"/> class.
        /// </summary>
        /// <param name="userSettingService">
        /// The user setting service.
        /// </param>
        public EncodeServiceWrapper(IUserSettingService userSettingService)
        {
            var useLibHb = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableLibHb);
            var useProcessIsolation =
                userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableProcessIsolation);
            var port = userSettingService.GetUserSetting<string>(UserSettingConstants.ServerPort);

            if (useLibHb)
            {
                try
                {
                    if (useProcessIsolation)
                    {
                        this.encodeService = new IsolatedEncodeService(port);
                    }
                    else
                    {
                        if (ScanServiceWrapper.HandbrakeInstance == null)
                        {
                            ScanServiceWrapper.HandbrakeInstance = new HandBrakeInstance();
                        }

                        this.encodeService = new LibEncode(userSettingService, ScanServiceWrapper.HandbrakeInstance);
                    }
                }
                catch (Exception exc)
                {
                    // Try to recover from errors.
                    userSettingService.SetUserSetting(UserSettingConstants.EnableLibHb, false);
                    throw new GeneralApplicationException(
                        "Unable to initialise LibHB or Background worker service",
                        "Falling back to using HandBrakeCLI.exe. Setting has been reset",
                        exc);
                }
            }
            else
            {
                this.encodeService = new Encode(userSettingService);
            }

            this.encodeService.EncodeCompleted += this.EncodeServiceEncodeCompleted;
            this.encodeService.EncodeStarted += this.EncodeServiceEncodeStarted;
            this.encodeService.EncodeStatusChanged += this.EncodeServiceEncodeStatusChanged;
        }
开发者ID:JuannyWang,项目名称:HandBrake-QuickSync-Mac,代码行数:50,代码来源:EncodeServiceWrapper.cs

示例4: StaticPreviewViewModel

        /// <summary>
        /// Initializes a new instance of the <see cref="StaticPreviewViewModel"/> class.
        /// </summary>
        /// <param name="scanService">
        /// The scan service.
        /// </param>
        /// <param name="userSettingService">
        /// The user Setting Service.
        /// </param>
        public StaticPreviewViewModel(IScan scanService, IUserSettingService userSettingService)
        {
            this.scanService = scanService;
            this.selectedPreviewImage = 1;
            this.Title = Properties.Resources.Preview;
            this.PreviewNotAvailable = true;

            // Live Preview
            this.userSettingService = userSettingService;
            this.encodeService = new LibEncode(); // Preview needs a seperate instance rather than the shared singleton. This could maybe do with being refactored at some point

            this.Title = "Preview";
            this.Percentage = "0.00%";
            this.PercentageValue = 0;
            this.Duration = 30;
            this.CanPlay = true;

            UseSystemDefaultPlayer = userSettingService.GetUserSetting<bool>(UserSettingConstants.DefaultPlayer);
            this.Duration = userSettingService.GetUserSetting<int>(UserSettingConstants.LastPreviewDuration);
        }
开发者ID:beppec56,项目名称:HandBrake-git_svn-mirror,代码行数:29,代码来源:StaticPreviewViewModel.cs

示例5: PreviewViewModel

        /// <summary>
        /// Initializes a new instance of the <see cref="PreviewViewModel"/> class.
        /// </summary>
        /// <param name="encodeService">
        /// The encode Service.
        /// </param>
        /// <param name="errorService">
        /// The error Service.
        /// </param>
        /// <param name="userSettingService">
        /// The user Setting Service.
        /// </param>
        public PreviewViewModel(IEncodeServiceWrapper encodeService, IErrorService errorService, IUserSettingService userSettingService)
        {
            this.encodeService = encodeService;
            this.errorService = errorService;
            this.userSettingService = userSettingService;
            this.Title = "Preview";
            this.Percentage = "0.00%";
            this.PercentageValue = 0;
            this.StartAt = 1;
            this.Duration = 30;

            UseSystemDefaultPlayer = userSettingService.GetUserSetting<bool>(UserSettingConstants.DefaultPlayer);
        }
开发者ID:epowers,项目名称:HandBrakeMirror,代码行数:25,代码来源:PreviewViewModel.cs

示例6: PreviewViewModel

        /// <summary>
        /// Initializes a new instance of the <see cref="PreviewViewModel"/> class.
        /// </summary>
        /// <param name="errorService">
        /// The error Service.
        /// </param>
        /// <param name="userSettingService">
        /// The user Setting Service.
        /// </param>
        public PreviewViewModel(IErrorService errorService, IUserSettingService userSettingService)
        {
            // Preview needs a seperate instance rather than the shared singleton. This could maybe do with being refactored at some point
            this.encodeService = new EncodeServiceWrapper(userSettingService);

            this.errorService = errorService;
            this.userSettingService = userSettingService;
            this.Title = "Preview";
            this.Percentage = "0.00%";
            this.PercentageValue = 0;
            this.StartAt = 1;
            this.Duration = 30;
            this.CanPlay = true;

            UseSystemDefaultPlayer = userSettingService.GetUserSetting<bool>(UserSettingConstants.DefaultPlayer);
            this.Duration = userSettingService.GetUserSetting<int>(UserSettingConstants.LastPreviewDuration);
        }
开发者ID:JuannyWang,项目名称:HandBrake-QuickSync-Mac,代码行数:26,代码来源:PreviewViewModel.cs

示例7: Parse

        /// <summary>
        /// Parse the Title Information
        /// </summary>
        /// <param name="output">
        /// A StringReader of output data
        /// </param>
        /// <param name="userSettingService">
        /// The user Setting Service.
        /// </param>
        /// <returns>
        /// A Title Object
        /// </returns>
        public static Title Parse(StringReader output, IUserSettingService userSettingService)
        {
            var thisTitle = new Title();
            string nextLine = output.ReadLine();

            // Get the Title Number
            Match m = Regex.Match(nextLine, @"^\+ title ([0-9]*):");
            if (m.Success)
                thisTitle.TitleNumber = int.Parse(m.Groups[1].Value.Trim());
            nextLine = output.ReadLine();

            // Detect if this is the main feature
            m = Regex.Match(nextLine, @"  \+ Main Feature");
            if (m.Success)
            {
                thisTitle.MainTitle = true;
                nextLine = output.ReadLine();
            }

            // Get the stream name for file import
            m = Regex.Match(nextLine, @"^  \+ stream:");
            if (m.Success)
            {
                thisTitle.SourceName = nextLine.Replace("+ stream:", string.Empty).Trim();
                nextLine = output.ReadLine();
            }

            // Playlist
            m = Regex.Match(nextLine, @"^  \+ playlist:");
            if (m.Success)
            {
                thisTitle.Playlist = nextLine.Replace("+ playlist:", string.Empty).Trim();
                nextLine = output.ReadLine();
            }

            // Jump over the VTS and blocks line
            m = Regex.Match(nextLine, @"^  \+ vts:");
            if (nextLine.Contains("blocks") || nextLine.Contains("+ vts "))
            {
                nextLine = output.ReadLine();
            }

            // Multi-Angle Support if LibDvdNav is enabled
            if (!userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav))
            {
                m = Regex.Match(nextLine, @"  \+ angle\(s\) ([0-9])");
                if (m.Success)
                {
                    string angleList = m.Value.Replace("+ angle(s) ", string.Empty).Trim();
                    int angleCount;
                    int.TryParse(angleList, out angleCount);

                    thisTitle.AngleCount = angleCount;
                    nextLine = output.ReadLine();
                }
            }

            // Get duration for this title
            m = Regex.Match(nextLine, @"^  \+ duration: ([0-9]{2}:[0-9]{2}:[0-9]{2})");
            if (m.Success)
                thisTitle.Duration = TimeSpan.Parse(m.Groups[1].Value);

            // Get resolution, aspect ratio and FPS for this title
            m = Regex.Match(output.ReadLine(), @"^  \+ size: ([0-9]*)x([0-9]*), pixel aspect: ([0-9]*)/([0-9]*), display aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");
            if (m.Success)
            {
                thisTitle.Resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));
                thisTitle.ParVal = new Size(int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value));
                thisTitle.AspectRatio = Math.Round(float.Parse(m.Groups[5].Value, CultureInfo.InvariantCulture), 2);
                thisTitle.Fps = float.Parse(m.Groups[6].Value, CultureInfo.InvariantCulture);
            }

            // Get autocrop region for this title
            m = Regex.Match(output.ReadLine(), @"^  \+ autocrop: ([0-9]*)/([0-9]*)/([0-9]*)/([0-9]*)");
            if (m.Success)
            {
                thisTitle.AutoCropDimensions = new Cropping
                    {
                        Top = int.Parse(m.Groups[1].Value),
                        Bottom = int.Parse(m.Groups[2].Value),
                        Left = int.Parse(m.Groups[3].Value),
                        Right = int.Parse(m.Groups[4].Value)
                    };
            }

            thisTitle.Chapters.AddRange(Chapter.ParseList(output));

            thisTitle.AudioTracks.AddRange(AudioHelper.ParseList(output));
//.........这里部分代码省略.........
开发者ID:evolver56k,项目名称:HandBrake,代码行数:101,代码来源:Title.cs


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