コード例 #1
0
 private async Task SyncThemeAsync(TmNode node)
 {
     Debug.Assert(node != null, "There is no bound TMNode for this property panel");
     if (node == null)
     {
         MessageBox.Show("Internal Error:  Unable to find the node to sync.");
         return;
     }
     if (node.HasChildren)
     {
         SyncThemes(node);
     }
     else
     {
         if (string.IsNullOrEmpty(node.Metadata.Path))
         {
             MessageBox.Show("Theme has no metadata");
             return;
         }
         try
         {
             // May need to load/verify metadata which could throw.
             // No need to recurse, since we just checked that we have no children.
             await node.SyncWithMetadataAsync(false);
         }
         catch (Exception ex)
         {
             MessageBox.Show($"Metadata Error: {ex.Message}.");
         }
     }
 }