Exemplo n.º 1
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                // Stop the parser service... note that you should only do this if you are closing your application down
                //   and are sure no other languages are still using the service... in the case of this sample project,
                //   each QuickStart Form is modal so we know another window doesn't have a language that is still accessing the service
                SemanticParserService.Stop();

                // Dispose the project resolver... this releases all its resources
                try
                {
                    dotNetProjectResolver.Dispose();
                }
                catch
                {
                    // Do nothing
                }

                // Prune the cache to remove files that no longer apply... note that you should only do this if you are closing your application down
                //   and are sure no other project resolvers are still using the cache... in the case of this sample project,
                //   each QuickStart Form is modal so we know another window is still not accessing the cache
                dotNetProjectResolver.PruneCache();

                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }
 internal static void ForceSynchronousReparse(Document document)
 {
     lock (CSharpExtendedSyntaxLanguage.SemanticParserSyncLock)
     {
         if (document == null)
         {
             return;
         }
         SemanticParserService.Stop();
         SemanticParserService.Parse(new SemanticParserServiceRequest(0, document, new ActiproSoftware.SyntaxEditor.TextRange(0, document.Length + 1), SemanticParseFlags.None, (ISemanticParserServiceProcessor)document.Language, (ISemanticParseDataTarget)document));
         SemanticParserService.Start();
     }
 }