当前位置: 首页>>代码示例>>C#>>正文


C# MainForm.text_notification方法代码示例

本文整理汇总了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();
            }
        }
开发者ID:kylie-xie,项目名称:Dota-2-ModKit,代码行数:39,代码来源:SpellLibraryForm.cs

示例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();
		}
开发者ID:KimimaroTsukimiya,项目名称:Dota-2-ModKit,代码行数:68,代码来源:SpellLibraryForm.cs


注:本文中的MainForm.text_notification方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。