| < Free Open Study > |
|
C#
add-in, creating, 325-329
Block Commenting C# code, 353-354
C# clock application, 318-324
cloning a Proc in C# code, 354-355
code for Form1 (code listing), 320-323
debugging in, 89
event handlers and, 359
templates for, 281
to-do item in Task List, 385
Visual Basic comparison, 318-325
C# clock application, 318-324
Visual Basic clock application, 324-325
C++, 6, 89, 101-102, 318, 461
characters, comment, 413
CkForRemindOfDefaultName method, 383, 387
class, form or module, adding new, 491
Click event, 224
Clipboard object
changes in .NET, 70
rewriting code in .NET, 451
upgrading to .NET, 442
Clipboard Ring tool window, 302, 304-305
clock applications
Visual Basic, 324-325
Visual C#, 318-324
CloneProc form code (code listing), 129-134
CloneProcedure
code listing, 128-129
enhancing, 258-261
method, modified (code listing), 258-259
running modified feature, 261-262
cloning
Proc in C# code, 354-355
a procedure, 126-136
CloseSavedWindows macro (code listing), 242-243
CmdName parameter (QueryStatus), 41
CMenuHandler class, 405-408
CMenuHandler class (code listing), 407-408
code. See also code listings; code, manipulating in windows
adding system tray to connect class, 228-230
analyzing with CodeModel object, 503
automating error handling production, 103-109
CloneProc form, 129-134
completed form (listing), 174-177
inserting at top of modules, 123-124
manipulating without parsing, 8
modified to add menus (code listing), 183-187
opening all, 502
replacing in TextEditor window (code listing), 122-123
retrieving from documents (code listing), 121-122
retrieving from TextEditor (code listing), 121
stepping through complex, 93
Code Complete (Microsoft Press), 87
Code Editor, 115-120
EditPoint object, 116-118
TextPoint object, 116-118
TextSelection object, 116-118
VirtualPoint object, 116, 118-120
window, retrieving procedures from, 482-484
code listings
Add-in Wizard
Exec event, 42-43
moving CommandObj to module level, 31
OnConnection method, changes to, 31-32
OnDisconnection method, changes to, 32
QueryStatus event, 42
registry keys for add-in, 35
Wizard generated code, 27-30
add-ins overview
comment selected block, 3
displaying DTE properties, 5-6
registry entry, creating, 13
VB 6.0 add-in code, 11-13
automation events
BuildEvents object event handlers, 375-376
CommandEvents object event handlers, 374-375
Connect class declaration section, 378-380
CReminder class, 388-389
DebuggerEvents object event handlers, 372-373
DocumentEvents object event handlers, 371-372
DTEEvents object event handlers, 370
event handler, 360
FindEvents object, 369-370
OnChanged event handler, 367-368
OutputWindowEvents event handlers, 369
ProjectItemsEvents object event handlers, 377
ProjectsEvents event handlers, 362
SolutionEvents object event handler, 366-367
TaskListEvents ItemAdded event, 385
TaskListEvents object event handler, 365
TaskRemoved event, new, 386
TextEditorEvents object event handler, 364
WindowActivated event, using, 383-384
WindowEvents event handlers, 363
WinOutput class, 381-382
building real add-ins
button paste code click event, 422
CMenuHandler class, 407-408
Connect class for NET desktop add-in, 392-393
CUIToolBar class, 397-400
CWindows class, 418-420
display method of frmGetComments, 414-415
EnterContextComments method, 411-413
frmComment, 402-405
linking events to event handlers, 435-436
OnConnection method to create toolbar, 395-396
SetUpPaintProc method, 423-427
SetUpPaintProcForCLang method, 427-432
Task List & windows event handlers, 436
Timer1_Tick event, 434-435
tool button event handler, 400-401
toolbar & tool buttons, creating, 396-397
code, manipulating in windows
adding procedure to bottom of document, 125-126
AddMethodToEndOfDocument, 126
AfterSelect event, adding to, 127-128
CloneProc form code, 129-134
CloneProcedure, 128-129
docking tool windows example, 137-138
document object example, 115
module-level variables, inserting, 123-124
Output window example, 139
replacing code in TextEditor window, 122-123
retrieving code from document, 121-122
retrieving code from TextEditor, 121
saved documents, closing, 114
TextSelection object, using, 117-118
VirtualPoint object, using, 119-120
controls on forms
add-in generated code (WinForms), 143-145
buttons, changing name & text properties of, 164-166
buttons, repositioning, 163-164
components, selecting, 167-168
controls, resizing, 163
event handlers, adding, 171-172
form code, completed, 174-177
forms, adding buttons to, 160-162
looping through selected components, 168-169
menus, adding to forms, 172-174
printing component properties, 162-163
Windows application project, creating, 157-158
Windows designer properties, accessing, 170-171
WinForms automation code, 146-156
debugging add-ins
AfterSelect event, error handling in, 109
GenLocalErrorTrap method, 104-106
GetToken, 106-109
protecting whole procedure, 102
selective error handling, 102-103
languages, multiple
AddMethodToEndOfDocument method, 353
C# add-in code created by Add-In Wizard, 326-329
C# code for Form1, 320-323
calling VB DLL HelloWorld method, 332-333
CodeManipulation class commenting methods, 340-345
CodeManipulation methods for VB, 346-349
file type, determining, 337-338
GetCommentCharForDoc method, 339
GetCommentChars, 338-339
GetWholeProc method, 351-353
PutCodeBack method, 350
sample constructor usage, 335-337
Visual Basic code changes (clock), 324-325
Visual Basic DLL code, 332
macros
AfterSelect event of TreeView, 270-271
CloseSavedWindows macro, 242-243
commenting VB code with amacro, 247-249
CountOccurrences helper method, 269-270
DocTemplate method, 263-269
DuplicateSelectedLines macro, 246
GetWholeProc macro function, 254-258
GetWholeProc method modified for add-in, 259-261
manually created macro, 250
modified CloneProcedure method, 258-259
OneFunctionView macro sample, 253-254
procedure before being documented, 271-272
temporary macro, 245
testing GetWholeProc, 252
migrating VB 6.0 add-ins to .NET
AddToIni method, 446-447
registry file for Add-in Manager registry entries, 449-450
upgraded code with diagnostics, 444-445
projects, manipulating
adding items to project, 282-284
Connect class, enhanced, 286-291
CreateMyCodeSnippets macro, 305-307
creating a solution & project, 275-277
Mmaintain build rules form, 291-301
OpenExistingSolution1 macro, 278
Output window, adding pane to, 308-310
OutputTaskItemString example, 310-311
ProjectItemsCollection, listing, 280-281
RemoveProjectFromSolution macro, 278
TaskListManipulation, 303-304
quick references, 481-505
smart desktop add-in
BlockChange method, 65-66
BlockComment method, 57-58
BlockComment method, alternate, 59-60
BlockComment method, improved, 61-63
BlockDelete method, 66-68
BlockUnComment method, 63-64
connect class, complete, 72-84
CountSpacesBeforeFirstChar, 70
event handler, modifying, 49-50
frmTreeView, code for, 54-56
GetCodeFromWindow, 69
OnConnection method, modifying, 47-48
OnDisconnection method, modifying, 49
PutCodeBack, 69-70
TreeView AfterSelect event, 56-57
user interfaces
add-in code created by Add-In
Wizard, 180-183
add-in toolbar, adding, 190-195
AddAddinCmdBar method, 196-197
AddNamedCommand method usage, 189
code modified to add menus, 183-187
command creation methods, calling, 215
Connect class code for system tray activation, 228-230
dimensioning Command Bar events, 214
dimensioning menus & events, 219-220
dimensioning toolbar & buttons, 214
Form1 code, 231-236
making TreeView work, 224-226
Microsoft Office toolbar & menus, 198-213
Office control creation methods, calling, 216-218
SetUpOfficeMenus, 220-222
toolbar objects, declaring, 195
UISystray add-in code generated by Wizard, 227-228
code, manipulating in windows, 113-139
cloning a procedure, 126-136
CloneProc form code, 129-135
CloneProcedure, 128-129
Document object, 114-120
Code Editor, manipulating, 115-120
example, 115
documents collection, 114
editor automation objects, 121-126
adding procedures to bottom of documents, 125-126
inserting code at top of modules, 123-124
putting code back into windows, 122-123
retrieving code from documents, 121-122
windows collection, 136-139
Command window, clearing, 138-139
docked windows, manipulating, 136-138
CodeAttribute object, 461
CodeBase string entry, 448
CodeClass object, 461
CodeDelegate object, 461
CodeElement object, 461-462
CodeElements collection, 462
CodeEnum object, 462
CodeFunction object, 462
CodeInterface object, 462
CodeManipulation class, 334-336, 406, 409
CodeManipulation class commenting methods (code listing), 340-345
CodeManipulation methods
enhancing, 339-349
for VB (code listing), 346-349
CodeModel objects, 8, 460-463, 462, 503-504
CodeNameSpace object, 462
CodeParameter object, 463
CodeProperty object, 463
CodeStruct object, 463
CodeType object, 463
CodeTypeRef object, 463
CodeVariable object, 463
.com file types, 315
Command Bar events, dimensioning (code listing), 214
command creation methods, calling (code listing), 215
command line safe add-ins, 21
Command objects
defined, 464
interfacing with (MS Office), 223
Command window, clearing, 138-139
CommandBarControls (Microsoft Office), 198-223
Command objects, interfacing with, 223
context menus and, 401
menus, creating, 219-222
toolbars, creating, 213-218
CommandBarEvents object, 468
CommandEvents object, 374-375
CommandEvents object event handlers (code listing), 374-375
CommandLineSafe, 36
CommandObj, changes to, 30-31
CommandObj to module level, moving (code listing), 31
CommandPreload value, 35-36
Commands collection, 464
CommandText parameter (QueryStatus), 41
CommandWindow object, 475
comment characters, 413
Comment menu, 402-406, 408-410
comment selected block (code listing), 3
commenting VB code with a macro (code listing), 247-249
compiler-detected errors, 95-96
components
recognizing when added to forms, 493-498
reloading, 499
selecting (code listing), 167-168
Configuration object, 460
ConfigurationManager object, 460
Configurations collection, 460
Connect class, 377-380
code for system tray activation (code listing), 228-230
complete (code listing), 72-84
completing, 71-85
declaration section (code listing), 378-380
enhanced (code listing), 286-291
methods, 39-43
Exec event, 42-43
OnConnection method, 39-40
OnDisconnection method, 40-41
QueryStatus event, 41-42
modifying, 47-50
for NET desktop add-in (code listing), 392-393
Connect_NET.Connect, 449
Connect.vb file, 25
constructors
and destructors, 335-337
usage sample (code listing), 335-337
Context Comment feature, 410-415
context menu form, creating (system tray), 230-236
ContextAttribute object, 475
ContextAttributes collection, 476
ContextMenu control, 230-231
ContextUIGuids parameter, 188
controls on forms, manipulating, 141-177
adding to forms, 159-163
manipulating on forms, 163-172
designer options, accessing, 169-171
event handler, adding, 171-172
looping through selected components, 166-169
menu, adding to forms, 172-177
Windows application project, creating, 156-159
Windows Forms automation add-in, creating, 142-145
WinForms automation code, adding, 146-156
controls, resizing (code listing), 163
CountOccurrences helper method (code listing), 269-270
CountSpacesBeforeFirstChar
code listing, 70
function, 62, 70, 72, 349
CreateMyCodeSnippets macro (code listing), 305-307
CreateSolution1 macro, 276
CreatOfficeToolBar method, 396
CreatOfficeToolBarButtons method, 396
CreatSolution1 macro, 281, 283
CReminder class, 387-389
CReminder class (code listing), 388-389
CsharpProject objects, 274
CUIMenus class, 400
CUIToolBar class, 397-400
current window, backup of, 501-502
customizing add-ins, 20-21
CWindows class (code listing), 418-420
| < Free Open Study > |
|