• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ISetting类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: FillSettingParameterAttributes

        private static void FillSettingParameterAttributes(SettingSerializerData settingSerializerData, ISetting setting, Type settingType)
        {
            var propertyInfos = settingType.GetProperties().ToList();

            foreach (var propertyInfo in propertyInfos)
            {
                var settingParameterAttribute = AttributeRetrieval.GetAttribute<SettingParameterAttribute>(propertyInfo);
                if (settingParameterAttribute == null)
                {
                    continue;
                }

                var settingPropertyValue = propertyInfo.GetValue(setting);

                RunSettingSerializationValidation(settingType, propertyInfo, settingPropertyValue);

                var settingPropertyFormattedValue = RunSettingSerializationFormat(settingParameterAttribute, settingType, propertyInfo, settingPropertyValue);

                settingSerializerData.Parameters.Add(new SettingSerializerDataParameter
                {
                    Value = settingPropertyFormattedValue,
                    Parameter = settingParameterAttribute,
                });
            }
        }
开发者ID:kostyll,项目名称:HudlFfmpeg,代码行数:25,代码来源:SettingSerializerAttributeParser.cs


示例2: SetInput

        private static void SetInput( IBlock block, ISetting setting ) {

            String lbl = "setting.inputControl";
            String inputName = GetInputName( setting.Id );
            String settingValue = setting.SettingValue;
            int width = 500;
            if (setting.DataType == SettingType.Int.ToString()) {
                block.Set( lbl, Html.TextInput( inputName, settingValue, "width:40px;" ) );
            }
            else if (setting.DataType == SettingType.Bool.ToString()) {
                block.Set( lbl, Html.CheckBox( inputName, "", "1", Convert.ToBoolean( setting.SettingValue ) ) );
            }
            else if (setting.DataType == SettingType.Droplist.ToString()) {
                block.Set( lbl, Html.DropList( getDropOptions(setting.Options), inputName, "Name", "Value", setting.ValueInt ) );
            }
            else if (setting.DataType == SettingType.ShortText.ToString()) {
                block.Set( lbl, Html.TextInput( inputName, settingValue, "width:" + width + "px;" ) );
            }
            else if (setting.DataType == SettingType.BigText.ToString()) {
                block.Set( lbl, Html.TextArea( inputName, settingValue, "width:" + width + "px;height:300px;" ) );
            }
            else {
                block.Set( lbl, Html.TextArea( inputName, settingValue, "width:" + width + "px;height:50px;" ) );
            }
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:25,代码来源:SettingFormTool.cs


示例3: ReadyForNextGroupState

 public ReadyForNextGroupState(ISetting setting, IGrid grid, IGroupFactory groupFactory, OnDeleteEndEventHandler onDeleteEndEvent)
 {
     _setting = setting;
     _grid = grid;
     _groupFactory = groupFactory;
     _onDeleteEndEvent = onDeleteEndEvent;
 }
开发者ID:Mojopon,项目名称:ThreeSeven,代码行数:7,代码来源:ReadyForNextGroupState.cs


示例4: GeneralOptionsViewModel

        public GeneralOptionsViewModel(ISetting<GeneralOptions> setting, ISchedulerProvider schedulerProvider)
        {
            var reader = setting.Value.Subscribe(options =>
            {
                UseDarkTheme = options.Theme== Theme.Dark;
                HighlightTail = options.HighlightTail;
                HighlightDuration = options.HighlightDuration;
                Scale = options.Scale;
            });

            var writter = this.WhenAnyPropertyChanged()
                .Subscribe(vm =>
                {
                    setting.Write(new GeneralOptions(UseDarkTheme ? Theme.Dark : Theme.Light, HighlightTail, HighlightDuration, Scale));
                });

            HighlightDurationText = this.WhenValueChanged(vm=>vm.HighlightDuration)
                                        .Select(value => value.ToString("0.00 Seconds"))
                                        .ForBinding();

            ScaleText = this.WhenValueChanged(vm => vm.Scale)

                                        .Select(value => $"{value} %" )
                                        .ForBinding();

            ScaleRatio= this.WhenValueChanged(vm => vm.Scale)
                                        .Select(value =>(decimal)value / (decimal)100)
                                       // .Sample(TimeSpan.FromMilliseconds(250))
                                        .ForBinding();

            _cleanUp = new CompositeDisposable(reader, writter,  HighlightDurationText, ScaleText, ScaleRatio);
        }
开发者ID:mgnslndh,项目名称:TailBlazer,代码行数:32,代码来源:GeneralOptionsViewModel.cs


示例5: Source

        public void Source(ISetting setting, TextWriter output)
        {
            string	keyword;
            string	link;

            switch (this.mode)
            {
                case StoreMode.Local:
                    keyword = "declare";
                    link = "as";

                    break;

                default:
                    keyword = "set";
                    link = "to";

                    break;
            }

            output.Write (setting.BlockBegin);
            output.Write (keyword);
            output.Write (' ');
            output.Write (this.name);
            output.Write (' ');
            output.Write (link);
            output.Write (' ');
            output.Write (this.expression);
            output.Write (setting.BlockEnd);
        }
开发者ID:r3c,项目名称:cottle,代码行数:30,代码来源:AssignValueNode.cs


示例6: Game

    public Game(IGrid grid, ISetting setting)
    {
        _setting = setting;
        _grid = grid;

        currentControl = _grid;
    }
开发者ID:Mojopon,项目名称:ThreeSeven,代码行数:7,代码来源:Game.cs


示例7: SmartCPUBehaviour

    public SmartCPUBehaviour(IGrid grid, ISetting setting, CPUMode difficulty)
    {
        _grid = grid;
        _gridSimulator = new GridSimulator(grid, setting);
        _outputter = new OutputBestMovement(_gridSimulator);
        _grid.OnGroupAdd += new OnGroupAddEventHandler(OnGroupAddEvent);

        Debug.Log("difficulty " + difficulty + "set");
        switch(difficulty)
        {
            case CPUMode.Easy:
                timeBeforeAction = 0.5f;
                timeBetweenActions = 0.5f;
                break;
            case CPUMode.Normal:
                timeBeforeAction = 0.5f;
                timeBetweenActions = 0.3f;
                break;
            case CPUMode.Hard:
                timeBeforeAction = 0.2f;
                timeBetweenActions = 0.1f;
                break;
            case CPUMode.Kusotuyo:
                timeBeforeAction = 0f;
                timeBetweenActions = 0f;
                break;
        }
    }
开发者ID:Mojopon,项目名称:ThreeSeven,代码行数:28,代码来源:SmartCPUBehaviour.cs


示例8: Set

 public void Set(ISetting setting)
 {
     ISetting found = _settings.FirstOrDefault(s => s.Name == setting.Name);
     if (found != null)
         _settings.Remove(found);
     _settings.Add(setting);
 }
开发者ID:scottiemc7,项目名称:YurtleTrack,代码行数:7,代码来源:SettingsOriginator.cs


示例9: Source

        public void Source(ISetting setting, TextWriter output)
        {
            output.Write (setting.BlockBegin);
            output.Write ("for ");

            if (!string.IsNullOrEmpty (this.key))
            {
                output.Write (this.key);
                output.Write (", ");
            }

            output.Write (this.value);
            output.Write (" in ");
            output.Write (this.from);
            output.Write (":");

            this.body.Source (setting, output);

            if (this.empty != null)
            {
                output.Write (setting.BlockContinue);
                output.Write ("empty:");

                this.empty.Source (setting, output);
            }

            output.Write (setting.BlockEnd);
        }
开发者ID:r3c,项目名称:cottle,代码行数:28,代码来源:ForNode.cs


示例10: RecentSearchCollection

        public RecentSearchCollection(ILogger logger, ISetting<RecentSearch[]> setting)
        {
            if (logger == null) throw new ArgumentNullException("logger");
            _logger = logger;

            Items = _files.Connect()
                        .RemoveKey()
                        .AsObservableList();

            var loader = setting.Value.Subscribe(files =>
            {
                _files.Edit(innerCache =>
                {
                    //all files are loaded when state changes, so only add new ones
                    var newItems = files
                        .Where(f => !innerCache.Lookup(f.Text).HasValue)
                        .ToArray();

                    innerCache.AddOrUpdate(newItems);
                });     
            });
       
            var settingsWriter = _files.Connect()
                .ToCollection()
                .Subscribe(items =>
                {
                    setting.Write(items.ToArray());
                });

            _cleanUp = new CompositeDisposable(settingsWriter, loader, _files,Items);
        }
开发者ID:markiemarkus,项目名称:TailBlazer4.5,代码行数:31,代码来源:RecentSearchCollection.cs


示例11: Create

    public IGroup Create(ISetting setting)
    {
        IGroup nextGroup = _groupStocks[0];
        var parent = nextGroup.Parent;
        if (parent != null)
        {
            var childCount = parent.childCount;
            for(int i = 0; i < childCount; i++)
            {
                var child = parent.GetChild(0);
                child.SetParent(setting.Parent);
                child.localScale = setting.Parent.localScale;
            }
            parent.gameObject.AddComponent<DestroyGameObject>();
        }
        else
        {
            nextGroup.Offset = Vector3.zero;
        }
        _groupStocks.Remove(_groupStocks[0]);

        CreateNextStock(setting);

        return nextGroup;
    }
开发者ID:Mojopon,项目名称:ThreeSeven,代码行数:25,代码来源:GroupStock.cs


示例12: Source

 public void Source(ISetting setting, TextWriter output)
 {
     output.Write (setting.BlockBegin);
     output.Write ("dump ");
     output.Write (this.expression);
     output.Write (setting.BlockEnd);
 }
开发者ID:r3c,项目名称:cottle,代码行数:7,代码来源:DumpNode.cs


示例13: getDataLineContainer

    private HtmlGenericControl getDataLineContainer(ISetting setting)
    {
        HtmlGenericControl div_line = new HtmlGenericControl("div");
        div_line.Attributes.Add("class", "control-line-of-controls");

        HtmlGenericControl div_data_label = new HtmlGenericControl("div");
        div_data_label.Attributes.Add("style", "padding-top: 3px; float: left; width: 200px");
        div_data_label.Attributes.Add("align", "left");
        div_data_label.Attributes.Add("class", "control-label");
        div_data_label.InnerText = getLocalResource(setting);

        HtmlGenericControl div_data_input = new HtmlGenericControl("div");
        div_data_input.Attributes.Add("style", "float: left; width: 360px");
        TextBox box = new TextBox
                          {
                              Text = setting.Value.ToString()
                              , ID = string.Format(m_objectKey, setting.SettingAttribute.SettingName)
                              , CssClass = "control-textbox"
                              , EnableTheming = false
                          };
        box.Attributes.Add("style", "width: 100%");

        div_data_input.Controls.Add(box);
        div_line.Controls.Add(div_data_label);
        div_line.Controls.Add(div_data_input);

        return div_line;
    }
开发者ID:Confirmit,项目名称:Portal,代码行数:28,代码来源:BaseSettingUserControl.cs


示例14: Serialize

        public static string Serialize(ISetting setting)
        {
            var settingData = GetSettingData(setting);
            var settingSerializer = new SettingSerializerWriter(settingData);

            return settingSerializer.Write();
        }
开发者ID:kostyll,项目名称:HudlFfmpeg,代码行数:7,代码来源:SettingSerializer.cs


示例15: GridEventManager

    public GridEventManager(ISetting setting, IGrid grid, IGroupFactory groupFactory)
    {
        _grid = grid;
        _groupFactory = groupFactory;

        _setting = setting;
    }
开发者ID:Mojopon,项目名称:ThreeSeven,代码行数:7,代码来源:GridEventManager.cs


示例16: AddGroupCommand

 public AddGroupCommand(IGrid grid, ISetting setting, IGroup group, List<IBlock> allBlocks, OnGroupAddEventHandler onGroupAddEvent)
     : base(grid)
 {
     _setting = setting;
     _group = group;
     _allBlocks = allBlocks;
     _onGroupAddEvent = onGroupAddEvent;
 }
开发者ID:Mojopon,项目名称:ThreeSeven,代码行数:8,代码来源:AddGroupCommand.cs


示例17: EnvironmentSetting

 public EnvironmentSetting(ISetting setting)
 {
     Setting = setting;
     Name = GetNameFromSettingName(setting);
     MachineName = GetMachineName(setting);
     Environment = GetEnvironment(setting);
     Provider = GetProviderFromSettingName(setting);
 }
开发者ID:halcwb,项目名称:GenForm,代码行数:8,代码来源:EnvironmentSetting.cs


示例18: SpawnParticle

    public void SpawnParticle(ISetting setting, Vector2 position, Color color)
    {
        Transform spawnedParticle = Instantiate(particle, Vector3.zero, Quaternion.identity) as Transform;
        spawnedParticle.SetParent(setting.Parent);

        spawnedParticle.GetComponent<ParticleSystem>().startColor = color;
        spawnedParticle.position = new Vector3(position.x, position.y, -1);
    }
开发者ID:Mojopon,项目名称:ThreeSeven,代码行数:8,代码来源:ParticleSpawner.cs


示例19: Player

 public Player(IActionManager bl, ISetting setting, Random rd)
     : base(bl, setting, rd)
 {
     NbTry = 1;
     CheckCharacter = new Check(bl);
     gameOver = new EndGame(bl);
     PropertyChanged += Play_PropertyChanged;
 }
开发者ID:bahilo,项目名称:HiddenWord,代码行数:8,代码来源:Player.cs


示例20: Contains

        } // GetEnumerator

        // ----------------------------------------------------------------------
        public bool Contains(ISetting setting)
        {
            if (setting == null)
            {
                throw new ArgumentNullException("setting");
            }
            return settings.Contains(setting);
        } // Contains
开发者ID:llenroc,项目名称:Inflexion2,代码行数:11,代码来源:SettingCollection.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ISettingService类代码示例发布时间:2022-05-24
下一篇:
C# ISetter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap