private static void Main(string[] args) { ShortCutCreator.TryCreateShortcut("ConsoleToast.App", "ConsoleToast"); Console.WriteLine("Type 'exit' to quit. ENTER to show a notification"); while (true) { var text = Console.ReadLine(); if (text == "exit") { break; } /*ShowImageToast( * "ConsoleToast.App", * DateTime.Now.ToLongTimeString() + " title with image", * text, * Path.GetFullPath("plasticlogo.png"));*/ ShowTextToast( "ConsoleToast.App", DateTime.Now.ToLongTimeString() + " TITLE", text); } /*ShowTextToast( * "ConsoleToast.App", * DateTime.Now.ToLongTimeString() + "title", * "this is a message");*/ }
public WinToastNotificationServer() { Post("/", async _ => { await showToast(this.BindTo(new ToastMessageModel())); return(string.Empty); }); ShortCutCreator.TryCreateShortcut(applicationId, "File Watcher"); }
static void Main(string[] args) { ShortCutCreator.TryCreateShortcut("ConsoleToast.App", "ConsoleToast"); Console.WriteLine("Type 'exit' to quit. ENTER to show a notification"); while (Console.ReadLine() != "exit") { ShowImageToast( "ConsoleToast.App", DateTime.Now.ToLongTimeString() + " title with image", "this is a message", Path.GetFullPath("plasticlogo.png")); /*ShowTextToast( * "ConsoleToast.App", * DateTime.Now.ToLongTimeString() + "title", * "this is a message");*/ } }
static void Main(string[] args) { //Initialize helper classes rcHelper rc = new rcHelper(); Program p = new Program(); //Set current directory to match up with rcConfig's string s = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\RedditCrawler"; if (!Directory.Exists(s)) { Directory.CreateDirectory(s); } Directory.SetCurrentDirectory(s); //Create shortcut for application for toast notification's access to Windows try { ShortCutCreator.TryCreateShortcut(appID, "RedditCrawler"); } catch (Exception ex) { rc.DebugLog(ex); } //Validates login, logs failures. RCDetails json = new RCDetails(); if (File.Exists(Path.Combine(Directory.GetCurrentDirectory().ToString() + jsonFilePath))) { json = rc.GetJson(jsonFilePath); } try { p.Listen().Wait(); } catch (Exception ex) { rc.DebugLog(ex); } }
private void OnInit() { if (_pluginInitializing) { return; } _pluginInitializing = true; if (_ffxivPlugin != null) { _ffxivPlugin.cbEnabled.CheckedChanged -= FFXIVParsingPlugin_IsEnabledChanged; } // Before anything else, if the FFXIV Parsing Plugin is not already initialized // than this plugin cannot start var plugins = ActGlobals.oFormActMain.ActPlugins; _ffxivPlugin = plugins.FirstOrDefault(x => x.lblPluginTitle.Text == "FFXIV_ACT_Plugin.dll"); if (_ffxivPlugin == null) { _pluginInitializing = false; ActGlobals.oFormActMain.PluginGetSelfData(this).cbEnabled.Checked = false; _labelStatus.Text = "FFXIV_ACT_Plugin must be installed BEFORE DFAssist!"; return; } else { _ffxivPlugin.cbEnabled.CheckedChanged += FFXIVParsingPlugin_IsEnabledChanged; if (!_ffxivPlugin.cbEnabled.Checked) { _pluginInitializing = false; ActGlobals.oFormActMain.PluginGetSelfData(this).cbEnabled.Checked = false; _labelStatus.Text = "FFXIV_ACT_Plugin must be enabled"; return; } } ActGlobals.oFormActMain.Shown -= ActMainFormOnShown; var pluginData = ActGlobals.oFormActMain.PluginGetSelfData(this); var enviroment = Path.GetDirectoryName(pluginData.pluginFile.ToString()); AssemblyResolver.Initialize(enviroment); Logger.SetTextBox(_richTextBox1); Logger.Debug("----------------------------------------------------------------"); Logger.Debug("Plugin Init"); Logger.Debug($"Plugin Version: {Assembly.GetExecutingAssembly().GetName().Version}"); var defaultLanguage = new Language { Name = "English", Code = "en-us" }; LoadData(defaultLanguage); // The shortcut must be created to work with windows 8/10 Toasts Logger.Debug(ShortCutCreator.TryCreateShortcut(AppId, AppId) ? "Shortcut for ACT found" : "Unable to Create the Shorctut for ACT"); _isPluginEnabled = true; Logger.Debug("Plugin Enabled"); _languageComboBox.DataSource = new[] { defaultLanguage, new Language { Name = "한국어", Code = "ko-kr" }, new Language { Name = "日本語", Code = "ja-jp" }, new Language { Name = "Français", Code = "fr-fr" } }; _languageComboBox.DisplayMember = "Name"; _languageComboBox.ValueMember = "Code"; _labelStatus.Text = "Starting..."; _labelStatus.Text = Localization.GetText("l-plugin-started"); _labelTab.Text = Localization.GetText("app-name"); Logger.Debug("Plugin Started!"); _labelTab.Controls.Add(this); _xmlSettingsSerializer = new SettingsSerializer(this); LoadSettings(); LoadData(); UpdateProcesses(); _languageComboBox.SelectedValueChanged += LanguageComboBox_SelectedValueChanged; if (_timer == null) { _timer = new Timer { Interval = 30000 }; _timer.Tick += Timer_Tick; } _timer.Enabled = true; // shows a test toast ToastWindowNotification(Localization.GetText("ui-toast-notification-test-title"), Localization.GetText("ui-toast-notification-test-message")); _pluginInitializing = false; ActGlobals.oFormActMain.UpdateCheckClicked += FormActMain_UpdateCheckClicked; if (ActGlobals.oFormActMain.GetAutomaticUpdatesAllowed()) { new Thread(FormActMain_UpdateCheckClicked).Start(); } Logger.Debug("----------------------------------------------------------------"); }
private void OnInit() { if (_pluginInitializing) { return; } _pluginInitializing = true; Logger.SetTextBox(_richTextBox1); ActGlobals.oFormActMain.Shown -= ActMainFormOnShown; var defaultLanguage = new Language { Name = "English", Code = "en-us" }; LoadData(defaultLanguage); // The shortcut must be created to work with windows 8/10 Toasts ShortCutCreator.TryCreateShortcut(AppId, AppId); _isPluginEnabled = true; _languageComboBox.DataSource = new[] { defaultLanguage, new Language { Name = "한국어", Code = "ko-kr" }, new Language { Name = "日本語", Code = "ja-jp" }, new Language { Name = "Français", Code = "fr-fr" } }; _languageComboBox.DisplayMember = "Name"; _languageComboBox.ValueMember = "Code"; _labelStatus.Text = "Starting..."; UpdateTranslations(); _labelStatus.Text = Localization.GetText("l-plugin-started"); _labelTab.Text = Localization.GetText("app-name"); _labelTab.Controls.Add(this); _xmlSettingsSerializer = new SettingsSerializer(this); LoadSettings(); UpdateProcesses(); if (_timer == null) { _timer = new Timer { Interval = 30000 }; _timer.Tick += Timer_Tick; } _timer.Enabled = true; // show a test toast ToastWindowNotification(Localization.GetText("ui-toast-notification-test-title"), Localization.GetText("ui-toast-notification-test-message")); _pluginInitializing = false; ActGlobals.oFormActMain.UpdateCheckClicked += FormActMain_UpdateCheckClicked; if (ActGlobals.oFormActMain.GetAutomaticUpdatesAllowed()) { new Thread(FormActMain_UpdateCheckClicked).Start(); } }