forked from samcragg/sharpkml
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInlineStyles.cs
More file actions
28 lines (26 loc) · 815 Bytes
/
InlineStyles.cs
File metadata and controls
28 lines (26 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using SharpKml.Base;
using SharpKml.Engine;
namespace Examples
{
/// <summary>
/// Uses the StyleResolver.InlineStyles static method to create a new
/// Element that has the styles inside the Feature instead of using
/// shared styles and specifying a StyleUrl.
/// </summary>
public static class InlineStyles
{
public static void Run()
{
KmlFile file = Program.OpenFile("Enter a file to inline the styles:");
if (file == null)
{
return;
}
var inlined = StyleResolver.InlineStyles(file.Root);
var serializer = new Serializer();
serializer.Serialize(inlined);
Console.WriteLine(serializer.Xml);
}
}
}