本文整理汇总了C#中SectionViewModel.DescendentConfigurationsOfType方法的典型用法代码示例。如果您正苦于以下问题:C# SectionViewModel.DescendentConfigurationsOfType方法的具体用法?C# SectionViewModel.DescendentConfigurationsOfType怎么用?C# SectionViewModel.DescendentConfigurationsOfType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SectionViewModel
的用法示例。
在下文中一共展示了SectionViewModel.DescendentConfigurationsOfType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WithConnectionString
public IConnectionVerifier WithConnectionString(string name)
{
currentSection = model.Sections.Where(s => s.ConfigurationType == typeof(ConnectionStringsSection)).First();
Assert.IsTrue(model != null, "ConfigurationSourceModel does not contain ConnectionStringsSection");
currentConnection = currentSection.DescendentConfigurationsOfType<ConnectionStringSettings>()
.Where(x => x.Name == name).FirstOrDefault();
Assert.IsNotNull(currentConnection, string.Format("Could not locate connection {0}", name));
return this;
}
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:12,代码来源:DatabaseSectionConfigurationSourceModelAssertions.cs
示例2: AddConnection
private void AddConnection(SectionViewModel connectionSection)
{
var connection = connectionSection.DescendentConfigurationsOfType<ConnectionStringSettings>()
.Where(s => (string)s.Property("Name").Value == wizardData.Name).FirstOrDefault();
if (connection == null)
{
var connectionStrings = GetCollectionOfType<ConnectionStringSettingsCollection>(connectionSection);
connection = connectionStrings.AddNewCollectionElement(typeof(ConnectionStringSettings));
connection.Property("Name").Value = wizardData.Name;
connection.Property("ConnectionString").Value = wizardData.ConnectionString;
connection.Property("ProviderName").Value = wizardData.ProviderName;
}
}