Ejemplo n.º 1
0
        private void DoComputeRuns(string key, int edit, string text, ILanguage language)
        {
            var runs = new List<StyleRun>();
            var sw = language.SafeBoss().Get<IStyleWith>();
            DoRegexMatch(text, sw.Language, runs);
            Log.WriteLine(TraceLevel.Verbose, "Styler", "computed {0} runs for {1} edit {2}", runs.Count, System.IO.Path.GetFileName(key), edit);

            var data = new StyleRuns(language.SafeBoss(), key, edit, runs.ToArray());

            if (language.SafeBoss().Has<IStyler>())
            {
                var post = language.SafeBoss().Get<IStyler>();
                post.PostProcess(data);
            }
            else
            {
                NSApplication.sharedApplication().BeginInvoke(
                    () => Broadcaster.Invoke("computed style runs", data));
            }
        }