@@ -19,6 +19,9 @@ namespace TeamCoding.VisualStudio.Models
1919 /// </summary>
2020 public class LocalIDEModel
2121 {
22+ /// <summary>
23+ /// A unique id for this IDE instance
24+ /// </summary>
2225 public static Lazy < string > Id = new Lazy < string > ( ( ) =>
2326 {
2427 string uuid = string . Empty ;
@@ -34,31 +37,41 @@ public class LocalIDEModel
3437 return uuid + System . Diagnostics . Process . GetCurrentProcess ( ) . Id . ToString ( ) ;
3538 }
3639 } , false ) ;
37-
40+ /// <summary>
41+ /// Provides information for when a the file in focus changes
42+ /// </summary>
3843 public class FileFocusChangedEventArgs : EventArgs
3944 {
4045 public string LostFocusFile { get ; set ; }
4146 public string GotFocusFile { get ; set ; }
4247 }
43-
48+ /// <summary>
49+ /// The curent IDE model instance
50+ /// </summary>
4451 private static LocalIDEModel Current = new LocalIDEModel ( ) ;
4552
4653 private object OpenFilesLock = new object ( ) ;
4754 private readonly ConcurrentDictionary < string , DocumentRepoMetaData > OpenFiles = new ConcurrentDictionary < string , DocumentRepoMetaData > ( ) ;
4855
4956 private DelayedEvent OpenViewsChangedInternal = new DelayedEvent ( 500 ) ;
57+ /// <summary>
58+ /// Occurs when the IDE changed the views that are open (after a 500ms delay)
59+ /// </summary>
5060 public event EventHandler OpenViewsChanged { add { OpenViewsChangedInternal . Event += value ; } remove { OpenViewsChangedInternal . Event -= value ; } }
5161
5262 private DelayedEvent < CaretPositionChangedEventArgs > CaretPositionChangedInternal = new DelayedEvent < CaretPositionChangedEventArgs > ( 500 ) ;
63+ /// <summary>
64+ /// Occurs when the caret position is changed (after a 500ms delay)
65+ /// </summary>
5366 public event EventHandler < CaretPositionChangedEventArgs > CaretPositionChanged { add { CaretPositionChangedInternal . Event += value ; } remove { CaretPositionChangedInternal . Event -= value ; } }
5467
55- private DelayedEvent < TextContentChangedEventArgs > TextContentChangedInternal = new DelayedEvent < TextContentChangedEventArgs > ( 500 ) ;
56- public event EventHandler < TextContentChangedEventArgs > TextContentChanged { add { TextContentChangedInternal . Event += value ; } remove { TextContentChangedInternal . Event -= value ; } }
57-
5868 private DelayedEvent < TextDocumentFileActionEventArgs > TextDocumentSavedInternal = new DelayedEvent < TextDocumentFileActionEventArgs > ( 500 ) ;
5969 public event EventHandler < TextDocumentFileActionEventArgs > TextDocumentSaved { add { TextDocumentSavedInternal . Event += value ; } remove { TextDocumentSavedInternal . Event -= value ; } }
6070
6171 private DelayedEvent ModelChangedInternal = new DelayedEvent ( 500 ) ;
72+ /// <summary>
73+ /// Occurs when the IDE model is changed (after a 500ms delay)
74+ /// </summary>
6275 public event EventHandler ModelChanged { add { ModelChangedInternal . Event += value ; } remove { ModelChangedInternal . Event -= value ; } }
6376 public LocalIDEModel ( )
6477 {
@@ -68,7 +81,6 @@ public LocalIDEModel()
6881 // Hook up to the internal event as the model changed event is rate-limited anyway
6982 OpenViewsChangedInternal . PassthroughEvent += ModelChangedInternal . Invoke ;
7083 CaretPositionChangedInternal . PassthroughEvent += ModelChangedInternal . Invoke ;
71- TextContentChangedInternal . PassthroughEvent += ModelChangedInternal . Invoke ;
7284 TextDocumentSavedInternal . PassthroughEvent += ModelChangedInternal . Invoke ;
7385 }
7486 public async System . Threading . Tasks . Task OnCaretPositionChangedAsync ( CaretPositionChangedEventArgs e )
@@ -135,7 +147,10 @@ internal void OnTextDocumentSaved(ITextDocument textDocument, TextDocumentFileAc
135147 TextDocumentSavedInternal ? . Invoke ( textDocument , e ) ;
136148 }
137149 }
138-
150+ /// <summary>
151+ /// Gets an arrayt of currently open files
152+ /// </summary>
153+ /// <returns></returns>
139154 public DocumentRepoMetaData [ ] OpenDocs ( )
140155 {
141156 lock ( OpenFilesLock )
@@ -161,8 +176,6 @@ internal void OnTextBufferChanged(ITextBuffer textBuffer, TextContentChangedEven
161176 OpenFiles . AddOrUpdate ( filePath , sourceControlInfo , ( v , r ) => { sourceControlInfo . CaretPositionInfo = r . CaretPositionInfo ; return sourceControlInfo ; } ) ;
162177 }
163178 }
164-
165- TextContentChangedInternal ? . Invoke ( textBuffer , e ) ;
166179 }
167180
168181 internal void OnFileGotFocus ( string filePath )
0 commit comments