本文整理汇总了C#中MainForm.text_notification方法的典型用法代码示例。如果您正苦于以下问题:C# MainForm.text_notification方法的具体用法?C# MainForm.text_notification怎么用?C# MainForm.text_notification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainForm
的用法示例。
在下文中一共展示了MainForm.text_notification方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpellLibraryForm
public SpellLibraryForm(MainForm mainForm)
{
this.mainForm = mainForm;
npcPath = Path.Combine(spellLibPath, "game", "scripts", "npc");
luaHeroesPath = Path.Combine(spellLibPath, "game", "scripts", "vscripts", "heroes");
luaItemsPath = Path.Combine(spellLibPath, "game", "scripts", "vscripts", "items");
InitializeComponent();
notificationLabel.Text = "";
textBox1.KeyDown += TextBox1_KeyDown;
//luaKVBtn.Visible = false;
if (!Directory.Exists(spellLibPath)) {
DialogResult dr = MetroMessageBox.Show(mainForm, "SpellLibrary will now be cloned into " + spellLibPath,
"SpellLibrary not found",
MessageBoxButtons.OKCancel,
MessageBoxIcon.Information);
if (dr != DialogResult.OK) {
return;
}
}
// user wants to continue, clone if necessary, and pull
mainForm.SpellLibBtn.Enabled = false;
mainForm.ProgressSpinner1.Value = 60;
mainForm.ProgressSpinner1.Visible = true;
if (!Directory.Exists(spellLibPath)) {
mainForm.text_notification("Cloning SpellLibrary...", MetroColorStyle.Blue, 999999);
} else {
mainForm.text_notification("Pulling SpellLibrary...", MetroColorStyle.Blue, 999999);
}
using (var cloneWorker = new BackgroundWorker()) {
cloneWorker.RunWorkerCompleted += CloneWorker_RunWorkerCompleted;
cloneWorker.DoWork += CloneWorker_DoWork;
cloneWorker.RunWorkerAsync();
}
}
示例2: SpellLibraryForm
public SpellLibraryForm(MainForm mainForm) {
this.mainForm = mainForm;
npcPath = Path.Combine(spellLibPath, "game", "scripts", "npc");
luaHeroesPath = Path.Combine(spellLibPath, "game", "scripts", "vscripts", "heroes");
luaItemsPath = Path.Combine(spellLibPath, "game", "scripts", "vscripts", "items");
InitializeComponent();
notificationLabel.Text = "";
textBox1.KeyDown += (s, e) => {
if (e.Control && (e.KeyCode == Keys.A)) {
textBox1.SelectAll();
}
};
if (!Directory.Exists(spellLibPath)) {
DialogResult dr = MetroMessageBox.Show(mainForm, strings.SpellLibWillNowBeClonedMsg + " " + spellLibPath,
strings.SpellLibNotFoundCaption,
MessageBoxButtons.OKCancel,
MessageBoxIcon.Information);
if (dr != DialogResult.OK) {
return;
}
}
// user wants to continue, clone if necessary, and pull
mainForm.spellLibraryBtn.Enabled = false;
mainForm.progressSpinner1.Value = 60;
mainForm.progressSpinner1.Visible = true;
if (!Directory.Exists(spellLibPath)) {
mainForm.text_notification("Cloning SpellLibrary...", MetroColorStyle.Blue, 999999);
} else {
mainForm.text_notification("Pulling SpellLibrary...", MetroColorStyle.Blue, 999999);
}
var gitWorker = new BackgroundWorker();
gitWorker.RunWorkerCompleted += (s, e) => {
mainForm.text_notification("", MetroColorStyle.Blue, 500);
mainForm.progressSpinner1.Visible = false;
mainForm.spellLibraryBtn.Enabled = true;
initTreeView();
};
gitWorker.DoWork += (s, e) => {
if (!Directory.Exists(spellLibPath)) {
try {
string gitPath = Repository.Clone("https://github.com/Pizzalol/SpellLibrary", spellLibPath);
Console.WriteLine("repo path:" + gitPath);
} catch (Exception ex) {
}
return;
}
// pull from the repo
using (var repo = new Repository(spellLibPath)) {
try {
//var remote = repo.Network.Remotes["origin"];
MergeResult mr = repo.Network.Pull(new Signature("myname", "[email protected]",
new DateTimeOffset()),
new PullOptions());
MergeStatus ms = mr.Status;
} catch (Exception ex) {}
}
};
gitWorker.RunWorkerAsync();
}