File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed
Rubberduck.Core/UI/Command/MenuItems/CommandBars
Rubberduck.VBEEditor/ComManagement Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ protected override void OnExecute(object parameter)
66
66
if ( ! toSerialize . ContainsKey ( type . Guid ) )
67
67
{
68
68
toSerialize . Add ( type . Guid , type ) ;
69
- }
69
+ }
70
70
}
71
71
}
72
72
}
@@ -78,8 +78,12 @@ protected override void OnExecute(object parameter)
78
78
}
79
79
80
80
#if DEBUG
81
- //Dumb hack cos I'm too lazy to wire up another button...
82
- var traceDirectory = Path . Combine ( Path . GetDirectoryName ( _serializationProvider . Target ) , "COM Trace" ) ;
81
+ //This block must be inside a DEBUG block because the Serialize method
82
+ //called is conditionally compiled and available only for a DEBUG build.
83
+ var path = string . IsNullOrWhiteSpace ( _serializationProvider . Target )
84
+ ? Path . GetDirectoryName ( _serializationProvider . Target )
85
+ : Path . GetTempPath ( ) ;
86
+ var traceDirectory = Path . Combine ( path , "COM Trace" ) ;
83
87
if ( ! Directory . Exists ( traceDirectory ) )
84
88
{
85
89
Directory . CreateDirectory ( traceDirectory ) ;
Original file line number Diff line number Diff line change @@ -90,12 +90,7 @@ private struct TraceData
90
90
private const int StackTrackNumberOfElementsToSkipOnAddUpdate = 8 ;
91
91
private const int StackTraceDepth = 5 ;
92
92
93
- /// <summary>
94
- /// Provide a serialized list of the COM Safe
95
- /// to make it easy to analyze what is inside
96
- /// the COM Safe at the different points of
97
- /// the session's lifetime.
98
- /// </summary>
93
+ /// <inheritdoc cref="IComSafe.Serialize"/>
99
94
public void Serialize ( string targetDirectory )
100
95
{
101
96
lock ( _streamLock )
Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ public interface IComSafe: IDisposable
8
8
void Add ( ISafeComWrapper comWrapper ) ;
9
9
bool TryRemove ( ISafeComWrapper comWrapper ) ;
10
10
#if DEBUG
11
+ /// <summary>
12
+ /// Available in DEBUG build only. Provide a mechanism for serializing both
13
+ /// a snapshot of the COM safe at the instant and a historical activity log
14
+ /// with a limited stack trace for each entry.
15
+ /// </summary>
16
+ /// <param name="targetDirectory">The path to a directory to place the serialized files in</param>
11
17
void Serialize ( string targetDirectory ) ;
12
18
#endif
13
19
}
You can’t perform that action at this time.
0 commit comments