-
Notifications
You must be signed in to change notification settings - Fork 1
/
frmShareBuild.cs
79 lines (69 loc) · 2.53 KB
/
frmShareBuild.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SC2Scrapbook
{
public partial class frmShareBuild : Form
{
public frmShareBuild(Models.Build build)
{
InitializeComponent();
string sharecode = build.SaveBase64();
txtBBCode.Text = string.Format("[url=sc2bo://{0}]{1}[/url]", sharecode, build.Name);
txtHTML.Text = string.Format("<a href=\"sc2bo://{0}\" title=\"SC2 Scrapbook - Build Order Sharecode\">{1}</a>", sharecode, build.Name);
txtReddit.Text = string.Format("[{1}](sc2bo://{0} \"SC2 Scrapbook - Build Order Sharecode\")", sharecode, build.Name.Replace("[", "\\[").Replace("]", "\\]"));
txtShareCode.Text = string.Format("sc2bo://{0}", sharecode);
}
private void btnCopySharecode_Click(object sender, EventArgs e)
{
try
{
Clipboard.SetDataObject(txtShareCode.Text, true, 50, 50);
}
catch {
MessageBox.Show("Failed to access system clipboard.", "Fail :(", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnShareHTML_Click(object sender, EventArgs e)
{
try
{
Clipboard.SetDataObject(txtHTML.Text, true, 50, 50);
}
catch
{
MessageBox.Show("Failed to access system clipboard.", "Fail :(", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnShareBBCode_Click(object sender, EventArgs e)
{
try
{
Clipboard.SetDataObject(txtBBCode.Text, true, 50, 50);
}
catch
{
MessageBox.Show("Failed to access system clipboard.", "Fail :(", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnShareReddit_Click(object sender, EventArgs e)
{
try
{
Clipboard.SetDataObject(txtReddit.Text, true, 50, 50);
}
catch
{
MessageBox.Show("Failed to access system clipboard.", "Fail :(", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void frmShareBuild_Load(object sender, EventArgs e)
{
}
}
}