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


C# XDocument.ToStringFullXmlDeclaration方法代码示例

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


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

示例1: CreatePayload

        protected override string CreatePayload()
        {
            /*<?xml version="1.0" encoding="utf-8"?>
                    <CreateHostedService xmlns="http://schemas.microsoft.com/windowsazure">
                            <ServiceName>service-name</ServiceName>
                            <Label>base64-encoded-service-label</Label>
                            <Description>description</Description>
                            <Location>location</Location>
                            <AffinityGroup>affinity-group</AffinityGroup>
                    </CreateHostedService>*/
            XNamespace ns = "http://schemas.microsoft.com/windowsazure";

            var locationElement = !string.IsNullOrEmpty(AffinityGroup)
                ? new XElement(ns + "AffinityGroup", AffinityGroup)
                : new XElement(ns + "Location", Location);

            var doc = new XDocument(
                    new XDeclaration("1.0", "utf-8", ""),
                    new XElement(ns + "CreateHostedService",
                    new XElement(ns + "ServiceName", Name),
                    new XElement(ns + "Label", Convert.ToBase64String(Encoding.UTF8.GetBytes(Name))),
                    new XElement(ns + "Description", Description),
                    locationElement));

            return doc.ToStringFullXmlDeclaration();
        }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:26,代码来源:CreateCloudServiceCommand.cs

示例2: CreatePayload

 //https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/deploymentslots/<deployment-slot-name>/?comp=status
 /// <summary>
 /// The Xml payload that is created and sent to the Fabric with the create deployment parameters
 /// </summary>
 /// <returns>A string Xml document representation</returns>
 protected override string CreatePayload()
 {
     XNamespace ns = "http://schemas.microsoft.com/windowsazure";
     var doc = new XDocument(
         new XDeclaration("1.0", "utf-8", ""),
         new XElement(ns + "UpdateDeploymentStatus", new XElement(ns + "Status", Status)));
     return doc.ToStringFullXmlDeclaration();
 }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:13,代码来源:UpdateRoleStatusCommand.cs

示例3: CreatePayload

 /// <summary>
 /// Creates a deployment payload for a predefined template 
 /// </summary>
 /// <returns>A string xml representation</returns>
 /// POST https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/deployments/<deployment-name>/roleinstances/<role-name>/Operations
 protected override string CreatePayload()
 {
     /*<RestartRoleOperation xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <OperationType>RestartRoleOperation</OperationType>
     </RestartRoleOperation>*/
     XNamespace ns = "http://schemas.microsoft.com/windowsazure";
     var doc = new XDocument(
         new XDeclaration("1.0", "utf-8", ""),
         new XElement(ns + "RestartRoleOperation",
                      new XElement(ns + "OperationType", "RestartRoleOperation")));
     return doc.ToStringFullXmlDeclaration();
 }
开发者ID:ArunMudiraj,项目名称:fluent-management,代码行数:17,代码来源:RestartVirtualMachineCommand.cs

示例4: CreatePayload

 // POST https://management.core.windows.net/<subscription-id>/services/mobileservices/
 /// <summary>
 /// The Xml payload that is created and sent to the Fabric with the create deployment parameters
 ///  <?xml version="1.0" encoding="utf-8"?>
 ///   <Application xmlns="http://schemas.microsoft.com/windowsazure">
 ///    <Name>##name##</Name> 
 ///    <Label>##label##</Label>
 ///    <Description>##description##</Description>
 ///    <Configuration>##spec##</Configuration>
 ///   </Application>
 /// </summary>
 /// <returns>A string Xml document representation</returns>
 protected override string CreatePayload()
 {
     XNamespace ns = Namespaces.NsWindowsAzure;
     var doc = new XDocument(
         new XDeclaration("1.0", "utf-8", ""),
         new XElement(ns + "Application",
                      new XElement(ns + "Name", Name.ToLower() + "mobileservice"),
                      new XElement(ns + "Label", Name.ToLower()),
                      new XElement(ns + "Description", Description),
                      new XElement(ns + "Configuration", Config)));
     return doc.ToStringFullXmlDeclaration();
 }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:24,代码来源:CreateMobileServiceCommand.cs

示例5: CreatePayload

        /*<ServerFarm  xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
             <Name>DefaultServerFarm</Name>
             <NumberOfWorkers>2</NumberOfWorkers>
             <WorkerSize>Small</WorkerSize>
            </ServerFarm>*/
        protected override string CreatePayload()
        {
            XNamespace xmlns = Namespaces.NsWindowsAzure;

            var doc = new XDocument(
                new XDeclaration("1.0", "utf-8", ""),
                new XElement(xmlns + "Name", Website.ServerFarm.Name),
                new XElement(xmlns + "NumberOfWorkers", Website.ServerFarm.InstanceCount),
                new XElement(xmlns + "WorkerSize", Website.ServerFarm.InstanceSize));

                return doc.ToStringFullXmlDeclaration();
        }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:17,代码来源:CreateWebsiteServerFarmCommand.cs

示例6: CreatePayload

 protected override string CreatePayload()
 {
     XNamespace ns = "http://schemas.microsoft.com/windowsazure";
     XNamespace array = "http://schemas.microsoft.com/2003/10/Serialization/Arrays";
     var doc = new XDocument(
             new XDeclaration("1.0", "utf-8", ""),
             new XElement(ns + "Site",
                                      new XElement(ns + "HostNames",
                                          new XElement(array + "string", Site.Name + ".azurewebsites.net")),
                                      new XElement(ns + "Name", Name),
                                      new XElement(ns + "State", State.ToString())));
     return doc.ToStringFullXmlDeclaration();
 }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:13,代码来源:WebsiteChangeStateCommand.cs

示例7: CreatePayload

        protected override string CreatePayload()
        {
            XNamespace xmlns = "http://schemas.microsoft.com/2003/10/Serialization/Arrays";

            if (!String.IsNullOrEmpty(Uri))
            {
                var doc = new XDocument(
                    new XDeclaration("1.0", "utf-8", ""),
                    new XElement(xmlns + "anyURI", Uri));
                return doc.ToStringFullXmlDeclaration();
            }

            return base.CreatePayload();
        }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:14,代码来源:CreateWebsiteRepositoryCommand.cs

示例8: CreatePayload

 protected override string CreatePayload()
 {
     /* <?xml version="1.0" encoding="utf-8"?>
         <CreateStorageServiceInput xmlns="http://schemas.microsoft.com/windowsazure">
            <ServiceName>service-name</ServiceName>
            <Description>service-description</Description>
            <Label>base64-encoded-label</Label>
            <AffinityGroup>affinity-group-name</AffinityGroup>
            <Location>location-of-the-storage-account</Location>
         </CreateStorageServiceInput>*/
     XNamespace ns = "http://schemas.microsoft.com/windowsazure";
     var doc = new XDocument(
         new XDeclaration("1.0", "utf-8", ""),
         new XElement(ns + "CreateStorageServiceInput",
                      new XElement(ns + "ServiceName", Name),
                      new XElement(ns + "Description", Description),
                      new XElement(ns + "Label", Convert.ToBase64String(Encoding.UTF8.GetBytes(Name))),
                      new XElement(ns + "Location", Location)));
     return doc.ToStringFullXmlDeclaration();
 }
开发者ID:noopman,项目名称:fluent-management,代码行数:20,代码来源:CreateStorageAccountCommand.cs

示例9: CreatePayload

        protected override string CreatePayload()
        {
            /*<entry xmlns='http://www.w3.org/2005/Atom'>
             * <content type='application/xml'>
             * <NamespaceDescription xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\">
             * <Region>{0}</Region>
             * </NamespaceDescription>
             * </content>
             * </entry>*/
            // Serialize NamespaceDescription, if additional properties needs to be specified http://msdn.microsoft.com/en-us/library/jj873988.aspx

            XNamespace ns = "http://www.w3.org/2005/Atom";
            XNamespace iXmlSchema = "http://www.w3.org/2001/XMLSchema-instance";
            XNamespace serviceBusSchema = "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect";

            XName i = iXmlSchema + "i";
            var doc = new XDocument(
                new XElement(ns + "entry",
                             new XElement(ns + "content", new XAttribute("type", "application/xml"),
                                          new XElement(serviceBusSchema + "NamespaceDescription", new XAttribute(i, "http://www.w3.org/2001/XMLSchema-instance"),
                                                       new XElement(serviceBusSchema + "Region", Location)))));
            return doc.ToStringFullXmlDeclaration();
        }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:23,代码来源:CreateServiceBusNamespaceCommand.cs

示例10: CreatePayload

 /// <summary>
 /// Creates a deployment payload for a predefined template 
 /// </summary>
 /// <returns>A string xml representation</returns>
 /// POST https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/deployments/<deployment-name>/roleinstances/<role-name>/Operations
 protected override string CreatePayload()
 {
     /*<ShutdownRoleOperation xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <OperationType>ShutdownRoleOperation</OperationType>
      * <PostShutdownAction>StoppedDeallocated</PostShutdownAction>
     </ShutdownRoleOperation>*/
     XNamespace ns = "http://schemas.microsoft.com/windowsazure";
     var doc = new XDocument(
         new XDeclaration("1.0", "utf-8", ""),
         new XElement(ns + "ShutdownRoleOperation",
                      new XElement(ns + "OperationType", "ShutdownRoleOperation"),
                      new XElement(ns + "PostShutdownAction", "StoppedDeallocated")));
     return doc.ToStringFullXmlDeclaration();
 }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:19,代码来源:StopVirtualMachineCommand.cs

示例11: CreatePayload

 //https://management.core.windows.net/<subscription-id>/certificates/
 /// <summary>
 /// The creation of the XML payload necessary to make the request
 /// </summary>
 protected override string CreatePayload()
 {
     XNamespace ns = "http://schemas.microsoft.com/windowsazure";
     var doc = new XDocument(
         new XDeclaration("1.0", "utf-8", ""),
         new XElement(ns + "CertificateFile",
                      new XElement(ns + "Data", Base64CertificateData),
                      new XElement(ns + "CertificateFormat", "pfx"),
                      new XElement(ns + "Password", PfxPassword)));
     return doc.ToStringFullXmlDeclaration();
 }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:15,代码来源:AddServiceCertificateCommand.cs

示例12: CreateXmlPayload

 /// <summary>
 /// Creates an Xml payload for the 
 /// </summary>
 /// <returns>The Xml string</returns>
 protected override string CreateXmlPayload()
 {
     /*<?xml version="1.0" encoding="utf-8"?>
         <ChangeConfiguration xmlns="http://schemas.microsoft.com/windowsazure">
            <Configuration>base-64-encoded-configuration-file</Configuration>
            <TreatWarningsAsError>true|false</TreatWarningsAsError>
            <Mode>Auto|Manual</Mode>
            <ExtendedProperties>
               <ExtendedProperty>
                  <Name>property-name</Name>
                  <Value>property-value</Value>
               </ExtendedProperty>
            </ExtendedProperties>
         </ChangeConfiguration>*/
     XNamespace ns = "http://schemas.microsoft.com/windowsazure";
     var doc = new XDocument(
         new XDeclaration("1.0", "utf-8", ""),
         new XElement(ns + "ChangeConfiguration",
                      new XElement(ns + "Configuration", Convert.ToBase64String(Encoding.UTF8.GetBytes(Configuration.ToString()))),
                      new XElement(ns + "Mode", "Auto"),
                      new XElement(ns + "TreatWarningsAsError", true.ToString().ToLower())));
     return doc.ToStringFullXmlDeclaration();
 }
开发者ID:wenming,项目名称:fluent-management,代码行数:27,代码来源:SetDeploymentConfigurationCommand.cs

示例13: BuildXmlPayload

 /// <summary>
 /// This method builds up wht payload but currently only builds the logging and not the hourly or minute metrics
 /// </summary>
 private string BuildXmlPayload()
 {
     var doc = new XDocument(
         new XDeclaration("1.0", "utf-8", ""),
         new XElement("StorageServiceProperties",
                      new XElement("Logging",
                          new XElement("Version", "1.0"),
                          new XElement("Delete", "true"),
                          new XElement("Read", "true"),
                          new XElement("Write", "true"),
                          new XElement("RetentionPolicy",
                              new XElement("Enabled", "true"),
                              new XElement("Days", "7")))));
     return doc.ToStringFullXmlDeclaration();
 }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:18,代码来源:EnableStorageAnalyticsCommand.cs

示例14: CreatePayload

 /// <summary>
 /// Creates a deployment payload for a predefined template 
 /// </summary>
 /// <returns>A string xml representation</returns>
 /// POST https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/deployments/<deployment-name>/roleinstances/<role-name>/Operations
 protected override string CreatePayload()
 {
     /*<OSImage xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <Label>image-label</Label>
        <MediaLink>uri-of-the-containing-blob</MediaLink>
        <Name>image-name</Name>
        <OS>Linux|Windows</OS>
        <Eula>image-eula</Eula>
        <Description>image-description</Description>
        <ImageFamily>image-family</ImageFamily>
        <PublishedDate>published-date</PublishedDate>
        <IsPremium>true/false</IsPremium>
        <ShowInGui>true/false</ShowInGui>
        <PrivacyUri>http://www.example.com/privacypolicy.html</PrivacyUri>
        <IconUri>http://www.example.com/favicon.png</IconUri>
        <RecommendedVMSize>Small/Large/Medium/ExtraLarge</RecommendedVMSize>
        <SmallIconUri>http://www.example.com/smallfavicon.png</SmallIconUri>
        <Language>language-of-image</Language>
     </OSImage>*/
     XNamespace ns = "http://schemas.microsoft.com/windowsazure";
     var doc = new XDocument(
         new XDeclaration("1.0", "utf-8", ""),
         new XElement(ns + "OSImage",
                      new XElement(ns + "Label", Properties.Label),
                      new XElement(ns + "MediaLink", Properties.MediaLink),
                      new XElement(ns + "Name", Properties.Name),
                      new XElement(ns + "OS", Properties.OperatingSystem.ToString()),
                      new XElement(ns + "PublishedDate", Properties.PublishedDate.ToString("s")),
                      new XElement(ns + "IsPremium", Properties.IsPremium.ToString().ToLowerInvariant()),
                      new XElement(ns + "ShowInGui", Properties.ShowInGui.ToString().ToLowerInvariant())));
     return doc.ToStringFullXmlDeclaration();
 }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:37,代码来源:RegisterImageCommand.cs

示例15: CreateXmlPayload

 protected override string CreateXmlPayload()
 {
     XNamespace ns = SqlAzureSchema;
     var doc = new XDocument(
         new XDeclaration("1.0", "utf-8", ""),
         new XElement(ns + "Server",
                      new XElement(ns + "AdministratorLogin", AdministratorLogin),
                      new XElement(ns + "AdministratorLoginPassword", AdministratorPassword),
                      new XElement(ns + "Location", Location)));
     return doc.ToStringFullXmlDeclaration();
 }
开发者ID:RonnyA,项目名称:fluent-management,代码行数:11,代码来源:AddNewSqlServerCommand.cs


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