-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathSplitStyles.cs
More file actions
28 lines (26 loc) · 803 Bytes
/
SplitStyles.cs
File metadata and controls
28 lines (26 loc) · 803 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.SplitStyles static member to move styles from
/// the Features to the enclosing Document and sets the Feature.StyleUrl
/// to reference the new style.
/// </summary>
public static class SplitStyles
{
public static void Run()
{
KmlFile file = Program.OpenFile("Enter a file to split the styles:");
if (file == null)
{
return;
}
var split = StyleResolver.SplitStyles(file.Root);
var serializer = new Serializer();
serializer.Serialize(split);
Console.WriteLine(serializer.Xml);
}
}
}