1
- using System ;
2
- using System . Diagnostics ;
3
- using System . Runtime . InteropServices ;
1
+ using System . Diagnostics ;
4
2
using System . Runtime . InteropServices . ComTypes ;
5
3
using TYPEATTR = System . Runtime . InteropServices . ComTypes . TYPEATTR ;
6
4
using TYPEFLAGS = System . Runtime . InteropServices . ComTypes . TYPEFLAGS ;
@@ -10,7 +8,6 @@ namespace Rubberduck.Parsing.ComReflection
10
8
[ DebuggerDisplay ( "{Name} As {TypeName}" ) ]
11
9
public class ComAlias : ComBase
12
10
{
13
- public VarEnum VarType { get ; private set ; }
14
11
public string TypeName { get ; private set ; }
15
12
public bool IsHidden { get ; private set ; }
16
13
public bool IsRestricted { get ; private set ; }
@@ -20,7 +17,6 @@ public ComAlias(ITypeLib typeLib, ITypeInfo info, int index, TYPEATTR attributes
20
17
Index = index ;
21
18
Documentation = new ComDocumentation ( typeLib , index ) ;
22
19
Guid = attributes . guid ;
23
- VarType = ( VarEnum ) attributes . tdescAlias . vt ;
24
20
IsHidden = attributes . wTypeFlags . HasFlag ( TYPEFLAGS . TYPEFLAG_FHIDDEN ) ;
25
21
IsRestricted = attributes . wTypeFlags . HasFlag ( TYPEFLAGS . TYPEFLAG_FRESTRICTED ) ;
26
22
@@ -29,22 +25,9 @@ public ComAlias(ITypeLib typeLib, ITypeInfo info, int index, TYPEATTR attributes
29
25
TypeName = "LongPtr" ;
30
26
return ;
31
27
}
32
-
33
- if ( ComVariant . TypeNames . ContainsKey ( VarType ) )
34
- {
35
- TypeName = ComVariant . TypeNames [ VarType ] ;
36
- }
37
- else if ( VarType == VarEnum . VT_USERDEFINED )
38
- {
39
- ITypeInfo refType ;
40
- info . GetRefTypeInfo ( ( int ) attributes . tdescAlias . lpValue , out refType ) ;
41
- var doc = new ComDocumentation ( refType , - 1 ) ;
42
- TypeName = doc . Name ;
43
- }
44
- else
45
- {
46
- throw new NotImplementedException ( string . Format ( "Didn't expect an alias with a type of {0}." , VarType ) ) ;
47
- }
28
+
29
+ var aliased = new ComParameter ( attributes , info ) ;
30
+ TypeName = aliased . TypeName ;
48
31
}
49
32
}
50
33
}
0 commit comments