本文整理汇总了C#中System.Xml.Linq.XElement.HydrateObject方法的典型用法代码示例。如果您正苦于以下问题:C# XElement.HydrateObject方法的具体用法?C# XElement.HydrateObject怎么用?C# XElement.HydrateObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Linq.XElement
的用法示例。
在下文中一共展示了XElement.HydrateObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopulateFromXml
void PopulateFromXml(XElement element)
{
element.HydrateObject(XmlNamespaces.WindowsAzure, this);
Slot = (DeploymentSlot)Enum.Parse(typeof(DeploymentSlot), (string)element.Element(XmlNamespaces.WindowsAzure + "DeploymentSlot"), true);
if (!string.IsNullOrEmpty(Label)) Label = Label.FromBase64String();
Configuration = new ServiceConfiguration(XElement.Parse(element.Element(XmlNamespaces.WindowsAzure + "Configuration").Value.FromBase64String()));
}
示例2: StorageAccount
internal StorageAccount(XElement xml, Subscription subscription)
: this()
{
var azureNamespace = XmlNamespaces.WindowsAzure;
xml.HydrateObject(azureNamespace, this);
Subscription = subscription;
var storageServicePropertiesElement = xml.Element(azureNamespace + "StorageServiceProperties");
storageServicePropertiesElement.HydrateObject(azureNamespace, this);
if (!string.IsNullOrEmpty(Label)) Label = Label.FromBase64String();
var extendedProperties = xml.Element(azureNamespace + "ExtendedProperties");
if (extendedProperties != null)
{
ExtendedProperties = extendedProperties.Elements()
.ToDictionary(
x => (string) x.Element(azureNamespace + "Name"),
x => (string) x.Element(azureNamespace + "Value"));
}
Endpoints = GetEndpoints(storageServicePropertiesElement, azureNamespace, "Endpoints");
SecondaryEndpoints = GetEndpoints(storageServicePropertiesElement, azureNamespace, "SecondaryEndpoints");
}
示例3: TrafficManagerProfile
internal TrafficManagerProfile(XElement xml, Subscription subscription) : this()
{
var ns = XmlNamespaces.WindowsAzure;
xml.HydrateObject(ns, this);
Enabled = (string) xml.Element(ns + "Status") != "Disabled";
Subscription = subscription;
}
示例4: ExtensionImageVersion
internal ExtensionImageVersion(XElement xml)
{
var azureNamespace = XmlNamespaces.WindowsAzure;
xml.HydrateObject(azureNamespace, this);
PublicConfigurationSchema = PublicConfigurationSchema.FromBase64String();
PrivateConfigurationSchema = PrivateConfigurationSchema.FromBase64String();
SampleConfig = SampleConfig.FromBase64String();
}
示例5: ReservedIp
internal ReservedIp(XElement xml, Subscription subscription)
{
Contract.Requires(Subscription == null);
Contract.Requires(subscription != null);
var azureNamespace = XmlNamespaces.WindowsAzure;
xml.HydrateObject(azureNamespace, this);
Subscription = subscription;
}
示例6: Extension
public Extension(XElement xml, CloudService parent)
{
Contract.Requires(parent != null);
xml.HydrateObject(XmlNamespaces.WindowsAzure, this);
PublicConfiguration = PublicConfiguration.FromBase64String();
PrivateConfiguration = PrivateConfiguration.FromBase64String();
Parent = parent;
}
示例7: AvailableExtensionImage
internal AvailableExtensionImage(XElement xml, Subscription subscription)
{
Subscription = subscription;
var azureNamespace = XmlNamespaces.WindowsAzure;
xml.HydrateObject(azureNamespace, this);
PublicConfigurationSchema = PublicConfigurationSchema.FromBase64String();
PrivateConfigurationSchema = PrivateConfigurationSchema.FromBase64String();
SampleConfig = SampleConfig.FromBase64String();
Versions = new LatentSequence<ExtensionImageVersion>(GetExtensionImageVersionsAsync);
}
示例8: FirewallRule
internal FirewallRule(XElement xml, DatabaseServer parent)
{
Parent = parent;
xml.HydrateObject(XmlNamespaces.WindowsAzure, this);
var startIpAddressElement = xml.Element(XmlNamespaces.WindowsAzure + "StartIPAddress");
if (startIpAddressElement != null)
{
StartIpAddress = startIpAddressElement.Value;
}
var endIpAddressElement = xml.Element(XmlNamespaces.WindowsAzure + "EndIPAddress");
if (endIpAddressElement != null)
{
EndIpAddress = endIpAddressElement.Value;
}
}
示例9: Location
internal Location(XElement xml, Subscription subscription)
{
Contract.Requires(Subscription == null);
Contract.Requires(subscription != null);
var azureNamespace = XmlNamespaces.WindowsAzure;
xml.HydrateObject(azureNamespace, this);
Subscription = subscription;
var computeCapabilitiesElement = xml.Element(azureNamespace + "ComputeCapabilities");
AvailableServices = GetAvailableServices(xml, azureNamespace);
WebWorkerRoleSizes = GetRoleSizes(computeCapabilitiesElement, azureNamespace, "WebWorkerRoleSizes");
VirtualMachinesRoleSizes = GetRoleSizes(computeCapabilitiesElement, azureNamespace, "VirtualMachinesRoleSizes");
}
示例10: AffinityGroup
internal AffinityGroup(XElement xml, Subscription subscription)
{
Contract.Requires(Subscription == null);
Contract.Requires(subscription != null);
var azureNamespace = XmlNamespaces.WindowsAzure;
xml.HydrateObject(azureNamespace, this);
Subscription = subscription;
if (!string.IsNullOrEmpty(Label))
{
Label = Label.FromBase64String();
}
var computeCapabilitiesElement = xml.Element(azureNamespace + "ComputeCapabilities");
Capabilities = GetCapabilities(xml, azureNamespace);
WebWorkerRoleSizes = GetRoleSizes(computeCapabilitiesElement, azureNamespace, "WebWorkerRoleSizes");
VirtualMachinesRoleSizes = GetRoleSizes(computeCapabilitiesElement, azureNamespace, "VirtualMachinesRoleSizes");
}
示例11: FirewallRule
internal FirewallRule(XElement xml, DatabaseServer parent)
{
Parent = parent;
xml.HydrateObject(XmlNamespaces.SqlAzure, this);
}
示例12: Database
internal Database(XElement xml, DatabaseServer databaseServer)
{
xml.HydrateObject(XmlNamespaces.WindowsAzure, this);
DatabaseServer = databaseServer;
}
示例13: DatabaseServer
internal DatabaseServer(XElement xml, Subscription subscription) : this()
{
xml.HydrateObject(XmlNamespaces.SqlAzure, this);
Subscription = subscription;
}
示例14: TrafficManagerHttpOptions
internal TrafficManagerHttpOptions(XElement xml)
{
xml.HydrateObject(XmlNamespaces.WindowsAzure, this);
}
示例15: TrafficManagerMonitor
internal TrafficManagerMonitor(XElement xml)
{
var ns = XmlNamespaces.WindowsAzure;
xml.HydrateObject(ns, this);
HttpOptions = new TrafficManagerHttpOptions(xml.Element(ns + "HttpOptions"));
}