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


C# Preset类代码示例

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


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

示例1: CheckSetup

		public override void CheckSetup(Preset preset, Table table)
		{
			preset.CardCards[this] = new CardCollection();
			// Grab all of the Black Market Supply cards and stick them into the CardCards for Black Market
			foreach (Type cardType in table.SpecialPiles[TypeClass.BlackMarketSupply].CardTypes)
				preset.CardCards[this].Add(Card.CreateInstance(cardType));
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:7,代码来源:Promotional.cs

示例2: Encode

        /// <summary>
        /// Encodes a video and audio file.
        /// </summary>
        /// <param name="id">An ID used to track the item being encoded.</param>
        /// <param name="preset">The preset used to encode the given file.</param>
        /// <param name="file">The location of the file to encode.</param>
        /// <param name="command">The command used to tell Handbrake how to encode the video.</param>
        /// <param name="progress">The callback function fired when progress of a file's encoding is updated. The action is given the percentage complete.</param>
        /// <param name="complete">The callback function fired when encoding is complete. The action is given the location of the encoded file.</param>
        /// <returns>An ID used to track the item being encoded.</returns>
        public void Encode(Guid id, Preset preset, string file, string command, Action<EncodingMovieTask, double> progress, Action<EncodingMovieTask> complete)
        {
            if (string.IsNullOrEmpty(file))
                throw new ArgumentNullException("file");
            if (!System.IO.File.Exists(file))
                throw new FileNotFoundException(file);

            command = string.Format(command, "\"" + file + "\"", id.ToString("N") + ".mp4" + PresetIndicator.Get(preset));

            var task = new EncodingMovieTask {ID = id, File = file, PercentComplete = 0};

            Logger.Info("Beginning encoding: " + command);

            new Thread(() => {
                var process = new Process();
                process.StartInfo.FileName = @"c:\Code\showveoservice\ShowveoService.MVCApplication\Resources\HandbrakeCLI.exe";
                process.StartInfo.Arguments = command;
                process.StartInfo.RedirectStandardOutput = true;
                process.StartInfo.UseShellExecute = false;
                process.OutputDataReceived += (sender, args) => OnDataReceived(progress, task, args);
                process.ErrorDataReceived += (sender, args) => OnErrorReceived(args);
                process.Exited += (sender, args) => complete.Invoke(task);
                process.Start();

                process.BeginOutputReadLine();

                while (!process.HasExited) {}
            }).Start();
        }
开发者ID:chrisharrington,项目名称:showveoservice,代码行数:39,代码来源:HandbrakeEncoder.cs

示例3: LightPresets

	public LightPresets(LightConfiguration l)
	{
		lc = l;
		
		/*Preset p1 = new Preset();
		p1.p_name = "LightPresets.Inside";
		p1.l_intensity = 0.2f;
		p1.s_blur = 3f;
		p1.s_power = 0.9f;
		p1.r_id = 1;
		p1.r_rate = 0;
		p1.imgBackground_r = 128;
		p1.imgBackground_g = 128;
		p1.imgBackground_b = 128;
		p1.id = 0;*/
		
		Preset p2 = new Preset();
		p2.p_name = "LightPresets.LightingOutdoor";
		p2.l_intensity = 0.3f;
		p2.s_blur = 2.8f;
		p2.s_power = 0.4f;
		p2.r_id = 6;
		p2.r_rate = 0;
		p2.imgBackground_r = 128;
		p2.imgBackground_g = 128;
		p2.imgBackground_b = 128;
		p2.id = 1;
		
		Preset p3 = new Preset();
		p3.p_name = "LightPresets.CloudyOutdoor";
		p3.l_intensity = 0.2f;
		p3.s_blur = 6f;
		p3.s_power = 0.8f;
		p3.r_id = 6;
		p3.r_rate = 0;
		p3.imgBackground_r = 128;
		p3.imgBackground_g = 128;
		p3.imgBackground_b = 128;
		p3.id = 2;
		
		Preset p4 = new Preset();
		p4.p_name = "LightPresets.Night";
		p4.l_intensity = 0.05f;
		p4.s_blur = 6f;
		p4.s_power = 1.0f;
		p4.r_id = 6;
		p4.r_rate = 0;
		p4.imgBackground_r = 33;
		p4.imgBackground_g = 44;
		p4.imgBackground_b = 80;	
		p4.id = 3;
		
		//presetsList.Add(p1);
		presetsList.Add(p2);
		presetsList.Add(p3);
		presetsList.Add(p4);
		
	}
开发者ID:gviaud,项目名称:OS-unity-5,代码行数:58,代码来源:LightPresets.cs

示例4: EnablePreset

 public void EnablePreset(Preset preset)
 {
     foreach (var mod in preset)
     {
         modManager.EnableMod(mod);
     }
     preset.IsEnabled = true;
     UpdatePreset(preset);
 }
开发者ID:SneakyMax,项目名称:Cortex-Command-Mod-Manager,代码行数:9,代码来源:PresetManager.cs

示例5: DisablePreset

 public void DisablePreset(Preset preset)
 {
     foreach (var mod in preset)
     {
         modManager.DisableMod(mod);
     }
     preset.IsEnabled = false;
     UpdatePreset(preset);
 }
开发者ID:SneakyMax,项目名称:Cortex-Command-Mod-Manager,代码行数:9,代码来源:PresetManager.cs

示例6: PresetViewModel

        /// <summary>Creates a new preset view model.</summary>
        public PresetViewModel(Preset preset, ModManager modManager, PresetManager presetManager)
        {
            this.modManager = modManager;
            this.presetManager = presetManager;

            Preset = preset;

            RenameCommand = new Command(Rename);
            DisbandCommand = new Command(Disband);
        }
开发者ID:SneakyMax,项目名称:Cortex-Command-Mod-Manager,代码行数:11,代码来源:PresetViewModel.cs

示例7: ExportPreset

        /// <summary>
        /// The export preset.
        /// </summary>
        /// <param name="export">
        /// The export.
        /// </param>
        /// <param name="config">
        /// HandBrakes configuration options.
        /// </param>
        /// <returns>
        /// The <see cref="Preset"/>.
        /// </returns>
        public static PresetTransportContainer ExportPreset(Preset export, HBConfiguration config)
        {
            PresetTransportContainer container = new PresetTransportContainer();
            container.VersionMajor = "0";
            container.VersionMinor = "10";
            container.VersionMicro = "2";
            container.PresetList = new List<HBPreset> { CreateHbPreset(export, config) };

            return container;
        }
开发者ID:utensil-star,项目名称:HandBrake,代码行数:22,代码来源:JsonPresetFactory.cs

示例8: Create

        /// <summary>
        /// Creates an encoder based on a preset.
        /// </summary>
        /// <param name="preset">The preset used to generate the appropriate encoder.</param>
        /// <returns>The created encoder.</returns>
        public IEncoder Create(Preset preset)
        {
            switch (preset)
            {
                case Preset.Phone: return new PhoneHandbrakeEncoder(_configuration);
                case Preset.TV: return new TVHandbrakeEncoder(_configuration);
                case Preset.Tablet: return new TabletHandbrakeEncoder(_configuration);
            }

            throw new ArgumentException("The preset " + preset + " has no implementation.");
        }
开发者ID:chrisharrington,项目名称:showveoservice,代码行数:16,代码来源:EncoderFactory.cs

示例9: Get

        public static string Get(Preset preset)
        {
            switch (preset)
            {
                case Preset.Phone: return ".phone";
                case Preset.Tablet: return ".tablet";
                case Preset.TV: return ".tv";
            }

            throw new InvalidOperationException("No indicator exists for preset \"" + preset + "\".");
        }
开发者ID:chrisharrington,项目名称:showveoservice,代码行数:11,代码来源:PresetIndicator.cs

示例10: SetPresetSettings

	// 
	void SetPresetSettings(Preset p)
	{
		HighlightingBase hb = FindObjectOfType<HighlightingBase>();

		if (hb == null) { return; }

		hb.downsampleFactor = p.downsampleFactor;
		hb.iterations = p.iterations;
		hb.blurMinSpread = p.blurMinSpread;
		hb.blurSpread = p.blurSpread;
		hb.blurIntensity = p.blurIntensity;
	}
开发者ID:cristi16,项目名称:Artefacts---Collaborative-evolution-of-three-dimensional-objects,代码行数:13,代码来源:PresetSelector.cs

示例11: ApplyPreset

	void ApplyPreset( Preset ps )
	{
		m_idTexture = ps.m_idTexture;
		m_idMask = ps.m_idMask;
		GetComponent<Renderer>().material.SetTexture("_MainTex", m_textureList[m_idTexture]);
		GetComponent<Renderer>().material.SetTexture("_MaskTex", m_maskList[m_idMask]);
		
		GetComponent<Renderer>().material.SetFloat( "_Emission", ps.m_Emission );
		GetComponent<Renderer>().material.SetFloat( "_Alpha", ps.m_Alpha );
		GetComponent<Renderer>().material.SetFloat( "_AlphaCutOffMask", ps.m_AlphaCutOffMask );
		GetComponent<Renderer>().material.SetFloat( "_AlphaCutOffSmooth", ps.m_AlphaCutOffSmooth );
		GetComponent<Renderer>().material.SetFloat( "_AlphaMask", ps.m_AlphaMask );
	}
开发者ID:St4ik4,项目名称:LIBERTY-VICE,代码行数:13,代码来源:MatcapFXControl.cs

示例12: AddModToPreset

 public void AddModToPreset(Mod mod, Preset preset)
 {
     if (!ModIsInAPreset(mod))
     {
         preset.Add(mod);
         if (mod.IsEnabled != preset.IsEnabled)
         {
             modManager.ToggleEnabled(mod);
         }
         SavePreset(preset);
         LoadModsBuffer();
     }
 }
开发者ID:SneakyMax,项目名称:Cortex-Command-Mod-Manager,代码行数:13,代码来源:PresetManager.cs

示例13: SetForce

    public void SetForce(float max, float min)
    {
        if (max == preset.maxForce && min == preset.minForce) return;

        Preset newP = new Preset();
        newP.in_curve = preset.in_curve;
        newP.out_curve = preset.out_curve;
        newP.in_time = preset.in_time;
        newP.out_time = preset.out_time;

        newP.maxForce = max;
        newP.minForce = min;
        ChangePreset(newP);
    }
开发者ID:xCosmix,项目名称:Finding-Home,代码行数:14,代码来源:Force.cs

示例14: btnSave_Click

    protected void btnSave_Click(object sender, EventArgs e)
    {
        var p = new Preset
        {
            ID = 0,
            Name = txtCropName.Text,
            IdealTemperature = Convert.ToInt32(txtIdealTemp.Text),
            TemperatureThreshold = Convert.ToInt32(txtTempRange.Text),
            IdealLightIntensity = Convert.ToInt32(txtLightRange.Text),
            LightIntensityThreshold = Convert.ToInt32(txtLightRange.Text),
            IdealHumidity = Convert.ToInt32(txtHumidity.Text),
            HumidityThreshold = Convert.ToInt32(txtHumidityRange.Text),
            IdealWaterLevel = Convert.ToInt32(txtWaterLevel.Text),
            WaterLevelThreshold = Convert.ToInt32(txtWaterThreshold.Text)

        };
        p.Save();
    }
开发者ID:sthoms28,项目名称:seniorproject2009,代码行数:18,代码来源:AddCrop.aspx.cs

示例15: btnAddPreset_Click

 private void btnAddPreset_Click(object sender, EventArgs e)
 {
     try
     {
         MouseClicker.InputBox iBox = new MouseClicker.InputBox("Define preset name", "My preset");
         if (iBox.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             Preset p = new Preset(iBox.Value, "", "", "");
             _presets.Add(p);
             DisplayPresets();
             cboPresets.SelectedItem = p;
             SavePresets();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
开发者ID:xenatis,项目名称:QsaveSaver,代码行数:19,代码来源:Form1.cs


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