/// <summary>
        ///     Initializes a new instance of the
        ///     <see cref="AlfredModule" />
        ///     class.
        /// </summary>
        /// <exception cref="ArgumentNullException">
        ///     Thrown when one or more required arguments are null.
        /// </exception>
        /// <param name="container"> The container. </param>
        public AlfredTimeModule([NotNull] IObjectContainer container)
            : base(container)
        {
            if (container == null) { throw new ArgumentNullException(nameof(container)); }

            CurrentDateWidget = new TextWidget(BuildWidgetParameters(@"lblCurrentDate"));
            CurrentTimeWidget = new TextWidget(BuildWidgetParameters(@"lblCurrentTime"));

            AlertWidget = new WarningWidget(BuildWidgetParameters(@"warnAlert"))
            {
                IsVisible = false,
                Text = Resources.AlfredTimeModule_AlfredTimeModule_BedtimeNagMessage
            };

            AlertHour = 21;
            AlertMinute = 30;
            AlertDurationInHours = 4;
            IsAlertEnabled = true;

            CurrentTime = DateTime.MinValue;
        }
Exemple #2
0
 public void CanInstantiateWarningWidget()
 {
     var widget = new WarningWidget(new WidgetCreationParameters("Test"));
 }