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


C# Settings.ToString方法代码示例

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


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

示例1: GetDefaultValue

 public static string GetDefaultValue(Settings setting)
 {
     SettingsInfo settingInfo;
     if (_settingsMap.TryGetValue(setting, out settingInfo)) {
         return settingInfo.defaultValue;
     } else {
         Logger.Error(TAG, String.Format("Unable to get name for setting \"{0}\"", setting.ToString()));
         return null;
     }
 }
开发者ID:hjrhjr,项目名称:Beats2,代码行数:10,代码来源:Settings.cs

示例2: Setup

 public void Setup()
 {
     Transport = new JenkinsTransportExtension();
     var settings = new Settings()
     {
         Project = String.Empty,
         Username = String.Empty,
         Password = String.Empty,
         Server = "https://builds.apache.org/"
     };
     Transport.Settings = settings.ToString();
     Transport.Configuration = new BuildServer(settings.Server);
 }
开发者ID:csnate,项目名称:cctray-jenkins-transport,代码行数:13,代码来源:JenkinsTransportExtensionTests.cs

示例3: TestSerialization

 public void TestSerialization()
 {
     var settings = new Settings()
     {
         Project = "Test Project",
         Server = "Test Server",
         Username = "Tester",
         Password = "TestPassword"
     };
     var serializedString = settings.ToString().Replace(Environment.NewLine, String.Empty);
     StringAssert.Matches(serializedString, new Regex("<JenkinsServerManagerSettings.*?>.*?</JenkinsServerManagerSettings>"));
     StringAssert.Matches(serializedString, new Regex("<Server.*?>" + settings.Server + "</Server>"));
     StringAssert.Matches(serializedString, new Regex("<Project.*?>" + settings.Project + "</Project>"));
     StringAssert.Matches(serializedString, new Regex("<AuthorizationInformation.*?>" +  settings.AuthorizationInformation + "</AuthorizationInformation>"));
     StringAssert.DoesNotMatch(serializedString, new Regex("<Username.*?>" + settings.Username + "</Username>"));
     StringAssert.DoesNotMatch(serializedString, new Regex("<Password.*?>" + settings.Password + "</Password>"));
 }
开发者ID:csnate,项目名称:cctray-jenkins-transport,代码行数:17,代码来源:SettingsTests.cs

示例4: Build

	void Build(string filePath) {
		if (File.Exists(filePath)) {
			
			string name = filePath.FromLast('/').UpToFirst('.');
			string content = File.ReadAllText(filePath);
			Settings settings = new Settings(content);
			
			//Debug.Log(settings.ToString());
			
			StreamWriter sr = File.CreateText(targetPath + name + ".cs");
			sr.Write(settings.ToString());
			sr.Close();
			
			Debug.Log("wrote file " + name + ".cs");
			
		
		}
		
	}
开发者ID:wfowler1,项目名称:Miscellaneous-Soundboards,代码行数:19,代码来源:DatastructureAccessorWindow.cs

示例5: CreateTestTarget

        private JenkinsTransportExtension CreateTestTarget(TestMocks mocks)
        {
            var Transport = new JenkinsTransportExtension();

            var settings = new Settings()
            {
                Project = String.Empty,
                Username = String.Empty,
                Password = String.Empty,
                Server = "https://builds.apache.org/"
            };

            Transport.JenkinsServerManagerFactory = mocks.JenkinsServerManagerFactory;
            Transport.WebRequestFactory = mocks.WebRequestFactory;
            Transport.JenkinsApiFactory = mocks.JenkinsApiFactory;
            Transport.ConfigurationFormFactory = mocks.ConfigurationFormFactory;
            Transport.DialogService = mocks.DialogService;

            Transport.Settings = settings.ToString();
            Transport.Configuration = new BuildServer(settings.Server);

            return Transport;
        }
开发者ID:nrjohnstone,项目名称:cctray-jenkins-transport,代码行数:23,代码来源:JenkinsTransportExtensionTests.cs

示例6: Settings_setter_should_update_settings

        public void Settings_setter_should_update_settings()
        {
            TestMocks mocks = new TestMocks();
            var target = CreateTestTarget(mocks);

            var settings = new Settings()
            {
                Project = "SomeProjectName",
                Username = "SomeUserName",
                Password = "SomePassword",
                Server = "https://some.testserver.com/"
            };

            // Act
            target.Settings = settings.ToString();

            // Assert
            target.Settings.Should().Be(settings.ToString());
        }
开发者ID:nrjohnstone,项目名称:cctray-jenkins-transport,代码行数:19,代码来源:JenkinsTransportExtensionTests.cs

示例7: CheckIfSettingExists

 private bool CheckIfSettingExists(Settings settings)
 {
     return (_environment.Settings.Any(s => s.Name == settings.ToString()));
 }
开发者ID:halcwb,项目名称:GenForm,代码行数:4,代码来源:GenFormEnvironment.cs

示例8: SetSettingsValue

        public void SetSettingsValue(Settings setting, bool isValid, string value)
        {
            string propertyName = setting.ToString().Split('_')[1];
            var property = this.GetType().GetProperty(propertyName);

            if (property.PropertyType.Equals(typeof(ListViewModel)))
            {
                if (value == null)
                {
                    value = "10";
                }

                var listViewModel = property.GetValue(this, null) as ListViewModel;
                listViewModel.SelectedValue = value;
            }
            else
            {
                if (value == null)
                {
                    value = "Yes";
                }

                var toggleSwitchViewModel = property.GetValue(this, null) as SimpleToggleSwitchViewModel;
                toggleSwitchViewModel.IsValid = isValid;
                toggleSwitchViewModel.IsChecked = value.Equals("Yes");
            }
        }
开发者ID:noamkfir,项目名称:WazeWP7,代码行数:27,代码来源:SettingsPivotPage.xaml.cs

示例9: GetSettingsValue

        public string GetSettingsValue(Settings setting)
        {
            string propertyName = setting.ToString().Split('_')[1];
            var property = this.GetType().GetProperty(propertyName);

            if (property.PropertyType.Equals(typeof(ListViewModel)))
            {
                var listViewModel = property.GetValue(this, null) as ListViewModel;
                return listViewModel.SelectedValue;
            }
            else
            {
                var toggleSwitchViewModel = property.GetValue(this, null) as SimpleToggleSwitchViewModel;
                return toggleSwitchViewModel.IsChecked ? "Yes" : "No";
            }
        }
开发者ID:noamkfir,项目名称:WazeWP7,代码行数:16,代码来源:SettingsPivotPage.xaml.cs


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