corrade-vassal – Diff between revs 13 and 16

Subversion Repositories:
Rev:
Only display areas with differencesIgnore whitespace
Rev 13 Rev 16
1 /////////////////////////////////////////////////////////////////////////// 1 ///////////////////////////////////////////////////////////////////////////
2 // Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 // 2 // Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 //
3 // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // 3 // Please see: http://www.gnu.org/licenses/gpl.html for legal details, //
4 // rights of fair usage, the disclaimer and warranty conditions. // 4 // rights of fair usage, the disclaimer and warranty conditions. //
5 /////////////////////////////////////////////////////////////////////////// 5 ///////////////////////////////////////////////////////////////////////////
6   6  
7 using System; 7 using System;
8 using System.Collections.Generic; 8 using System.Collections.Generic;
9 using System.Drawing; 9 using System.Drawing;
10 using System.IO; 10 using System.IO;
11 using System.Linq; 11 using System.Linq;
12 using System.Text; 12 using System.Text;
13 using System.Threading; 13 using System.Threading;
14 using System.Windows.Forms; 14 using System.Windows.Forms;
15 using OpenMetaverse; 15 using OpenMetaverse;
16 using wasSharp; 16 using wasSharp;
17   17  
18 namespace Vassal 18 namespace Vassal
19 { 19 {
20 public partial class RegionEditForm : Form 20 public partial class RegionEditForm : Form
21 { 21 {
22 private static RegionEditForm mainForm; 22 private static RegionEditForm mainForm;
23   23  
24 public RegionEditForm() 24 public RegionEditForm()
25 { 25 {
26 InitializeComponent(); 26 InitializeComponent();
27 mainForm = this; 27 mainForm = this;
28 } 28 }
29   29  
30 private void LoadRegionsRequested(object sender, EventArgs e) 30 private void LoadRegionsRequested(object sender, EventArgs e)
31 { 31 {
32 mainForm.BeginInvoke((MethodInvoker) (() => 32 mainForm.BeginInvoke((MethodInvoker) (() =>
33 { 33 {
34 switch (mainForm.LoadRegionsDialog.ShowDialog()) 34 switch (mainForm.LoadRegionsDialog.ShowDialog())
35 { 35 {
36 case DialogResult.OK: 36 case DialogResult.OK:
37 string file = mainForm.LoadRegionsDialog.FileName; 37 var file = mainForm.LoadRegionsDialog.FileName;
38 new Thread(() => 38 new Thread(() =>
39 { 39 {
40 mainForm.BeginInvoke((MethodInvoker) (() => 40 mainForm.BeginInvoke((MethodInvoker) (() =>
41 { 41 {
42 try 42 try
43 { 43 {
44 mainForm.StatusText.Text = @"loading regions..."; 44 mainForm.StatusText.Text = @"loading regions...";
45 mainForm.StatusProgress.Value = 0; 45 mainForm.StatusProgress.Value = 0;
46   46  
47 // import CSV regions 47 // import CSV regions
48 Vector3 localPosition; 48 Vector3 localPosition;
49 List<KeyValuePair<string, Vector3>> ConfiguredRegions = new List 49 var ConfiguredRegions = new List
50 <KeyValuePair<string, Vector3>>( 50 <KeyValuePair<string, Vector3>>(
51 File.ReadAllLines(file) 51 File.ReadAllLines(file)
52 .AsParallel() 52 .AsParallel()
53 .Select(o => new List<string>(CSV.ToEnumerable(o))) 53 .Select(o => new List<string>(CSV.ToEnumerable(o)))
54 .Where(o => o.Count == 2) 54 .Where(o => o.Count == 2)
55 .ToDictionary(o => o.First(), 55 .ToDictionary(o => o.First(),
56 p => 56 p =>
57 Vector3.TryParse(p.Last(), out localPosition) 57 Vector3.TryParse(p.Last(), out localPosition)
58 ? localPosition 58 ? localPosition
59 : Vector3.Zero)); 59 : Vector3.Zero));
60   60  
61 Vassal.vassalForm.BeginInvoke((MethodInvoker) (() => 61 Vassal.vassalForm.BeginInvoke((MethodInvoker) (() =>
62 { 62 {
63 Vassal.vassalForm.LoadedRegionsBox.Items.Clear(); 63 Vassal.vassalForm.LoadedRegionsBox.Items.Clear();
64 Vassal.vassalForm.LoadedRegionsBox.Items.AddRange( 64 Vassal.vassalForm.LoadedRegionsBox.Items.AddRange(
65 ConfiguredRegions.Select( 65 ConfiguredRegions.Select(
66 o => (object) new ListViewItem {Text = o.Key, Tag = o.Value}) 66 o => (object) new ListViewItem {Text = o.Key, Tag = o.Value})
67 .ToArray()); 67 .ToArray());
68 // Update batch restart grid view. 68 // Update batch restart grid view.
69 Vassal.vassalForm.BatchRestartGridView.Rows.Clear(); 69 Vassal.vassalForm.BatchRestartGridView.Rows.Clear();
70 foreach (KeyValuePair<string, Vector3> data in ConfiguredRegions) 70 foreach (var data in ConfiguredRegions)
71 { 71 {
72 Vassal.vassalForm.BatchRestartGridView.Rows.Add(data.Key, data.Value); 72 Vassal.vassalForm.BatchRestartGridView.Rows.Add(data.Key, data.Value);
73 } 73 }
74 // Update region state grid view. 74 // Update region state grid view.
75 Vassal.vassalForm.RegionsStateGridView.Rows.Clear(); 75 Vassal.vassalForm.RegionsStateGridView.Rows.Clear();
76 foreach (KeyValuePair<string, Vector3> data in ConfiguredRegions) 76 foreach (var data in ConfiguredRegions)
77 { 77 {
78 Vassal.vassalForm.RegionsStateGridView.Rows.Add(data.Key, "Check pending...", 78 Vassal.vassalForm.RegionsStateGridView.Rows.Add(data.Key, "Check pending...",
79 DateTime.Now.ToUniversalTime() 79 DateTime.Now.ToUniversalTime()
80 .ToString(Vassal.LINDEN_CONSTANTS.LSL.DATE_TIME_STAMP)); 80 .ToString(Vassal.LINDEN_CONSTANTS.LSL.DATE_TIME_STAMP));
81 } 81 }
82 })); 82 }));
83   83  
84 Regions.Items.Clear(); 84 Regions.Items.Clear();
85 Regions.Items.AddRange( 85 Regions.Items.AddRange(
86 ConfiguredRegions.Select( 86 ConfiguredRegions.Select(
87 o => 87 o =>
88 (object) 88 (object)
89 new ListViewItem 89 new ListViewItem
90 { 90 {
91 Text = o.Key + @" " + @"(" + o.Value.ToString() + @")", 91 Text = o.Key + @" " + @"(" + o.Value.ToString() + @")",
92 Tag = o 92 Tag = o
93 }) 93 })
94 .ToArray()); 94 .ToArray());
95   95  
96 mainForm.StatusText.Text = @"regions loaded"; 96 mainForm.StatusText.Text = @"regions loaded";
97 mainForm.StatusProgress.Value = 100; 97 mainForm.StatusProgress.Value = 100;
98 } 98 }
99 catch (Exception ex) 99 catch (Exception ex)
100 { 100 {
101 mainForm.StatusText.Text = ex.Message; 101 mainForm.StatusText.Text = ex.Message;
102 } 102 }
103 })); 103 }));
104 }) 104 })
105 {IsBackground = true, Priority = ThreadPriority.Normal}.Start(); 105 {IsBackground = true, Priority = ThreadPriority.Normal}.Start();
106 break; 106 break;
107 } 107 }
108 })); 108 }));
109 } 109 }
110   110  
111 private void SaveRegionsRequested(object sender, EventArgs e) 111 private void SaveRegionsRequested(object sender, EventArgs e)
112 { 112 {
113 mainForm.BeginInvoke((MethodInvoker) (() => 113 mainForm.BeginInvoke((MethodInvoker) (() =>
114 { 114 {
115 switch (mainForm.SaveRegionsDialog.ShowDialog()) 115 switch (mainForm.SaveRegionsDialog.ShowDialog())
116 { 116 {
117 case DialogResult.OK: 117 case DialogResult.OK:
118 string file = mainForm.SaveRegionsDialog.FileName; 118 var file = mainForm.SaveRegionsDialog.FileName;
119 new Thread(() => 119 new Thread(() =>
120 { 120 {
121 mainForm.BeginInvoke((MethodInvoker) (() => 121 mainForm.BeginInvoke((MethodInvoker) (() =>
122 { 122 {
123 try 123 try
124 { 124 {
125 mainForm.StatusText.Text = @"saving regions..."; 125 mainForm.StatusText.Text = @"saving regions...";
126 mainForm.StatusProgress.Value = 0; 126 mainForm.StatusProgress.Value = 0;
127   127  
128 // Save the regions to CSV. 128 // Save the regions to CSV.
129 using ( 129 using (
130 StreamWriter streamWriter = 130 var streamWriter =
131 new StreamWriter(file, false, 131 new StreamWriter(file, false,
132 Encoding.UTF8)) 132 Encoding.UTF8))
133 { 133 {
134 foreach ( 134 foreach (
135 KeyValuePair<string, Vector3> region in 135 var region in
136 Regions.Items.Cast<ListViewItem>() 136 Regions.Items.Cast<ListViewItem>()
137 .Select(o => (KeyValuePair<string, Vector3>) o.Tag)) 137 .Select(o => (KeyValuePair<string, Vector3>) o.Tag))
138 { 138 {
139 streamWriter.Write( 139 streamWriter.Write(
140 CSV.FromEnumerable(new[] {region.Key, region.Value.ToString()})); 140 CSV.FromEnumerable(new[] {region.Key, region.Value.ToString()}));
141 streamWriter.Write(Environment.NewLine); 141 streamWriter.Write(Environment.NewLine);
142 } 142 }
143 } 143 }
144   144  
145 mainForm.StatusText.Text = @"regions saved"; 145 mainForm.StatusText.Text = @"regions saved";
146 mainForm.StatusProgress.Value = 100; 146 mainForm.StatusProgress.Value = 100;
147 } 147 }
148 catch (Exception ex) 148 catch (Exception ex)
149 { 149 {
150 mainForm.StatusText.Text = ex.Message; 150 mainForm.StatusText.Text = ex.Message;
151 } 151 }
152 })); 152 }));
153 }) 153 })
154 {IsBackground = true, Priority = ThreadPriority.Normal}.Start(); 154 {IsBackground = true, Priority = ThreadPriority.Normal}.Start();
155 break; 155 break;
156 } 156 }
157 })); 157 }));
158 } 158 }
159   159  
160 private void RegionEditShown(object sender, EventArgs e) 160 private void RegionEditShown(object sender, EventArgs e)
161 { 161 {
162 Regions.Items.Clear(); 162 Regions.Items.Clear();
163 // Get all the regions if they exist. 163 // Get all the regions if they exist.
164 if (File.Exists(Vassal.VASSAL_CONSTANTS.VASSAL_REGIONS)) 164 if (File.Exists(Vassal.VASSAL_CONSTANTS.VASSAL_REGIONS))
165 { 165 {
166 Vector3 localPosition; 166 Vector3 localPosition;
167 List<KeyValuePair<string, Vector3>> ConfiguredRegions = new List<KeyValuePair<string, Vector3>>( 167 var ConfiguredRegions = new List<KeyValuePair<string, Vector3>>(
168 File.ReadAllLines(Vassal.VASSAL_CONSTANTS.VASSAL_REGIONS) 168 File.ReadAllLines(Vassal.VASSAL_CONSTANTS.VASSAL_REGIONS)
169 .Select(o => new List<string>(CSV.ToEnumerable(o))) 169 .Select(o => new List<string>(CSV.ToEnumerable(o)))
170 .Where(o => o.Count == 2) 170 .Where(o => o.Count == 2)
171 .ToDictionary(o => o.First(), 171 .ToDictionary(o => o.First(),
172 p => 172 p =>
173 Vector3.TryParse(p.Last(), out localPosition) 173 Vector3.TryParse(p.Last(), out localPosition)
174 ? localPosition 174 ? localPosition
175 : Vector3.Zero).OrderBy(o => o.Key).ToDictionary(o => o.Key, o => o.Value)); 175 : Vector3.Zero).OrderBy(o => o.Key).ToDictionary(o => o.Key, o => o.Value));
176 Regions.Items.AddRange( 176 Regions.Items.AddRange(
177 ConfiguredRegions.Select( 177 ConfiguredRegions.Select(
178 o => (object) new ListViewItem {Text = o.Key + @" " + @"(" + o.Value.ToString() + @")", Tag = o}) 178 o => (object) new ListViewItem {Text = o.Key + @" " + @"(" + o.Value.ToString() + @")", Tag = o})
179 .ToArray()); 179 .ToArray());
180 } 180 }
181 } 181 }
182   182  
183 private void RequestAddRegion(object sender, EventArgs e) 183 private void RequestAddRegion(object sender, EventArgs e)
184 { 184 {
185 mainForm.BeginInvoke((MethodInvoker) (() => 185 mainForm.BeginInvoke((MethodInvoker) (() =>
186 { 186 {
187 if (string.IsNullOrEmpty(RegionName.Text)) 187 if (string.IsNullOrEmpty(RegionName.Text))
188 { 188 {
189 RegionName.BackColor = Color.MistyRose; 189 RegionName.BackColor = Color.MistyRose;
190 return; 190 return;
191 } 191 }
192 Vector3 position; 192 Vector3 position;
193 if (!Vector3.TryParse(RegionPosition.Text, out position)) 193 if (!Vector3.TryParse(RegionPosition.Text, out position))
194 { 194 {
195 RegionPosition.BackColor = Color.MistyRose; 195 RegionPosition.BackColor = Color.MistyRose;
196 return; 196 return;
197 } 197 }
198 RegionName.BackColor = Color.Empty; 198 RegionName.BackColor = Color.Empty;
199 RegionPosition.BackColor = Color.Empty; 199 RegionPosition.BackColor = Color.Empty;
200 Regions.Items.Add(new ListViewItem 200 Regions.Items.Add(new ListViewItem
201 { 201 {
202 Text = RegionName.Text + @" " + @"(" + position + @")", 202 Text = RegionName.Text + @" " + @"(" + position + @")",
203 Tag = new KeyValuePair<string, Vector3>(RegionName.Text, position) 203 Tag = new KeyValuePair<string, Vector3>(RegionName.Text, position)
204 }); 204 });
205   205  
206 // Update drop down box. 206 // Update drop down box.
207 Vassal.vassalForm.BeginInvoke((MethodInvoker) (() => 207 Vassal.vassalForm.BeginInvoke((MethodInvoker) (() =>
208 { 208 {
209 Vassal.vassalForm.LoadedRegionsBox.Items.Add(new ListViewItem 209 Vassal.vassalForm.LoadedRegionsBox.Items.Add(new ListViewItem
210 { 210 {
211 Text = RegionName.Text, 211 Text = RegionName.Text,
212 Tag = position 212 Tag = position
213 }); 213 });
214 // Add the row to the batch restart grid view. 214 // Add the row to the batch restart grid view.
215 Vassal.vassalForm.BatchRestartGridView.Rows.Add(RegionName.Text, position.ToString()); 215 Vassal.vassalForm.BatchRestartGridView.Rows.Add(RegionName.Text, position.ToString());
216 Vassal.vassalForm.RegionsStateGridView.Rows.Add(RegionName.Text, "Check pending...", 216 Vassal.vassalForm.RegionsStateGridView.Rows.Add(RegionName.Text, "Check pending...",
217 DateTime.Now.ToUniversalTime() 217 DateTime.Now.ToUniversalTime()
218 .ToString(Vassal.LINDEN_CONSTANTS.LSL.DATE_TIME_STAMP)); 218 .ToString(Vassal.LINDEN_CONSTANTS.LSL.DATE_TIME_STAMP));
219 })); 219 }));
220 })); 220 }));
221 } 221 }
222   222  
223 private void RequestRemoveRegion(object sender, EventArgs e) 223 private void RequestRemoveRegion(object sender, EventArgs e)
224 { 224 {
225 mainForm.BeginInvoke((MethodInvoker) (() => 225 mainForm.BeginInvoke((MethodInvoker) (() =>
226 { 226 {
227 ListViewItem listViewItem = Regions.SelectedItem as ListViewItem; 227 var listViewItem = Regions.SelectedItem as ListViewItem;
228 if (listViewItem == null) 228 if (listViewItem == null)
229 { 229 {
230 Regions.BackColor = Color.MistyRose; 230 Regions.BackColor = Color.MistyRose;
231 return; 231 return;
232 } 232 }
233   233  
234 int selectedItemIndex = Regions.SelectedIndex; 234 var selectedItemIndex = Regions.SelectedIndex;
235 if (selectedItemIndex == -1) 235 if (selectedItemIndex == -1)
236 return; 236 return;
237   237  
238 Regions.BackColor = Color.Empty; 238 Regions.BackColor = Color.Empty;
239   239  
240 Vassal.vassalForm.BeginInvoke((MethodInvoker) (() => 240 Vassal.vassalForm.BeginInvoke((MethodInvoker) (() =>
241 { 241 {
242 Vassal.vassalForm.LoadedRegionsBox.Items.RemoveAt(selectedItemIndex); 242 Vassal.vassalForm.LoadedRegionsBox.Items.RemoveAt(selectedItemIndex);
243 // Update the batch restart grid view. 243 // Update the batch restart grid view.
244 Vassal.vassalForm.BatchRestartGridView.Rows.RemoveAt(selectedItemIndex); 244 Vassal.vassalForm.BatchRestartGridView.Rows.RemoveAt(selectedItemIndex);
245 Vassal.vassalForm.RegionsStateGridView.Rows.RemoveAt(selectedItemIndex); 245 Vassal.vassalForm.RegionsStateGridView.Rows.RemoveAt(selectedItemIndex);
246 })); 246 }));
247   247  
248 Regions.Items.RemoveAt(Regions.SelectedIndex); 248 Regions.Items.RemoveAt(Regions.SelectedIndex);
249 })); 249 }));
250 } 250 }
251   251  
252 private void RegionSettingChanged(object sender, EventArgs e) 252 private void RegionSettingChanged(object sender, EventArgs e)
253 { 253 {
254 mainForm.BeginInvoke((MethodInvoker) (() => 254 mainForm.BeginInvoke((MethodInvoker) (() =>
255 { 255 {
256 ListViewItem listViewItem = Regions.SelectedItem as ListViewItem; 256 var listViewItem = Regions.SelectedItem as ListViewItem;
257 if (listViewItem == null) 257 if (listViewItem == null)
258 return; 258 return;
259   259  
260 int selectedItemIndex = Regions.SelectedIndex; 260 var selectedItemIndex = Regions.SelectedIndex;
261 if (selectedItemIndex == -1) 261 if (selectedItemIndex == -1)
262 return; 262 return;
263   263  
264 if (string.IsNullOrEmpty(RegionName.Text)) 264 if (string.IsNullOrEmpty(RegionName.Text))
265 { 265 {
266 RegionName.BackColor = Color.MistyRose; 266 RegionName.BackColor = Color.MistyRose;
267 RegionPosition.BackColor = Color.MistyRose; 267 RegionPosition.BackColor = Color.MistyRose;
268 return; 268 return;
269 } 269 }
270   270  
271 Vector3 position; 271 Vector3 position;
272 if (!Vector3.TryParse(RegionPosition.Text, out position)) 272 if (!Vector3.TryParse(RegionPosition.Text, out position))
273 { 273 {
274 RegionPosition.BackColor = Color.MistyRose; 274 RegionPosition.BackColor = Color.MistyRose;
275 return; 275 return;
276 } 276 }
277   277  
278 RegionName.BackColor = Color.Empty; 278 RegionName.BackColor = Color.Empty;
279 RegionPosition.BackColor = Color.Empty; 279 RegionPosition.BackColor = Color.Empty;
280   280  
281   281  
282 Vassal.vassalForm.BeginInvoke((MethodInvoker) (() => 282 Vassal.vassalForm.BeginInvoke((MethodInvoker) (() =>
283 { 283 {
284 if (Vassal.vassalForm.LoadedRegionsBox.Items.Count > selectedItemIndex) 284 if (Vassal.vassalForm.LoadedRegionsBox.Items.Count > selectedItemIndex)
285 { 285 {
286 Vassal.vassalForm.LoadedRegionsBox.Items[selectedItemIndex] = new ListViewItem 286 Vassal.vassalForm.LoadedRegionsBox.Items[selectedItemIndex] = new ListViewItem
287 { 287 {
288 Text = RegionName.Text, 288 Text = RegionName.Text,
289 Tag = position 289 Tag = position
290 }; 290 };
291 } 291 }
292 // Update the batch restart grid view. 292 // Update the batch restart grid view.
293 if (Vassal.vassalForm.BatchRestartGridView.Rows.Count > selectedItemIndex) 293 if (Vassal.vassalForm.BatchRestartGridView.Rows.Count > selectedItemIndex)
294 { 294 {
295 Vassal.vassalForm.BatchRestartGridView.Rows[selectedItemIndex].Cells["BatchRestartRegionName"] 295 Vassal.vassalForm.BatchRestartGridView.Rows[selectedItemIndex].Cells["BatchRestartRegionName"]
296 .Value 296 .Value
297 = RegionName.Text; 297 = RegionName.Text;
298 Vassal.vassalForm.BatchRestartGridView.Rows[selectedItemIndex].Cells["BatchRestartPosition"] 298 Vassal.vassalForm.BatchRestartGridView.Rows[selectedItemIndex].Cells["BatchRestartPosition"]
299 .Value 299 .Value
300 = position.ToString(); 300 = position.ToString();
301 } 301 }
302 // Update the region state grid view. 302 // Update the region state grid view.
303 if (Vassal.vassalForm.RegionsStateGridView.Rows.Count > selectedItemIndex) 303 if (Vassal.vassalForm.RegionsStateGridView.Rows.Count > selectedItemIndex)
304 { 304 {
305 Vassal.vassalForm.RegionsStateGridView.Rows[selectedItemIndex].Cells["RegionsStateRegionName"] 305 Vassal.vassalForm.RegionsStateGridView.Rows[selectedItemIndex].Cells["RegionsStateRegionName"]
306 .Value 306 .Value
307 = RegionName.Text; 307 = RegionName.Text;
308 Vassal.vassalForm.RegionsStateGridView.Rows[selectedItemIndex].Cells["RegionsStateLastState"] 308 Vassal.vassalForm.RegionsStateGridView.Rows[selectedItemIndex].Cells["RegionsStateLastState"]
309 .Value 309 .Value
310 = "Check pending..."; 310 = "Check pending...";
311 Vassal.vassalForm.RegionsStateGridView.Rows[selectedItemIndex].Cells["RegionsStateLastCheck"] 311 Vassal.vassalForm.RegionsStateGridView.Rows[selectedItemIndex].Cells["RegionsStateLastCheck"]
312 .Value 312 .Value
313 = DateTime.Now.ToUniversalTime() 313 = DateTime.Now.ToUniversalTime()
314 .ToString(Vassal.LINDEN_CONSTANTS.LSL.DATE_TIME_STAMP); 314 .ToString(Vassal.LINDEN_CONSTANTS.LSL.DATE_TIME_STAMP);
315 } 315 }
316 })); 316 }));
317   317  
318 Regions.Items[selectedItemIndex] = new ListViewItem 318 Regions.Items[selectedItemIndex] = new ListViewItem
319 { 319 {
320 Text = RegionName.Text + @" " + @"(" + position + @")", 320 Text = RegionName.Text + @" " + @"(" + position + @")",
321 Tag = new KeyValuePair<string, Vector3>(RegionName.Text, position) 321 Tag = new KeyValuePair<string, Vector3>(RegionName.Text, position)
322 }; 322 };
323 })); 323 }));
324 } 324 }
325   325  
326 private void RegionSelected(object sender, EventArgs e) 326 private void RegionSelected(object sender, EventArgs e)
327 { 327 {
328 mainForm.BeginInvoke((MethodInvoker) (() => 328 mainForm.BeginInvoke((MethodInvoker) (() =>
329 { 329 {
330 ListViewItem listViewItem = Regions.SelectedItem as ListViewItem; 330 var listViewItem = Regions.SelectedItem as ListViewItem;
331 if (listViewItem == null) 331 if (listViewItem == null)
332 return; 332 return;
333   333  
334 int selectedItemIndex = Regions.SelectedIndex; 334 var selectedItemIndex = Regions.SelectedIndex;
335 if (selectedItemIndex == -1) 335 if (selectedItemIndex == -1)
336 return; 336 return;
337   337  
338 KeyValuePair<string, Vector3> region = (KeyValuePair<string, Vector3>) listViewItem.Tag; 338 var region = (KeyValuePair<string, Vector3>) listViewItem.Tag;
339 RegionName.Text = region.Key; 339 RegionName.Text = region.Key;
340 RegionPosition.Text = region.Value.ToString(); 340 RegionPosition.Text = region.Value.ToString();
341 })); 341 }));
342 } 342 }
-   343  
-   344 private void ShowToolTip(object sender, EventArgs e)
-   345 {
-   346 mainForm.BeginInvoke(
-   347 (Action) (() =>
-   348 {
-   349 var pictureBox = sender as PictureBox;
-   350 if (pictureBox != null)
-   351 {
-   352 toolTip1.Show(toolTip1.GetToolTip(pictureBox), pictureBox);
-   353 }
-   354 }));
-   355 }
343 } 356 }
344 } 357 }
345   358  
346
Generated by GNU Enscript 1.6.5.90.
359
Generated by GNU Enscript 1.6.5.90.
347   360  
348   361  
349   362