private StringBuilder DisplayFieldDeclarationWalkerVB(VNCCA.SearchTreeCommandConfiguration commandConfiguration) { long startTicks = Log.Trace15("Enter", Common.LOG_APPNAME); VNCCA.SyntaxNode.FieldDeclarationLocation fieldDeclarationLocation = VNCCA.SyntaxNode.FieldDeclarationLocation.Class; // TODO(crhodes) // Go look at EyeOnLife and see how to do this in a cleaner way. switch (lbeFieldDeclarationLocation.EditValue.ToString()) { case "Class": fieldDeclarationLocation = VNCCA.SyntaxNode.FieldDeclarationLocation.Class; break; case "Module": fieldDeclarationLocation = VNCCA.SyntaxNode.FieldDeclarationLocation.Module; break; case "Structure": fieldDeclarationLocation = VNCCA.SyntaxNode.FieldDeclarationLocation.Structure; break; } VNCSW.VB.VNCVBTypedSyntaxWalkerBase walker = null; walker = new VNCSW.VB.FieldDeclaration(fieldDeclarationLocation); walker.HasAttributes = (bool)CodeExplorer.configurationOptions.ceHasAttributes.IsChecked; commandConfiguration.WalkerPattern.UseRegEx = (bool)ceFieldDeclarationUseRegEx.IsChecked; commandConfiguration.WalkerPattern.RegEx = teFieldDeclarationRegEx.Text; commandConfiguration.CodeAnalysisOptions = CodeExplorer.configurationOptions.GetConfigurationInfo(); Log.Trace15("Exit", Common.LOG_APPNAME, startTicks); return(VNCCA.Helpers.VB.InvokeVNCSyntaxWalker(walker, commandConfiguration)); }
private StringBuilder Remove_FieldDeclarationVB(VNCCA.RewriteFileCommandConfiguration commandConfiguration, out bool performedReplacement) { performedReplacement = false; VNCCA.SyntaxNode.FieldDeclarationLocation fieldDeclarationLocation = VNCCA.SyntaxNode.FieldDeclarationLocation.Class; // TODO(crhodes) // Go look at EyeOnLife and see how to do this in a cleaner way. switch (lbeFieldDeclarationLocation.EditValue.ToString()) { case "Class": fieldDeclarationLocation = VNCCA.SyntaxNode.FieldDeclarationLocation.Class; break; case "Module": fieldDeclarationLocation = VNCCA.SyntaxNode.FieldDeclarationLocation.Module; break; case "Structure": fieldDeclarationLocation = VNCCA.SyntaxNode.FieldDeclarationLocation.Structure; break; } var rewriter = new VNC.CodeAnalysis.SyntaxRewriters.VB.RemoveFieldDeclaration( commandConfiguration.TargetPattern, fieldDeclarationLocation, (Boolean)ceCommentOut_FieldDeclaration.IsChecked, teComment.Text); rewriter.Messages = commandConfiguration.Results; rewriter._configurationOptions = commandConfiguration.CodeAnalysisOptions; SyntaxNode newNode = rewriter.Visit(commandConfiguration.SyntaxTree.GetRoot()); performedReplacement = VNCSR.Helpers.SaveFileChanges(commandConfiguration, newNode); return(commandConfiguration.Results); }