6
6
*/
7
7
8
8
using System ;
9
- using System . Windows . Forms ;
10
- using System . Text ;
11
9
using System . Collections . Generic ;
12
- using PluginCore ;
13
- using PluginCore . Managers ;
14
- using ASCompletion . Model ;
15
- using ASCompletion . Context ;
16
- using ASCompletion . Settings ;
17
- using PluginCore . Localization ;
18
10
using System . Drawing ;
19
11
using System . Reflection ;
12
+ using System . Text ;
13
+ using System . Windows . Forms ;
14
+ using ASCompletion . Context ;
15
+ using ASCompletion . Model ;
16
+ using ASCompletion . Settings ;
17
+ using PluginCore ;
20
18
using PluginCore . Helpers ;
19
+ using PluginCore . Localization ;
20
+ using PluginCore . Managers ;
21
21
22
22
namespace ASCompletion
23
23
{
@@ -77,7 +77,7 @@ public ImageList TreeIcons
77
77
78
78
public ToolStripMenuItem LookupMenuItem ;
79
79
private System . ComponentModel . IContainer components ;
80
- public System . Windows . Forms . ImageList treeIcons ;
80
+ public ImageListManager treeIcons ;
81
81
private FixedTreeView outlineTree ;
82
82
private System . Timers . Timer tempoClick ;
83
83
@@ -113,44 +113,7 @@ private void InitializeControls()
113
113
InitializeComponent ( ) ;
114
114
treeIcons . ColorDepth = ColorDepth . Depth32Bit ;
115
115
treeIcons . ImageSize = ScaleHelper . Scale ( new Size ( 16 , 16 ) ) ;
116
- treeIcons . Images . AddRange ( new Image [ ]
117
- {
118
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "FilePlain.png" ) ) ) ,
119
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "FolderClosed.png" ) ) ) ,
120
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "FolderOpen.png" ) ) ) ,
121
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "CheckAS.png" ) ) ) ,
122
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "QuickBuild.png" ) ) ) ,
123
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "Package.png" ) ) ) ,
124
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "Interface.png" ) ) ) ,
125
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "Intrinsic.png" ) ) ) ,
126
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "Class.png" ) ) ) ,
127
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "Variable.png" ) ) ) ,
128
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "VariableProtected.png" ) ) ) ,
129
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "VariablePrivate.png" ) ) ) ,
130
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "VariableStatic.png" ) ) ) ,
131
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "VariableStaticProtected.png" ) ) ) ,
132
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "VariableStaticPrivate.png" ) ) ) ,
133
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "Const.png" ) ) ) ,
134
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "ConstProtected.png" ) ) ) ,
135
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "ConstPrivate.png" ) ) ) ,
136
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "Const.png" ) ) ) ,
137
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "ConstProtected.png" ) ) ) ,
138
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "ConstPrivate.png" ) ) ) ,
139
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "Method.png" ) ) ) ,
140
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "MethodProtected.png" ) ) ) ,
141
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "MethodPrivate.png" ) ) ) ,
142
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "MethodStatic.png" ) ) ) ,
143
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "MethodStaticProtected.png" ) ) ) ,
144
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "MethodStaticPrivate.png" ) ) ) ,
145
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "Property.png" ) ) ) ,
146
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "PropertyProtected.png" ) ) ) ,
147
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "PropertyPrivate.png" ) ) ) ,
148
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "PropertyStatic.png" ) ) ) ,
149
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "PropertyStaticProtected.png" ) ) ) ,
150
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "PropertyStaticPrivate.png" ) ) ) ,
151
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "Template.png" ) ) ) ,
152
- PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( "Declaration.png" ) ) )
153
- } ) ;
116
+ treeIcons . Initialize ( TreeIcons_Populate ) ;
154
117
155
118
toolStrip . Renderer = new DockPanelStripRenderer ( ) ;
156
119
toolStrip . ImageScalingSize = ScaleHelper . Scale ( new Size ( 16 , 16 ) ) ;
@@ -177,6 +140,53 @@ private void InitializeControls()
177
140
outlineTree . BringToFront ( ) ;
178
141
}
179
142
143
+ private void TreeIcons_Populate ( object sender , EventArgs e )
144
+ {
145
+ treeIcons . Images . AddRange ( new Image [ ]
146
+ {
147
+ GetImage ( "FilePlain.png" ) ,
148
+ GetImage ( "FolderClosed.png" ) ,
149
+ GetImage ( "FolderOpen.png" ) ,
150
+ GetImage ( "CheckAS.png" ) ,
151
+ GetImage ( "QuickBuild.png" ) ,
152
+ GetImage ( "Package.png" ) ,
153
+ GetImage ( "Interface.png" ) ,
154
+ GetImage ( "Intrinsic.png" ) ,
155
+ GetImage ( "Class.png" ) ,
156
+ GetImage ( "Variable.png" ) ,
157
+ GetImage ( "VariableProtected.png" ) ,
158
+ GetImage ( "VariablePrivate.png" ) ,
159
+ GetImage ( "VariableStatic.png" ) ,
160
+ GetImage ( "VariableStaticProtected.png" ) ,
161
+ GetImage ( "VariableStaticPrivate.png" ) ,
162
+ GetImage ( "Const.png" ) ,
163
+ GetImage ( "ConstProtected.png" ) ,
164
+ GetImage ( "ConstPrivate.png" ) ,
165
+ GetImage ( "Const.png" ) ,
166
+ GetImage ( "ConstProtected.png" ) ,
167
+ GetImage ( "ConstPrivate.png" ) ,
168
+ GetImage ( "Method.png" ) ,
169
+ GetImage ( "MethodProtected.png" ) ,
170
+ GetImage ( "MethodPrivate.png" ) ,
171
+ GetImage ( "MethodStatic.png" ) ,
172
+ GetImage ( "MethodStaticProtected.png" ) ,
173
+ GetImage ( "MethodStaticPrivate.png" ) ,
174
+ GetImage ( "Property.png" ) ,
175
+ GetImage ( "PropertyProtected.png" ) ,
176
+ GetImage ( "PropertyPrivate.png" ) ,
177
+ GetImage ( "PropertyStatic.png" ) ,
178
+ GetImage ( "PropertyStaticProtected.png" ) ,
179
+ GetImage ( "PropertyStaticPrivate.png" ) ,
180
+ GetImage ( "Template.png" ) ,
181
+ GetImage ( "Declaration.png" )
182
+ } ) ;
183
+ }
184
+
185
+ public static Image GetImage ( String name )
186
+ {
187
+ return PluginBase . MainForm . ImageSetAdjust ( Image . FromStream ( GetStream ( name ) ) ) ;
188
+ }
189
+
180
190
public static System . IO . Stream GetStream ( String name )
181
191
{
182
192
String prefix = "ASCompletion.Icons." ;
@@ -270,7 +280,7 @@ private void InitializeComponent()
270
280
{
271
281
this . components = new System . ComponentModel . Container ( ) ;
272
282
System . ComponentModel . ComponentResourceManager resources = new System . ComponentModel . ComponentResourceManager ( typeof ( PluginUI ) ) ;
273
- this . treeIcons = new System . Windows . Forms . ImageList ( this . components ) ;
283
+ this . treeIcons = new ImageListManager ( this . components ) ;
274
284
this . toolStrip = new PluginCore . Controls . ToolStripEx ( ) ;
275
285
this . sortDropDown = new System . Windows . Forms . ToolStripDropDownButton ( ) ;
276
286
this . noneItem = new System . Windows . Forms . ToolStripMenuItem ( ) ;
0 commit comments