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


C# ISetting类代码示例

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


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


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