File tree Expand file tree Collapse file tree 5 files changed +22
-19
lines changed
Rubberduck.Core/UI/Command/MenuItems/CommandBars
Rubberduck.VBEEditor/ComManagement Expand file tree Collapse file tree 5 files changed +22
-19
lines changed Original file line number Diff line number Diff line change @@ -77,9 +77,9 @@ protected override void OnExecute(object parameter)
77
77
_serializationProvider . SerializeProject ( library ) ;
78
78
}
79
79
80
- #if DEBUG
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 .
80
+ #if TRACE_COM_SAFE
81
+ //This block must be inside a conditional compilation block because the Serialize method
82
+ //called is conditionally compiled and available only if the compilation constant TRACE_COM_SAFE is set .
83
83
var path = ! string . IsNullOrWhiteSpace ( _serializationProvider . Target )
84
84
? Path . GetDirectoryName ( _serializationProvider . Target )
85
85
: Path . GetTempPath ( ) ;
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public void Dispose()
32
32
33
33
protected virtual void Dispose ( bool disposing )
34
34
{
35
- #if DEBUG
35
+ #if TRACE_COM_SAFE
36
36
if ( _disposed )
37
37
{
38
38
return ;
@@ -70,7 +70,7 @@ protected virtual void Dispose(bool disposing)
70
70
#endif
71
71
}
72
72
73
- #if DEBUG
73
+ #if TRACE_COM_SAFE
74
74
private struct TraceData
75
75
{
76
76
internal int HashCode { get ; set ; }
Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ public interface IComSafe: IDisposable
7
7
{
8
8
void Add ( ISafeComWrapper comWrapper ) ;
9
9
bool TryRemove ( ISafeComWrapper comWrapper ) ;
10
- #if DEBUG
10
+ #if TRACE_COM_SAFE
11
11
/// <summary>
12
- /// Available in DEBUG build only . Provide a mechanism for serializing both
12
+ /// Available only if the compilation constant TRACE_COM_SAFE is set . Provide a mechanism for serializing both
13
13
/// a snapshot of the COM safe at the instant and a historical activity log
14
14
/// with a limited stack trace for each entry.
15
15
/// </summary>
Original file line number Diff line number Diff line change 1
1
using System . Collections . Concurrent ;
2
- using System . Collections . Generic ;
3
- using System . Linq ;
4
2
using Rubberduck . VBEditor . SafeComWrappers . Abstract ;
5
3
4
+ #if TRACE_COM_SAFE
5
+ using System . Linq ;
6
+ using System . Collections . Generic ;
7
+ #endif
8
+
6
9
namespace Rubberduck . VBEditor . ComManagement
7
10
{
8
11
public class StrongComSafe : ComSafeBase
@@ -19,14 +22,14 @@ public override void Add(ISafeComWrapper comWrapper)
19
22
comWrapper ,
20
23
key =>
21
24
{
22
- #if DEBUG
25
+ #if TRACE_COM_SAFE
23
26
TraceAdd ( comWrapper ) ;
24
27
#endif
25
28
return 1 ;
26
29
} ,
27
30
( key , value ) =>
28
31
{
29
- #if DEBUG
32
+ #if TRACE_COM_SAFE
30
33
TraceUpdate ( comWrapper ) ;
31
34
#endif
32
35
return value ;
@@ -42,7 +45,7 @@ public override bool TryRemove(ISafeComWrapper comWrapper)
42
45
}
43
46
44
47
var result = _comWrapperCache . TryRemove ( comWrapper , out _ ) ;
45
- #if DEBUG
48
+ #if TRACE_COM_SAFE
46
49
TraceRemove ( comWrapper , result ) ;
47
50
#endif
48
51
return result ;
@@ -67,7 +70,7 @@ protected override void Dispose(bool disposing)
67
70
_comWrapperCache . Clear ( ) ;
68
71
}
69
72
70
- #if DEBUG
73
+ #if TRACE_COM_SAFE
71
74
protected override IDictionary < int , ISafeComWrapper > GetWrappers ( )
72
75
{
73
76
return _comWrapperCache . Keys . ToDictionary ( GetComWrapperObjectHashCode ) ;
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Concurrent ;
3
- using System . Collections . Generic ;
4
3
using Rubberduck . VBEditor . SafeComWrappers . Abstract ;
5
4
6
- #if DEBUG
5
+ #if TRACE_COM_SAFE
7
6
using System . Linq ;
7
+ using System . Collections . Generic ;
8
8
#endif
9
9
10
10
namespace Rubberduck . VBEditor . ComManagement
@@ -22,14 +22,14 @@ public override void Add(ISafeComWrapper comWrapper)
22
22
GetComWrapperObjectHashCode ( comWrapper ) ,
23
23
key =>
24
24
{
25
- #if DEBUG
25
+ #if TRACE_COM_SAFE
26
26
TraceAdd ( comWrapper ) ;
27
27
#endif
28
28
return ( DateTime . UtcNow , new WeakReference < ISafeComWrapper > ( comWrapper ) ) ;
29
29
} ,
30
30
( key , value ) =>
31
31
{
32
- #if DEBUG
32
+ #if TRACE_COM_SAFE
33
33
TraceUpdate ( comWrapper ) ;
34
34
#endif
35
35
return ( value . insertTime , new WeakReference < ISafeComWrapper > ( comWrapper ) ) ;
@@ -46,7 +46,7 @@ public override bool TryRemove(ISafeComWrapper comWrapper)
46
46
}
47
47
48
48
var result = _comWrapperCache . TryRemove ( GetComWrapperObjectHashCode ( comWrapper ) , out _ ) ;
49
- #if DEBUG
49
+ #if TRACE_COM_SAFE
50
50
TraceRemove ( comWrapper , result ) ;
51
51
#endif
52
52
return result ;
@@ -74,7 +74,7 @@ protected override void Dispose(bool disposing)
74
74
_comWrapperCache . Clear ( ) ;
75
75
}
76
76
77
- #if DEBUG
77
+ #if TRACE_COM_SAFE
78
78
protected override IDictionary < int , ISafeComWrapper > GetWrappers ( )
79
79
{
80
80
var dictionary = new Dictionary < int , ISafeComWrapper > ( ) ;
You can’t perform that action at this time.
0 commit comments