14
14
using Microsoft . VisualStudio . FSharp . LanguageService . Resources ;
15
15
16
16
namespace Microsoft . VisualStudio . FSharp . LanguageService {
17
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager"]/*' />
18
17
/// <summary>
19
18
/// CodeWindowManager provides a default implementation of the VSIP interface IVsCodeWindowManager
20
19
/// and manages the LanguageService, Source, ViewFilter, and DocumentProperties objects associated
@@ -42,7 +41,6 @@ public class CodeWindowManager : IVsCodeWindowManager {
42
41
DocumentProperties properties ;
43
42
#endif
44
43
45
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.CodeWindowManager"]/*' />
46
44
/// <summary>
47
45
/// The CodeWindowManager is constructed by the base LanguageService class when VS calls
48
46
/// the IVsLanguageInfo.GetCodeWindowManager method. You can override CreateCodeWindowManager
@@ -58,14 +56,12 @@ internal CodeWindowManager(LanguageService service, IVsCodeWindow codeWindow, IS
58
56
#endif
59
57
}
60
58
61
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.Finalize"]/*' />
62
59
~ CodeWindowManager ( ) {
63
60
#if LANGTRACE
64
61
Trace . WriteLine ( "~CodeWindowManager" ) ;
65
62
#endif
66
63
}
67
64
68
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.Close"]/*' />
69
65
/// <summary>Closes all view filters, and the document properties window</summary>
70
66
internal void Close ( ) {
71
67
#if LANGTRACE
@@ -93,17 +89,14 @@ void CloseFilters() {
93
89
}
94
90
}
95
91
96
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.LanguageService;"]/*' />
97
92
/// <summary>Returns the LanguageService object that created this code window manager</summary>
98
93
internal LanguageService LanguageService {
99
94
get { return this . service ; }
100
95
}
101
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.Source;"]/*' />
102
96
/// <summary>returns the Source object associated with the IVsTextLines buffer for this code window</summary>
103
97
internal ISource Source {
104
98
get { return this . source ; }
105
99
}
106
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.GetFilter;"]/*' />
107
100
/// <summary>
108
101
/// Returns the ViewFilter for the given view or null if no matching filter is found.
109
102
/// </summary>
@@ -118,7 +111,6 @@ internal ViewFilter GetFilter(IVsTextView view) {
118
111
}
119
112
120
113
#if DOCUMENT_PROPERTIES
121
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.Properties;"]/*' />
122
114
/// <summary>Returns the DocumentProperties, if any. You can update this property if you want to
123
115
/// change the document properties on the fly.</summary>
124
116
internal DocumentProperties Properties {
@@ -132,19 +124,15 @@ internal DocumentProperties Properties {
132
124
}
133
125
}
134
126
#endif
135
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.DropDownHelper"]/*' />
136
127
/// <summary>Return the optional TypeAndMemberDropdownBars object for the drop down combos</summary>
137
128
internal TypeAndMemberDropdownBars DropDownHelper {
138
129
get { return this . dropDownHelper ; }
139
130
}
140
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.CodeWindow"]/*' />
141
131
/// <summary>Return the IVsCodeWindow associated with this code window manager.</summary>
142
132
internal IVsCodeWindow CodeWindow {
143
133
get { return this . codeWindow ; }
144
134
}
145
135
146
- #region IVsCodeWindowManager methods
147
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.AddAdornments"]/*' />
148
136
/// <summary>Install the optional TypeAndMemberDropdownBars, and primary and secondary view filters</summary>
149
137
public virtual int AddAdornments ( ) {
150
138
#if LANGTRACE
@@ -182,7 +170,6 @@ public virtual int AddAdornments() {
182
170
return NativeMethods . S_OK ;
183
171
}
184
172
185
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.RemoveAdornments"]/*' />
186
173
/// <summary>Remove drop down combos, view filters, and notify the LanguageService that the Source and
187
174
/// CodeWindowManager is now closed</summary>
188
175
public virtual int RemoveAdornments ( ) {
@@ -212,7 +199,6 @@ public virtual int RemoveAdornments() {
212
199
return NativeMethods . S_OK ;
213
200
}
214
201
215
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.OnNewView"]/*' />
216
202
/// <summary>Install a new view filter for the given view. This method calls your
217
203
/// CreateViewFilter method.</summary>
218
204
public virtual int OnNewView ( IVsTextView newView ) {
@@ -224,11 +210,9 @@ public virtual int OnNewView(IVsTextView newView) {
224
210
return NativeMethods . S_OK ;
225
211
}
226
212
227
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.OnKillFocus"]/*' />
228
213
public virtual void OnKillFocus ( IVsTextView textView ) {
229
214
}
230
215
231
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.OnSetFocus"]/*' />
232
216
/// <summary>Refresh the document properties</summary>
233
217
public virtual void OnSetFocus ( IVsTextView textView ) {
234
218
#if DOCUMENT_PROPERTIES
@@ -237,13 +221,11 @@ public virtual void OnSetFocus(IVsTextView textView) {
237
221
}
238
222
#endif
239
223
}
240
- #endregion
241
224
242
225
}
243
226
244
227
245
228
246
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars"]/*' />
247
229
/// <summary>
248
230
/// Represents the two drop down bars on the top of a text editor window that allow
249
231
/// types and type members to be selected by name.
@@ -274,14 +256,12 @@ internal abstract class TypeAndMemberDropdownBars : IVsDropdownBarClient {
274
256
const int DropClasses = 0 ;
275
257
const int DropMethods = 1 ;
276
258
277
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.TypeAndMemberDropdownBars"]/*' />
278
259
protected TypeAndMemberDropdownBars ( LanguageService languageService ) {
279
260
this . languageService = languageService ;
280
261
this . dropDownTypes = new ArrayList ( ) ;
281
262
this . dropDownMembers = new ArrayList ( ) ;
282
263
}
283
264
284
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.Done"]/*' />
285
265
public void Done ( ) { //TODO: use IDisposable pattern
286
266
if ( this . imageList != null ) {
287
267
imageList . Dispose ( ) ;
@@ -301,7 +281,6 @@ internal void SynchronizeDropdowns(IVsTextView textView, int line, int col) {
301
281
302
282
303
283
304
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.OnSynchronizeDropdowns"]/*' />
305
284
/// <summary>
306
285
/// This method is called to update the drop down bars to match the current contents of the text editor window.
307
286
/// It is called during OnIdle when the caret position changes. You can provide new drop down members here.
@@ -320,7 +299,6 @@ internal void SynchronizeDropdowns(IVsTextView textView, int line, int col) {
320
299
321
300
322
301
// IVsDropdownBarClient methods
323
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetComboAttributes"]/*' />
324
302
public virtual int GetComboAttributes ( int combo , out uint entries , out uint entryType , out IntPtr iList ) {
325
303
entries = 0 ;
326
304
entryType = 0 ;
@@ -341,7 +319,6 @@ private enum DropDownItemType {
341
319
HasImage = 4
342
320
}
343
321
344
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetComboTipText"]/*' />
345
322
public virtual int GetComboTipText ( int combo , out string text ) {
346
323
if ( combo == TypeAndMemberDropdownBars . DropClasses )
347
324
text = SR . GetString ( SR . ComboTypesTip ) ;
@@ -350,7 +327,6 @@ public virtual int GetComboTipText(int combo, out string text) {
350
327
return NativeMethods . S_OK ;
351
328
}
352
329
353
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetEntryAttributes"]/*' />
354
330
public virtual int GetEntryAttributes ( int combo , int entry , out uint fontAttrs ) {
355
331
fontAttrs = ( uint ) DROPDOWNFONTATTR . FONTATTR_PLAIN ;
356
332
DropDownMember member = GetMember ( combo , entry ) ;
@@ -360,7 +336,6 @@ public virtual int GetEntryAttributes(int combo, int entry, out uint fontAttrs)
360
336
return NativeMethods . S_OK ;
361
337
}
362
338
363
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetEntryImage"]/*' />
364
339
public virtual int GetEntryImage ( int combo , int entry , out int imgIndex ) {
365
340
// this happens during drawing and has to be fast
366
341
imgIndex = - 1 ;
@@ -371,7 +346,6 @@ public virtual int GetEntryImage(int combo, int entry, out int imgIndex) {
371
346
return NativeMethods . S_OK ;
372
347
}
373
348
374
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetEntryText"]/*' />
375
349
public virtual int GetEntryText ( int combo , int entry , out string text ) {
376
350
text = null ;
377
351
DropDownMember member = GetMember ( combo , entry ) ;
@@ -381,12 +355,10 @@ public virtual int GetEntryText(int combo, int entry, out string text) {
381
355
return NativeMethods . S_OK ;
382
356
}
383
357
384
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.OnComboGetFocus"]/*' />
385
358
public virtual int OnComboGetFocus ( int combo ) {
386
359
return NativeMethods . S_OK ;
387
360
}
388
361
389
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetMember"]/*' />
390
362
public DropDownMember GetMember ( int combo , int entry ) {
391
363
if ( combo == TypeAndMemberDropdownBars . DropClasses ) {
392
364
if ( this . dropDownTypes != null && entry >= 0 && entry < this . dropDownTypes . Count )
@@ -398,7 +370,6 @@ public DropDownMember GetMember(int combo, int entry) {
398
370
return null ;
399
371
}
400
372
401
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.OnItemChosen"]/*' />
402
373
public virtual int OnItemChosen ( int combo , int entry ) {
403
374
DropDownMember member = GetMember ( combo , entry ) ;
404
375
if ( ! Object . ReferenceEquals ( member , null ) ) {
@@ -417,11 +388,9 @@ public virtual int OnItemChosen(int combo, int entry) {
417
388
return NativeMethods . S_OK ;
418
389
}
419
390
420
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.SetFocus"]/*' />
421
391
[ DllImport ( "user32.dll" ) ]
422
392
static extern void SetFocus ( IntPtr hwnd ) ;
423
393
424
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.OnItemSelected"]/*' />
425
394
public int OnItemSelected ( int combo , int index ) {
426
395
//nop
427
396
return NativeMethods . S_OK ;
@@ -433,15 +402,13 @@ public int SetDropdownBar(IVsDropdownBar bar) {
433
402
}
434
403
}
435
404
436
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember"]/*' />
437
405
internal class DropDownMember : IComparable {
438
406
439
407
private string label ;
440
408
private TextSpan span ;
441
409
private int glyph ;
442
410
private DROPDOWNFONTATTR fontAttr ;
443
411
444
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.Label;"]/*' />
445
412
public string Label {
446
413
get {
447
414
return this . label ;
@@ -451,7 +418,6 @@ public string Label {
451
418
}
452
419
}
453
420
454
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.Span;"]/*' />
455
421
public TextSpan Span {
456
422
get {
457
423
return this . span ;
@@ -460,7 +426,6 @@ public TextSpan Span {
460
426
this . span = value ;
461
427
}
462
428
}
463
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.Glyph;"]/*' />
464
429
public int Glyph {
465
430
get {
466
431
return this . glyph ;
@@ -469,7 +434,6 @@ public int Glyph {
469
434
this . glyph = value ;
470
435
}
471
436
}
472
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.FontAttr;"]/*' />
473
437
public DROPDOWNFONTATTR FontAttr {
474
438
get {
475
439
return this . fontAttr ;
@@ -479,7 +443,6 @@ public DROPDOWNFONTATTR FontAttr {
479
443
}
480
444
}
481
445
482
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.DropDownMember"]/*' />
483
446
public DropDownMember ( string label , TextSpan span , int glyph , DROPDOWNFONTATTR fontAttribute ) {
484
447
if ( label == null ) {
485
448
throw new ArgumentNullException ( "label" ) ;
@@ -490,14 +453,12 @@ public DropDownMember(string label, TextSpan span, int glyph, DROPDOWNFONTATTR f
490
453
this . FontAttr = fontAttribute ;
491
454
}
492
455
493
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.CompareTo"]/*' />
494
456
public int CompareTo ( object obj ) {
495
457
// if this overload is used then it assumes a case-sensitive current culture comparison
496
458
// which allows for case-senstive languages to work
497
459
return CompareTo ( obj , StringComparison . CurrentCulture ) ;
498
460
}
499
461
500
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.CompareTo"]/*' />
501
462
public int CompareTo ( object obj , StringComparison stringComparison )
502
463
{
503
464
if ( obj is DropDownMember )
@@ -508,15 +469,13 @@ public int CompareTo(object obj, StringComparison stringComparison)
508
469
}
509
470
510
471
// Omitting Equals violates FxCop rule: IComparableImplementationsOverrideEquals.
511
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.Equals"]/*' />
512
472
public override bool Equals ( Object obj ) {
513
473
if ( ! ( obj is DropDownMember ) )
514
474
return false ;
515
475
return ( this . CompareTo ( obj , StringComparison . CurrentCulture ) == 0 ) ;
516
476
}
517
477
518
478
// Omitting getHashCode violates FxCop rule: EqualsOverridesRequireGetHashCodeOverride.
519
- /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.GetHashCode"]/*' />
520
479
public override int GetHashCode ( ) {
521
480
return this . Label . GetHashCode ( ) ;
522
481
}
0 commit comments