本文整理汇总了C#中GraphicsLayer.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsLayer.GetType方法的具体用法?C# GraphicsLayer.GetType怎么用?C# GraphicsLayer.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsLayer
的用法示例。
在下文中一共展示了GraphicsLayer.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: serializeLayer
string serializeLayer(GraphicsLayer layer)
{
Dictionary<string, string> Namespaces = new Dictionary<string, string>();
Namespaces.Add("x", "http://schemas.microsoft.com/winfx/2006/xaml");
Namespaces.Add(ESRI.ArcGIS.Mapping.Core.Constants.esriPrefix, ESRI.ArcGIS.Mapping.Core.Constants.esriNamespace);
Namespaces.Add("esriBing", "clr-namespace:ESRI.ArcGIS.Client.Bing;assembly=ESRI.ArcGIS.Client.Bing");
Namespaces.Add(ESRI.ArcGIS.Mapping.Core.Constants.esriMappingPrefix, ESRI.ArcGIS.Mapping.Core.Constants.esriMappingNamespace);
Namespaces.Add(ESRI.ArcGIS.Mapping.Core.Constants.esriFSSymbolsPrefix, ESRI.ArcGIS.Mapping.Core.Constants.esriFSSymbolsNamespace);
Namespaces.Add(ESRI.ArcGIS.Mapping.Core.Constants.esriExtensibilityPrefix, ESRI.ArcGIS.Mapping.Core.Constants.esriExtensibilityNamespace);
StringBuilder xaml = new StringBuilder();
XmlWriter writer = XmlWriter.Create(xaml, new XmlWriterSettings() { OmitXmlDeclaration = true });
writer.WriteStartElement("ContentControl");
// write namespaces
foreach (string key in Namespaces.Keys)
{
string _namespace = "http://schemas.microsoft.com/winfx/2006/xaml"; // default
if (Namespaces.ContainsKey(key))
_namespace = Namespaces[key];
writer.WriteAttributeString("xmlns", key, null, _namespace);
}
ESRI.ArcGIS.Mapping.Core.GraphicsLayerXamlWriter layerWriter = new Core.GraphicsLayerXamlWriter(writer, Namespaces);
layerWriter.WriteLayer(layer, layer.GetType().Name, ESRI.ArcGIS.Mapping.Core.Constants.esriNamespace);
writer.WriteEndElement();
writer.Flush();
writer = null;
string config = xaml.ToString();
// Inject default namespace
config = config.Insert(16, "xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" ");
return config;
}