GetSolution() публичный статический Метод

public static GetSolution ( ) : string
Результат string
Пример #1
0
        public static void IgnoreSolution(bool ignore)
        {
            WritableSettingsStore wstore = _settings.GetWritableSettingsStore(SettingsScope.UserSettings);

            if (!wstore.CollectionExists(Constants.VSIX_NAME))
            {
                wstore.CreateCollection(Constants.VSIX_NAME);
            }

            string solution = VSPackage.GetSolution();

            if (string.IsNullOrEmpty(solution))
            {
                return;
            }

            string property = GetPropertyName(solution);

            if (ignore)
            {
                wstore.SetInt32(Constants.VSIX_NAME, property, 1);
            }
            else
            {
                wstore.DeleteProperty(Constants.VSIX_NAME, property);
            }
        }
        private void ShowDialog(object sender, EventArgs e)
        {
            string fileName = Path.ChangeExtension(VSPackage.GetSolution(), Constants.EXTENSION);

            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }

            string emptyFile = @"{
  ""extensions"": {
    ""mandatory"": [
      {
        ""name"": ""Web Compiler"",
        ""productId"": ""148ffa77-d70a-407f-892b-9ee542346862"",
        ""link"": ""https://visualstudiogallery.msdn.microsoft.com/3b329021-cd7a-4a01-86fc-714c2d05bb6c"",
        ""description"": ""We use this to compile LESS and CoffeeScript files""
      }
    ]
  }
}";

            if (!File.Exists(fileName))
            {
                File.WriteAllText(fileName, emptyFile, new UTF8Encoding(true));
            }

            var dte = ServiceProvider.GetService(typeof(DTE)) as DTE2;

            dte.ItemOperations.OpenFile(fileName);
        }
Пример #3
0
        private void ShowDialog(object sender, EventArgs e)
        {
            string fileName = Path.ChangeExtension(VSPackage.GetSolution(), Constants.EXTENSION);

            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }

            string emptyFile = @"{
  ""extensions"": {
    ""mandatory"": [
      {
        ""name"": ""Web Compiler"",
        ""productId"": ""148ffa77-d70a-407f-892b-9ee542346862""
      }
    ]
  }
}";

            if (!File.Exists(fileName))
            {
                File.WriteAllText(fileName, emptyFile, new UTF8Encoding(true));
            }

            var dte = ServiceProvider.GetService(typeof(DTE)) as DTE2;

            dte.ItemOperations.OpenFile(fileName);
        }
        private async void ExtensionFileFound(object sender, ExtensionFileEventArgs e)
        {
            string solution = VSPackage.GetSolution();

            if (!Settings.IsSolutionIgnored())
            {
                bool missingExtensions = await HasMissingExtensions(e.Model);

                if (missingExtensions)
                {
                    await ShowDialog(e.Model);
                }
            }
        }
Пример #5
0
        public static bool IsSolutionIgnored()
        {
            SettingsStore store = _settings.GetReadOnlySettingsStore(SettingsScope.UserSettings);

            string solution = VSPackage.GetSolution();

            if (string.IsNullOrEmpty(solution))
            {
                return(false);
            }

            string property = GetPropertyName(solution);

            return(store.PropertyExists(Constants.VSIX_NAME, property));
        }
Пример #6
0
        private void _button_BeforeQueryStatus(object sender, EventArgs e)
        {
            var button = (OleMenuCommand)sender;

            button.Enabled = false;

            string solution = VSPackage.GetSolution();

            if (string.IsNullOrEmpty(solution))
            {
                return;
            }

            string fileName = Path.ChangeExtension(solution, Constants.EXTENSION);

            button.Enabled = File.Exists(fileName);
        }
        private void BeforeQueryStatus(object sender, EventArgs e)
        {
            var button = (OleMenuCommand)sender;

            button.Enabled = !string.IsNullOrEmpty(VSPackage.GetSolution());
        }