Skip to content

Commit 6a0e29e

Browse files
committed
ImageListManager update 4
Renamed OnInitialize to Populate.
1 parent 742842c commit 6a0e29e

File tree

8 files changed

+37
-26
lines changed

8 files changed

+37
-26
lines changed

External/Plugins/ASCompletion/PluginUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private void InitializeControls()
113113
InitializeComponent();
114114
treeIcons.ColorDepth = ColorDepth.Depth32Bit;
115115
treeIcons.ImageSize = ScaleHelper.Scale(new Size(16, 16));
116-
treeIcons.Initialize(TreeIcons_Initialize);
116+
treeIcons.Initialize(TreeIcons_Populate);
117117

118118
toolStrip.Renderer = new DockPanelStripRenderer();
119119
toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
@@ -140,7 +140,7 @@ private void InitializeControls()
140140
outlineTree.BringToFront();
141141
}
142142

143-
private void TreeIcons_Initialize(object sender, EventArgs e)
143+
private void TreeIcons_Populate(object sender, EventArgs e)
144144
{
145145
treeIcons.Images.AddRange(new Image[]
146146
{

External/Plugins/BookmarkPanel/PluginUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ private void InitializeGraphics()
231231
this.imageList = new ImageListManager();
232232
this.imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16));
233233
this.imageList.ColorDepth = ColorDepth.Depth32Bit;
234-
this.imageList.Initialize(ImageList_Initialize);
234+
this.imageList.Initialize(ImageList_Populate);
235235
this.listView.SmallImageList = this.imageList;
236236
this.removeBookmarksItem.Image = PluginBase.MainForm.FindImage("402|4|4|4");
237237
this.searchButton.Image = PluginBase.MainForm.FindImage("484|26|-4|4");
238238
}
239239

240-
private void ImageList_Initialize(object sender, EventArgs e)
240+
private void ImageList_Populate(object sender, EventArgs e)
241241
{
242242
this.imageList.Images.Add("Bookmark", PluginBase.MainForm.FindImageAndSetAdjust("559|26|0|1"));
243243
this.imageList.Images.Add("Info", PluginBase.MainForm.FindImageAndSetAdjust("229"));

External/Plugins/FileExplorer/PluginUI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ private void InitializeGraphics()
292292
this.imageList = new ImageListManager();
293293
this.imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16));
294294
this.imageList.ColorDepth = ColorDepth.Depth32Bit;
295-
this.imageList.OnInitialize += RefreshFileView;
295+
this.imageList.Populate += RefreshFileView;
296296
this.AddNonWin32Images();
297297
this.syncronizeButton.Image = PluginBase.MainForm.FindImage("203|9|-3|-3");
298298
this.browseButton.Image = PluginBase.MainForm.FindImage("203");

External/Plugins/FlashDebugger/Helpers/MenusHelper.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ public MenusHelper(Image pluginImage, DebuggerManager debugManager, Settings set
2929

3030
imageList = new ImageListManager();
3131
imageList.ColorDepth = ColorDepth.Depth32Bit;
32-
imageList.Initialize(ImageList_Initialize);
32+
imageList.Populate += ImageList_Populate;
33+
imageList.Initialize();
34+
3335
Image imgStartContinue = PluginBase.MainForm.GetAutoAdjustedImage(Resource.StartContinue);
3436
Image imgPause = PluginBase.MainForm.GetAutoAdjustedImage(Resource.Pause);
3537
Image imgStop = PluginBase.MainForm.GetAutoAdjustedImage(Resource.Stop);
@@ -148,7 +150,7 @@ public MenusHelper(Image pluginImage, DebuggerManager debugManager, Settings set
148150
PluginMain.settingObject.BreakOnThrowChanged += BreakOnThrowChanged;
149151
}
150152

151-
private void ImageList_Initialize(object sender, EventArgs e)
153+
private void ImageList_Populate(object sender, EventArgs e)
152154
{
153155
imageList.Images.Add("StartContinue", PluginBase.MainForm.ImageSetAdjust(Resource.StartContinue));
154156
imageList.Images.Add("Pause", PluginBase.MainForm.ImageSetAdjust(Resource.Pause));

External/Plugins/LayoutManager/PluginUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private void InitializeGraphics()
160160
this.imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16));
161161
this.imageList.ColorDepth = ColorDepth.Depth32Bit;
162162
this.imageList.TransparentColor = Color.Transparent;
163-
this.imageList.Initialize(ImageList_Initialize);
163+
this.imageList.Initialize(ImageList_Populate);
164164
this.layoutsListView.SmallImageList = this.imageList;
165165
this.menuLoadButton.Image = PluginBase.MainForm.FindImage("42|24|3|2");
166166
this.loadStripButton.Image = PluginBase.MainForm.FindImage("42|24|3|2");
@@ -173,7 +173,7 @@ private void InitializeGraphics()
173173
this.toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
174174
}
175175

176-
private void ImageList_Initialize(object sender, EventArgs e)
176+
private void ImageList_Populate(object sender, EventArgs e)
177177
{
178178
this.imageList.Images.Add(PluginBase.MainForm.FindImageAndSetAdjust("48"));
179179
this.imageList.Images.Add(PluginBase.MainForm.FindImageAndSetAdjust("229"));

External/Plugins/ResultsPanel/PluginUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public void InitializeGraphics()
251251
imageList.ColorDepth = ColorDepth.Depth32Bit;
252252
imageList.TransparentColor = Color.Transparent;
253253
imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16));
254-
imageList.Initialize(ImageList_Initialize);
254+
imageList.Initialize(ImageList_Populate);
255255
this.toolStripFilters.ImageList = imageList;
256256
this.entriesView.SmallImageList = imageList;
257257
this.clearFilterButton.Image = PluginBase.MainForm.FindImage("153");
@@ -260,7 +260,7 @@ public void InitializeGraphics()
260260
this.toolStripButtonWarning.Image = PluginBase.MainForm.FindImage("196");
261261
}
262262

263-
private void ImageList_Initialize(object sender, EventArgs e)
263+
private void ImageList_Populate(object sender, EventArgs e)
264264
{
265265
imageList.Images.Add(PluginBase.MainForm.FindImageAndSetAdjust("131")); // info
266266
imageList.Images.Add(PluginBase.MainForm.FindImageAndSetAdjust("197")); // error

External/Plugins/TaskListPanel/PluginUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,11 +649,11 @@ private void InitGraphics()
649649
{
650650
imageList = new ImageListManager();
651651
imageList.ColorDepth = ColorDepth.Depth32Bit;
652-
imageList.Initialize(ImageList_Initialize);
652+
imageList.Initialize(ImageList_Populate);
653653
this.listView.SmallImageList = imageList;
654654
}
655655

656-
private void ImageList_Initialize(object sender, EventArgs e)
656+
private void ImageList_Populate(object sender, EventArgs e)
657657
{
658658
Settings settings = (Settings) this.pluginMain.Settings;
659659
if (settings != null && settings.ImageIndexes != null)

PluginCore/PluginCore/Managers/ImageListManager.cs

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ public static explicit operator ImageListManager(ImageList obj)
9393
#region Events
9494

9595
/// <summary>
96-
/// Raised when the images in the <see cref="ImageList"/> should be initialized.
96+
/// Raised when the images in the <see cref="ImageList"/> should be populated.
9797
/// </summary>
98-
public event EventHandler OnInitialize;
98+
public event EventHandler Populate;
9999

100100
/// <summary>
101101
/// Occurs when the <see cref="ImageList"/> is disposed by a call to the <see cref="Component.Dispose"/> method.
@@ -119,7 +119,7 @@ public ImageList ImageList
119119
}
120120

121121
/// <summary>
122-
/// Gets or sets the color depth of the <see cref="ImageList"/>.
122+
/// Gets or sets the <see cref="System.Windows.Forms.ColorDepth"/> of the <see cref="ImageList"/>.
123123
/// </summary>
124124
public ColorDepth ColorDepth
125125
{
@@ -136,7 +136,7 @@ public ImageList.ImageCollection Images
136136
}
137137

138138
/// <summary>
139-
/// Gets or sets the size of the images in the <see cref="ImageList"/>.
139+
/// Gets or sets the <see cref="Size"/> of the images in the <see cref="ImageList"/>.
140140
/// </summary>
141141
public Size ImageSize
142142
{
@@ -145,14 +145,23 @@ public Size ImageSize
145145
}
146146

147147
/// <summary>
148-
/// Gets or sets the color to treat as transparent
148+
/// Gets or sets the <see cref="Color"/> to treat as transparent.
149149
/// </summary>
150150
public Color TransparentColor
151151
{
152152
get { return imageList.TransparentColor; }
153153
set { imageList.TransparentColor = value; }
154154
}
155155

156+
/// <summary>
157+
/// Gets or sets an <see cref="object"/> that contains additional data about the <see cref="ImageList"/>.
158+
/// </summary>
159+
public object Tag
160+
{
161+
get { return imageList.Tag; }
162+
set { imageList.Tag = value; }
163+
}
164+
156165
#endregion
157166

158167
#region Methods
@@ -214,20 +223,20 @@ public void Refresh()
214223
}
215224

216225
/// <summary>
217-
/// Initializes the <see cref="ImageList"/> by raising the <see cref="OnInitialize"/> event.
226+
/// Initializes the <see cref="ImageList"/> by raising the <see cref="Populate"/> event.
218227
/// </summary>
219228
public void Initialize()
220229
{
221-
if (OnInitialize != null) OnInitialize(this, EventArgs.Empty);
230+
if (Populate != null) Populate(this, EventArgs.Empty);
222231
}
223232

224233
/// <summary>
225-
/// Assigns the specified <see cref="EventHandler"/> to <see cref="OnInitialize"/> and initializes the <see cref="ImageList"/> by raising the event.
234+
/// Assigns the specified <see cref="EventHandler"/> to <see cref="Populate"/> and initializes the <see cref="ImageList"/> by calling <see cref="Initialize"/>.
226235
/// </summary>
227-
/// <param name="initialization">An <see cref="EventHandler"/> to assign to <see cref="OnInitialize"/>.</param>
228-
public void Initialize(EventHandler initialization)
236+
/// <param name="populate">An <see cref="EventHandler"/> to assign to <see cref="Populate"/>.</param>
237+
public void Initialize(EventHandler populate)
229238
{
230-
OnInitialize = initialization;
239+
Populate = populate;
231240
Initialize();
232241
}
233242

@@ -241,12 +250,12 @@ public void Dispose()
241250
}
242251

243252
/// <summary>
244-
/// Clears <see cref="Images"/> and calls <see cref="Initialize"/>. Override this method to provide custom initialization.
253+
/// Clears <see cref="Images"/> and raises <see cref="Populate"/>. Override this method to provide custom refreshing.
245254
/// </summary>
246255
protected virtual void OnRefresh()
247256
{
248257
imageList.Images.Clear();
249-
Initialize();
258+
if (Populate != null) Populate(this, EventArgs.Empty);
250259
}
251260

252261
#endregion

0 commit comments

Comments
 (0)