<commit_before>﻿using System;
using System.Diagnostics;
using System.Windows.Forms;
using notifier.Languages;
using notifier.Properties;

namespace notifier {
	class Notification {

		#region #attributes

		/// <summary>
		/// Privacy possibilities
		/// </summary>
		public enum Privacy : uint {
			None = 0,
			Short = 1,
			All = 2
		}

		/// <summary>
		/// Type possibilities
		/// </summary>
		public enum Type : uint {
			None = 0,
			Info = 1,
			Warning = 2,
			Error = 3
		}

		/// <summary>
		/// Behavior possibilities
		/// </summary>
		public enum Behavior : uint {
			DoNothing = 0,
			Open = 1
		}

		/// <summary>
		/// Reference to the main interface
		/// </summary>
		private Main UI;

		#endregion

		#region #methods

		/// <summary>
		/// Class constructor
		/// </summary>
		public Notification(ref Main form) {
			UI = form;
		}

		/// <summary>
		/// Displays a notification balloon tip
		/// </summary>
		/// <param name="title">Title of the tip</param>
		/// <param name="text">Text contained in the balloon tip</param>
		/// <param name="icon">Icon of the tip</param>
		/// <param name="duration">How long the notification is displayed</param>
		public void Tip(string title, string text, Type icon = Type.Info, int duration = 450) {
			UI.notifyIcon.ShowBalloonTip(duration, title, text, (ToolTipIcon)icon);
		}

		/// <summary>
		/// Do the gmail specified action (inbox/message/spam) in a browser
		/// </summary>
		/// <param name="systray">Defines if the interaction is provided by the balloon tip</param>
		public void Interaction(bool balloon = false) {

			// by default, always open the gmail inbox in a browser if the interaction is provided by a double click on the systray icon
			if (Tag == null) {

				if (!balloon) {
					Process.Start(Settings.Default.GMAIL_BASEURL + "/#inbox");
				}

				return;
			}

			// do nothing if there is no tag or if the notification behavior is set to "do nothing"
			if (balloon && Settings.Default.NotificationBehavior == (int)Behavior.DoNothing) {
				return;
			}

			// opens a browser
			Process.Start(Settings.Default.GMAIL_BASEURL + "/" + Tag);<commit_msg>Fixes comment<commit_after>﻿using System;
using System.Diagnostics;
using System.Windows.Forms;
using notifier.Languages;
using notifier.Properties;

namespace notifier {
	class Notification {

		#region #attributes

		/// <summary>
		/// Privacy possibilities
		/// </summary>
		public enum Privacy : uint {
			None = 0,
			Short = 1,
			All = 2
		}

		/// <summary>
		/// Type possibilities
		/// </summary>
		public enum Type : uint {
			None = 0,
			Info = 1,
			Warning = 2,
			Error = 3
		}

		/// <summary>
		/// Behavior possibilities
		/// </summary>
		public enum Behavior : uint {
			DoNothing = 0,
			Open = 1
		}

		/// <summary>
		/// Reference to the main interface
		/// </summary>
		private Main UI;

		#endregion

		#region #methods

		/// <summary>
		/// Class constructor
		/// </summary>
		public Notification(ref Main form) {
			UI = form;
		}

		/// <summary>
		/// Displays a notification balloon tip
		/// </summary>
		/// <param name="title">Title of the tip</param>
		/// <param name="text">Text contained in the balloon tip</param>
		/// <param name="icon">Icon of the tip</param>
		/// <param name="duration">How long the notification is displayed</param>
		public void Tip(string title, string text, Type icon = Type.Info, int duration = 450) {
			UI.notifyIcon.ShowBalloonTip(duration, title, text, (ToolTipIcon)icon);
		}

		/// <summary>
		/// Do the gmail specified action (inbox/message/spam) in a browser
		/// </summary>
		/// <param name="systray">Defines if the interaction is provided by the balloon tip</param>
		public void Interaction(bool balloon = false) {

			// by default, always open the gmail inbox in a browser if the interaction is provided by a double click on the systray icon
			if (Tag == null) {

				if (!balloon) {
					Process.Start(Settings.Default.GMAIL_BASEURL + "/#inbox");
				}

				return;
			}

			// do nothing if the notification behavior is set to "do nothing"
			if (balloon && Settings.Default.NotificationBehavior == (int)Behavior.DoNothing) {
				return;
			}

			// opens a browser
			Process.Start(Settings.Default.GMAIL_BASEURL + "/" + Tag);
{'fraction_non_alphanumeric': 0.13615023474178403, 'fraction_numerical': 0.005633802816901409, 'mean_word_length': 2.705217391304348, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1834551', 'n_tokens_mistral': 1533, 'n_tokens_neox': 1274, 'n_words': 420}