Esempio n. 1
0
        public void MarkErrors(string text)
        {
            ErrorsWindow.Clear();
            var errors = new HashSet <string>();
            var regex  = new Regex(@"(?<=Target Build.*Project ""(?<proj>[^""]*)"" \(default target\(s\)\):.*?)(?<doc>[^ \t\n\r]*)\((?<line>[0-9]+),(?<col>[0-9]+)\):\s*(?<type>error|warning)\s+(?<key>[A-Z0-9]+):(?<msg>[^\r\n]*)\r?\n", RegexOptions.Singleline);

            foreach (Match m in regex.Matches(text))
            {
                if (errors.Contains(m.Value))
                {
                    continue;
                }
                errors.Add(m.Value);
                var proj = m.Groups["proj"].Value;
                var doc  = m.Groups["doc"].Value;
                var type = m.Groups["type"].Value;
                var line = m.Groups["line"].Value;
                var col  = m.Groups["col"].Value;
                var key  = m.Groups["key"].Value;
                var msg  = m.Groups["msg"].Value;
                //proj = Path.GetFileNameWithoutExtension(proj);
                if (type == "error")
                {
                    ErrorsWindow.AddError(type + " " + key + ": " + msg, type + " " + key, doc, int.Parse(line), int.Parse(col), proj);
                }
                else
                {
                    ErrorsWindow.AddWarning(msg, key, doc, int.Parse(line), int.Parse(col), proj);
                }
            }
        }
Esempio n. 2
0
        protected override void Initialize()
        {
            var settingsManager            = new ShellSettingsManager(this);
            var configurationSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);

            UserSettingsManager.Initialize(configurationSettingsStore);
            base.Initialize();
            var dte = (DTE)GetService(typeof(DTE));

            services = new Services(dte);
            //TryRegisterAssembly();

            ErrorsWindow.Initialize(this);
            StatusBar.Initialize(this);
            Options.Initialize(this);

            /* Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary {
             *      Source = new Uri("/MonoTools;component/Resources/Resources.xaml", UriKind.Relative)
             * }); */

            var mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            InstallMenu(mcs);
        }