private void Notify(NotifyFlag notify, string title, string text, StateLog state, ToolTipIcon icon = ToolTipIcon.Info) { if (IsHandleCreated) { Invoke(new Action(() => { switch (state) { case StateLog.Normal: _notify.Icon = Resources.state_normal; break; case StateLog.Busy: _notify.Icon = Resources.state_busy; break; case StateLog.Listen: _notify.Icon = Resources.state_listen; break; } })); } if (config.Notify >= notify) { _notify.ShowBalloonTip(1000, title, text, icon); } }
public void Init(Main main) { this.main = main; var reg = GetRegPath(); Active = (int)reg.GetValue("ACTIVE", 1) > 0; Mute = (int)reg.GetValue("MUTE", 0) > 0; Solo = (int)reg.GetValue("SOLO", 0) > 0; Port = (int)reg.GetValue("PORT", Port); FileTransfer = (FileTransferFlag)reg.GetValue("FILE", FileTransfer); Notify = (NotifyFlag)reg.GetValue("NOTIFY", Notify); if (reg.GetValue("HOSTS", null) is string hosts2) { var hosts = hosts2.Split('|'); foreach (var host in hosts) { main.AddHost(host); } } main.__file0.Tag = FileTransferFlag.Block; main.__file1.Tag = FileTransferFlag.Single; main.__file2.Tag = FileTransferFlag.Allow; main.__notify0.Tag = NotifyFlag.Silent; main.__notify1.Tag = NotifyFlag.Informative; main.__notify2.Tag = NotifyFlag.Verbose; main.__version.Text = "v" + Utility.GetVersion(); Validate(); }
public void Reset() { Active = true; Mute = false; Solo = false; Port = 5000; FileTransfer = FileTransferFlag.Allow; Notify = NotifyFlag.Informative; Validate(true); }