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


C# Config.ToString方法代码示例

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


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

示例1: configInit

    private void configInit()
    {
        //trying new Config class
        Config config = new Config();
        config.Read();
        LogB.Information("Config:\n" + config.ToString());

        /*
         * TODO: do an else to any option
         * is good to do the else here because user can import a configuration at any time
         * and things need to be restored to default position in glade
         *
         * But note this has to be executed only if it has changed!!
         */

        if(config.Maximized)
            app1.Maximize();
        if(config.CustomButtons) {

            //---- capture tab ----

            hbox_encoder_capture_extra_mass_no_raspberry.Visible = false;
            hbox_encoder_capture_extra_mass_raspberry.Visible = true;

            button_encoder_select.HeightRequest = 40;
            //this will make all encoder capture controls taller
            button_encoder_capture.SetSizeRequest(125,60);

            spin_encoder_im_weights_n.Visible = false;
            hbox_encoder_im_weights_n.Visible = true;

            //---- analyze tab ----

            hbox_encoder_analyze_signal_or_curves.HeightRequest = 40;
            button_encoder_analyze.SetSizeRequest(120,40);
        }
        if(! config.UseVideo) {
            useVideo = false;
            alignment_video_encoder.Visible = false;
        }

        //Auto-detect stuff
        configAutodetectPort = config.AutodetectPort;

        autodetectSignalEnabled = false; //do not raise signals that could rewrite the config file (loop)

        if(configAutodetectPort == Config.AutodetectPortEnum.ACTIVE)
            radio_autodetect_active.Active = true;
        else if(configAutodetectPort == Config.AutodetectPortEnum.INACTIVE)
            radio_autodetect_inactive.Active = true;
        else // (configAutodetectPort == Config.AutodetectPortEnum.DISCARDFIRST)
            radio_autodetect_discard_first.Active = true;

        autodetectSignalEnabled = true; //activate signals again

        //show only power
        if(config.OnlyEncoderGravitatory)
            select_menuitem_mode_toggled(Constants.Menuitem_modes.POWERGRAVITATORY);
        else if(config.OnlyEncoderInertial)
            select_menuitem_mode_toggled(Constants.Menuitem_modes.POWERINERTIAL);

        if(config.EncoderCaptureShowOnlyBars)
        {
            //attention: this makes encoder_capture_signal_drawingarea == null
            vpaned_encoder_capture_video_and_set_graph.Visible = false;

            vpaned_encoder_main.Remove(alignment_treeview_encoder_capture_curves);
            vbox_treeview_encoder_at_second_page.PackStart(alignment_treeview_encoder_capture_curves);
            notebook_encoder_capture_main.ShowTabs = true;
        } else {
            /*
             * is good to do the else here because user can import a configuration at any time
             * and things need to be restored to default position in glade
             *
             * But note this has to be executed only if it has changed!!
             */
            /*
            notebook_encoder_capture_main.ShowTabs = false;
            vbox_treeview_encoder_at_second_page.Remove(alignment_treeview_encoder_capture_curves);
            vpaned_encoder_main.PackStart(alignment_treeview_encoder_capture_curves);
            */
        }

        encoderUpdateTreeViewWhileCapturing = config.EncoderUpdateTreeViewWhileCapturing;

        if(config.PersonWinHide) {
            //vbox_persons.Visible = false;
            notebook_session_person.Visible = false;
            hbox_encoder_person.Visible = true;
        }

        if(config.EncoderAnalyzeHide) {
            hbox_encoder_sup_capture_analyze_two_buttons.Visible = false;
        }

        if(config.Econf != null) {
            encoderConfigurationDefinedFromFile = true;
            encoderConfigurationCurrent = config.Econf;
            encoderConfigurationGUIUpdate();
            //TODO: allow to see full data, but don't allow to change it (Open window content as unsensitive)
//.........这里部分代码省略.........
开发者ID:GNOME,项目名称:chronojump,代码行数:101,代码来源:networks.cs

示例2: test_to_string_returns_json

 public void test_to_string_returns_json()
 {
     var config = new Config(JsonConfig);
     var configMinusWhitespace = Regex.Replace(JsonConfig, @"\s+", "");
     Assert.That(config.ToString(), Is.EqualTo(configMinusWhitespace));
 }
开发者ID:jtroe,项目名称:Centroid,代码行数:6,代码来源:ConfigTest.cs


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