-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHelper.cs
89 lines (85 loc) · 2.82 KB
/
Helper.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<<<<<<< HEAD
namespace ImgRip
{
using System;
using System.Windows.Forms;
using Google.GData.Client;
/// <summary>
/// UI Callback Helper
/// </summary>
static class UICallBack
{
public static void cbEnable(this Control ctl, bool enable)
{
if (ctl.IsHandleCreated)
ctl.Invoke(new Action(() => ctl.Enabled = enable));
}
public static void EnableControls(bool enable, params Control[] ctls)
{
foreach (var ctl in ctls)
{
if (ctl.IsHandleCreated)
ctl.Invoke(new Action(() => ctl.Enabled = enable));
}
}
public static void cbAdd(this ListView lv, object data, int imgindex)
{
if (lv.IsHandleCreated)
switch (WebCloud.Service)
{
case WebCloud.CloudType.Flickr:
break;
case WebCloud.CloudType.Facebook:
break;
case WebCloud.CloudType.GDrive:
case WebCloud.CloudType.Picasa:
var ae = data as AtomEntry;
lv.Invoke(new Action(() => lv.Items.Add(new ListViewItem(ae.Title.Text, imgindex) { Tag = ae, ToolTipText = ae.AlternateUri.Content })));
break;
}
}
}
}
=======
namespace ImgRip
{
using System;
using System.Windows.Forms;
using Google.GData.Client;
/// <summary>
/// UI Callback Helper
/// </summary>
static class UICallBack
{
public static void cbEnable(this Control ctl, bool enable)
{
if (ctl.IsHandleCreated)
ctl.Invoke(new Action(() => ctl.Enabled = enable));
}
public static void EnableControls(bool enable, params Control[] ctls)
{
foreach (var ctl in ctls)
{
if (!ctl.IsHandleCreated) break;
ctl.Invoke(new Action(() => ctl.Enabled = enable));
}
}
public static void cbAdd(this ListView lv, object data, int imgindex)
{
if (lv.IsHandleCreated)
switch (WebCloud.Service)
{
case WebCloud.CloudType.Flickr:
break;
case WebCloud.CloudType.Facebook:
break;
case WebCloud.CloudType.GDrive:
case WebCloud.CloudType.Picasa:
var ae = data as AtomEntry;
lv.Invoke(new Action(() => lv.Items.Add(new ListViewItem(ae.Title.Text, imgindex) { Tag = ae, ToolTipText = ae.AlternateUri.Content })));
break;
}
}
}
}
>>>>>>> parent of fb9b497... Sync from codeplex