\r
private void Assets_OnImageProgress(UUID imageID, int recieved, int total)\r
{\r
- if (this.imageID != imageID) {\r
+ if (this.imageID != imageID)\r
+ {\r
return;\r
}\r
- if (InvokeRequired) {\r
- Invoke(new MethodInvoker(delegate()\r
- {\r
- Assets_OnImageProgress(imageID, recieved, total);\r
- }));\r
+\r
+ if (InvokeRequired)\r
+ {\r
+ BeginInvoke(new MethodInvoker(() => Assets_OnImageProgress(imageID, recieved, total)));\r
+ return;\r
}\r
+\r
int pct = 0;\r
if (total > 0)\r
{\r
{\r
if (InvokeRequired)\r
{\r
- BeginInvoke(new MethodInvoker(delegate()\r
- {\r
- DisplayPartialImage(assetTexture);\r
- }));\r
+ BeginInvoke(new MethodInvoker(() => DisplayPartialImage(assetTexture)));\r
return;\r
}\r
\r
return;\r
}\r
\r
- if (InvokeRequired) {\r
- Invoke(new MethodInvoker(delegate()\r
- {\r
- Assets_OnImageReceived(assetTexture);\r
- }));\r
+ if (InvokeRequired)\r
+ {\r
+ BeginInvoke(new MethodInvoker(() => Assets_OnImageReceived(assetTexture)));\r
return;\r
}\r
\r
- try {\r
+ try\r
+ {\r
progressBar1.Hide();\r
lblProgress.Hide();\r
\r
{\r
ClientSize = pictureBox1.Size = new Size(image.Width, image.Height);\r
}\r
- } catch (Exception excp) {\r
+ }\r
+ catch (Exception excp)\r
+ {\r
this.Hide();\r
System.Console.WriteLine("Error decoding image: " + excp.Message);\r
}\r