コード例 #1
0
    public void Save(XmlWriter xmlWriter, string sectionName)
    {
        Assert.IsNotNull(xmlWriter);
        Assert.IsNotNull(sectionName);

        xmlWriter.WriteStartElement(sectionName);
        ConfigurationWriter.Write(xmlWriter, RootNode.Attributes);

        foreach (var childNode in RootNode.ChildNodes)
        {
            ConfigurationWriter.WriteNode(xmlWriter, childNode);
        }

        xmlWriter.WriteEndElement();
    }
コード例 #2
0
        private void Copy_Click(object sender, EventArgs e)
        {
            var stringWriter  = new StringWriter();
            var xmlTextWriter = new XmlTextWriter(stringWriter)
            {
                Formatting = Formatting.Indented
            };

            foreach (var node in SelectedConfigurationNodes)
            {
                ConfigurationWriter.WriteNode(xmlTextWriter, node);
            }

            var s = stringWriter.ToString();

            Clipboard.SetText(s);
        }
コード例 #3
0
        private void Copy_Click(object sender, EventArgs e)
        {
            var stringWriter  = new StringWriter();
            var xmlTextWriter = new XmlTextWriter(stringWriter);

            xmlTextWriter.Formatting = Formatting.Indented;

            foreach (var node in SelectedConfigurationNodes)
            {
                var connectionProperties = new ConnectionProperties();
                connectionProperties.Load(node);
                ConfigurationWriter.WriteNode(xmlTextWriter, node);
            }

            var s = stringWriter.ToString();

            Clipboard.SetText(s);
        }