private void ProcessEqualsKey(SyntaxEditor syntaxEditor)
 {
     this.resolver = syntaxEditor.Document.LanguageData as DotNetProjectResolver;
     CSharpExtendedSyntaxLanguage.ForceSynchronousReparse(syntaxEditor.Document);
     if (!this.IsEventInsertion(syntaxEditor))
     {
         return;
     }
     this.isPotentiallyAddingEvent = this.InitializeEventData();
 }
예제 #2
0
        internal static void EnsureResolverCachePruned(DotNetProjectResolver projectResolver)
        {
            if (CodeProject.hasPruned)
            {
                return;
            }
            BackgroundWorker backgroundWorker = new BackgroundWorker();

            backgroundWorker.DoWork             += new DoWorkEventHandler(CodeProject.IntellisenseCachePruner_DoWork);
            backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CodeProject.IntellisenseCachePruner_RunWorkerCompleted);
            backgroundWorker.RunWorkerAsync((object)projectResolver);
            CodeProject.hasPruned = true;
        }
        /// <summary>
        /// Gets the <see cref="DotNetContext"/> for the specified offset.
        /// </summary>
        /// <param name="syntaxEditor">The <see cref="SyntaxEditor"/> to examine.</param>
        /// <param name="offset">The offset at which to base the context.</param>
        /// <param name="beforeOffset">Whether to return the context before the offset.</param>
        /// <param name="forParameterInfo">Whether to return the context for parameter info.</param>
        /// <returns>The <see cref="DotNetContext"/> for the specified offset.</returns>
        protected DotNetContext GetContext(SyntaxEditor syntaxEditor, int offset, bool beforeOffset, bool forParameterInfo)
        {
            // Get the compilation unit and project resolver
            CompilationUnit       compilationUnit = syntaxEditor.Document.SemanticParseData as CompilationUnit;
            DotNetProjectResolver projectResolver = syntaxEditor.Document.LanguageData as DotNetProjectResolver;

            // Get the context
            if (beforeOffset)
            {
                return(CSharpContext.GetContextBeforeOffset(syntaxEditor.Document, offset, compilationUnit, projectResolver, forParameterInfo));
            }
            else
            {
                return(CSharpContext.GetContextAtOffset(syntaxEditor.Document, offset, compilationUnit, projectResolver));
            }
        }
 private void UpdateInternalState(SyntaxEditor editor)
 {
     if (!this.isPotentiallyAddingEvent)
     {
         this.context              = (DotNetContext)null;
         this.domMember            = (IDomMember)null;
         this.resolver             = (DotNetProjectResolver)null;
         this.methodName           = (string)null;
         this.eventHandlerTypeName = (string)null;
         this.parameters           = (IEnumerable <IParameterDeclaration>)null;
         this.returnType           = (Type)null;
     }
     else
     {
         this.ShowQuickInfo(editor);
     }
 }
예제 #5
0
        private static void IntellisenseCachePruner_DoWork(object sender, DoWorkEventArgs e)
        {
            DotNetProjectResolver netProjectResolver = (DotNetProjectResolver)e.Argument;
            string str = Microsoft.Expression.Framework.Documents.PathHelper.ResolveRelativePath(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), CodeProject.IntellisenseCachePath);

            netProjectResolver.CachePath = str;
            if (!Microsoft.Expression.Framework.Documents.PathHelper.DirectoryExists(netProjectResolver.CachePath))
            {
                return;
            }
            try
            {
                netProjectResolver.PruneCache();
            }
            catch (IOException ex)
            {
            }
            catch (UnauthorizedAccessException ex)
            {
            }
        }