github.com/simonferquel/app@v0.6.1-0.20181012141724-68b7cccf26ac/integrations/visualstudio/dockerappvsix/GlobalsExtensions.cs (about)

     1  using EnvDTE;
     2  using System;
     3  using System.Collections.Generic;
     4  using System.Linq;
     5  using System.Text;
     6  using System.Threading.Tasks;
     7  
     8  namespace dockerappvsix
     9  {
    10      static class GlobalsExtensions
    11      {
    12          public static T GetOrNull<T>(this Globals g, string key) where T : class
    13          {
    14              if (!g.VariableExists[key]) {
    15                  return null;
    16              }
    17              return g[key] as T;
    18          }
    19      }
    20  }