1
1
using System . Windows ;
2
2
using System . Windows . Input ;
3
+ using System ;
4
+ using Application = System . Windows . Forms . Application ;
3
5
4
6
namespace Rubberduck . UI . About
5
7
{
@@ -22,15 +24,34 @@ private void OnKeyDownHandler(object sender, KeyEventArgs e)
22
24
}
23
25
}
24
26
25
- private void CopyVersionInfoToClipboard ( )
27
+ private void CopyVersionInfo_MouseLeftButtonDown ( object sender , MouseButtonEventArgs e )
26
28
{
27
- Clipboard . SetText ( this . Version . Text ) ;
28
- System . Windows . MessageBox . Show ( "Version information copied to clipboard." , "Copy successfull" ) ;
29
+ CopyVersionInfoToClipboard ( ) ;
29
30
}
30
31
31
- private void CopyVersionInfo_MouseLeftButtonDown ( object sender , MouseButtonEventArgs e )
32
+ private void CopyVersionInfoToClipboard ( )
32
33
{
33
- CopyVersionInfoToClipboard ( ) ;
34
+ System . Text . StringBuilder sb = new System . Text . StringBuilder ( ) ;
35
+ sb . AppendLine ( $ "Rubberduck version: { this . Version . Text } ") ;
36
+ sb . AppendLine ( $ "Operating System: { Environment . OSVersion . VersionString } , { GetBitness ( Environment . Is64BitOperatingSystem ) } ") ;
37
+ sb . AppendLine ( $ "Host Product: { Application . ProductName } { GetBitness ( Environment . Is64BitProcess ) } ") ;
38
+ sb . AppendLine ( $ "Host Version: { Application . ProductVersion } ") ;
39
+ sb . AppendFormat ( $ "Host Executable: { System . IO . Path . GetFileName ( Application . ExecutablePath ) } ") ;
40
+
41
+ Clipboard . SetText ( sb . ToString ( ) ) ;
42
+ System . Windows . MessageBox . Show ( "Version information copied to clipboard." , "Copy successfull" ) ;
43
+
44
+ string GetBitness ( bool is64Bit )
45
+ {
46
+ if ( is64Bit )
47
+ {
48
+ return "x64" ;
49
+ }
50
+ else
51
+ {
52
+ return "x86" ;
53
+ }
54
+ }
34
55
}
35
56
}
36
57
}
0 commit comments