private void SetPreview(RamlDocument document) { Execute.OnUIThreadAsync(() => { try { ResourcesPreview = GetResourcesPreview(document); StopProgress(); SetNamespace(RamlTempFilePath); if (document.Version != null) { ApiVersion = NetNamingMapper.GetVersionName(document.Version); } CanImport = true; if (NetNamingMapper.HasIndalidChars(Filename)) { ShowErrorAndStopProgress("The specied file name has invalid chars"); // txtFileName.Focus(); } } catch (Exception ex) { ShowErrorAndStopProgress("Error while parsing raml file. " + ex.Message); ActivityLog.LogError(VisualStudioAutomationHelper.RamlVsToolsActivityLogSource, VisualStudioAutomationHelper.GetExceptionInfo(ex)); } }); }
private static string GetVersionPrefix(bool includeApiVersionInRoutePrefix, string apiVersion) { return(includeApiVersionInRoutePrefix ? NetNamingMapper.GetVersionName(apiVersion) : string.Empty); }