Ejemplo n.º 1
0
 public static string ConvertToTypeScript(ProjectItem sourceItem)
 {
     try
     {
         Options.ReadOptionOverrides(sourceItem);
         VSHelpers.WriteOnOutputWindow(string.Format("{0} - Started", sourceItem.Name));
         var list = IntellisenseParser.ProcessFile(sourceItem);
         // path is needed for relative paths of imports
         var sourceItemPath = sourceItem.Properties.Item("FullPath").Value as string;
         VSHelpers.WriteOnOutputWindow(string.Format("{0} - Completed", sourceItem.Name));
         return(IntellisenseWriter.WriteTypeScript(list.ToList(), sourceItemPath));
     }
     catch (Exception ex)
     {
         VSHelpers.WriteOnOutputWindow(string.Format("{0} - Failure", sourceItem.Name));
         if (ex is ExceptionForUser)
         {
             // "expected" exception, show to user instead of reporting
             VSHelpers.WriteOnOutputWindow(ex.Message);
         }
         else
         {
             Telemetry.TrackException("ParseFailure", ex);
         }
         return(null);
     }
 }
 public static string ConvertToTypeScript(ProjectItem sourceItem)
 {
     try
     {
         var list = IntellisenseParser.ProcessFile(sourceItem);
         return(IntellisenseWriter.WriteTypeScript(list));
     }
     catch (Exception ex)
     {
         Telemetry.TrackException("ParseFailure", ex);
         return(null);
     }
 }
 public static string ConvertToTypeScript(ProjectItem sourceItem)
 {
     try
     {
         Options.ReadOptionOverrides(sourceItem);
         VSHelpers.WriteOnOutputWindow(string.Format("{0} - Started", sourceItem.Name));
         var list = IntellisenseParser.ProcessFile(sourceItem);
         VSHelpers.WriteOnOutputWindow(string.Format("{0} - Completed", sourceItem.Name));
         return(IntellisenseWriter.WriteTypeScript(list));
     }
     catch (Exception ex)
     {
         VSHelpers.WriteOnOutputWindow(string.Format("{0} - Failure", sourceItem.Name));
         Telemetry.TrackException("ParseFailure", ex);
         return(null);
     }
 }