/// <summary>
 /// Validate the xmlDefinition
 /// </summary>
 /// <remarks>If layout is null, the xml is not validated</remarks>
 /// <param name="layout"></param>
 /// <param name="xmlDefinition"></param>
 public static void ValidateDefinition(this Layout layout, string xmlDefinition)
 {
     if (layout != null)
     {
         CIMUtilities.ValidateXML(xmlDefinition);
     }
 }
Exemple #2
0
 public static void ValidateDefinition(this Element element, string xmlDefinition)
 {
     if (element != null)
     {
         CIMUtilities.ValidateXML(xmlDefinition);
     }
 }
 public static void ValidateDefinition(this MapMember mm, string xmlDefinition)
 {
     if (mm != null)
     {
         CIMUtilities.ValidateXML(xmlDefinition);
     }
 }
Exemple #4
0
 public static Task SetDefinitionAsync(this Element element, string xmlDefinition)
 {
     CIMUtilities.ValidateXML(xmlDefinition);//This can throw!
     return(QueuedTask.Run(() => {
         var cimElement = CIMUtilities.DeserializeXmlDefinition <CIMElement>(xmlDefinition);
         element.SetDefinition(cimElement);
     }));
 }
 /// <summary>
 /// Set the definition of the layout to the new "xmlDefinition"
 /// </summary>
 /// <remarks>Will throw if the xmlDefinition is invalid</remarks>
 /// <param name="layout"></param>
 /// <param name="xmlDefinition"></param>
 /// <returns></returns>
 public static Task SetDefinitionInternalAsync(this Layout layout, string xmlDefinition)
 {
     CIMUtilities.ValidateXML(xmlDefinition);
     return(QueuedTask.Run(() => {
         var cimLayout = CIMUtilities.DeserializeXmlDefinition <CIMLayout>(xmlDefinition);
         layout.SetDefinition(cimLayout);
     }));
 }
Exemple #6
0
 /// <summary>
 /// Set the definition of the map to the new "xmlDefinition"
 /// </summary>
 /// <remarks>Will throw if the xmlDefinition is invalid</remarks>
 /// <param name="map"></param>
 /// <param name="xmlDefinition"></param>
 /// <returns></returns>
 public static Task SetDefinitionInternalAsync(this Map map, string xmlDefinition)
 {
     CIMUtilities.ValidateXML(xmlDefinition);
     return(QueuedTask.Run(() => {
         var cimMap = CIMUtilities.DeserializeXmlDefinition <CIMMap>(xmlDefinition);
         map.SetDefinition(cimMap);
     }));
 }
 public static Task SetDefinitionAsync(this MapMember mm, string xmlDefinition)
 {
     CIMUtilities.ValidateXML(xmlDefinition);//This can throw!
     return(QueuedTask.Run(() => {
         if (mm is Layer)
         {
             var baseLayer = CIMUtilities.DeserializeXmlDefinition <CIMBaseLayer>(xmlDefinition);
             ((Layer)mm).SetDefinition(baseLayer);
         }
         else
         {
             var table = CIMUtilities.DeserializeXmlDefinition <CIMStandaloneTable>(xmlDefinition);
             ((StandaloneTable)mm).SetDefinition(table);
         }
     }));
 }