Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert datetime.now via code snippet comment block
Message
From
16/04/2008 17:31:00
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
16/04/2008 14:51:51
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
Miscellaneous
Thread ID:
01311174
Message ID:
01311305
Views:
20
Charles,

I think the Refactor for Visual Basic is free.
http://www.devexpress.com/Products/NET/IDETools/VBRefactor/
Tim


>Thanks, Paul. Yeah, I'm getting the impression intellisense ain't gonna do it, but I have learned some cool stuff about macros. I've figured out how to create the macro to do what I want
>
>
>    Sub InsertCRH()
>        Dim textSelection As EnvDTE.TextSelection
>
>        textSelection = CType(DTE.ActiveDocument.Selection(), EnvDTE.TextSelection)
>        textSelection.Text = "' CRH: " & System.DateTime.Now.ToString() & CrLf _
>        & "' "
>
>    End Sub
>
>
>and how to drag that onto the toolbar for easy access. By adding CRH as a tasklist token i can now find all my own comments I insert into code easily.
>
>And while messing around with that I put the CommentRegion() macro on the toolbar and then wrote an Uncomment macro
>
>
>  Sub UncommentBlock()
>        Dim current As String
>        current = DTE.ActiveDocument.Name
>
>        DTE.ExecuteCommand("Edit.Find")
>        DTE.ExecuteCommand("Edit.SwitchtoQuickReplace")
>        DTE.ExecuteCommand("Edit.SelectAll")
>        DTE.Windows.Item(current).Activate()
>
>        DTE.Find.FindWhat = "'"
>        DTE.Find.ReplaceWith = ""
>        DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocumentSelection
>        DTE.Find.MatchCase = False
>        DTE.Find.MatchWholeWord = False
>        DTE.Find.MatchInHiddenText = True
>        DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral
>        DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone
>        DTE.Find.Action = vsFindAction.vsFindActionReplaceAll
>        If (DTE.Find.Execute() = vsFindResult.vsFindResultNotFound) Then
>            Throw New System.Exception("vsFindResultNotFound")
>        End If
>        DTE.Windows.Item("{CF2DDC32-8CAD-11D2-9302-005345000000}").Close()
>    End Sub
>
>
>as I couldn't find an equivalent in VB 2008 for what we've had in VFP.
>
>Love the VS IDE but can see there is still room for improvement <g>
>
>
>
>>>I am having fun with the VB code snippet editor. i want to be able to insert a comment block with my initials and current datetime and don't seem to have the magic formula. Have this in CEE but trying to figure it out in VB
>>>
>>>'CRH: Wednesday 03/16/08
>>>' Insert comment here
>>>'
>>
>>I could be wrong, but I don't think code snippets support this kind of thing - you'd have to do this as a macro (at least, that's my foggy memory of things since I wanted to do something very similar).
>>
>>I ended up using Coderush/Refactor! from DevExpress and writing a very simple plug-in for it. Actually Coderush can be downloaded for free (just without all of the extras). If you decide to go this route, let me know. You're welcome to this code/plug in.
>
>I'll check out the DevExpress thing you referenced and let you know.
>
>Thanks again
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform