public NotificationSummary(IProvideNotifications notifications)
        {
            if (notifications != null)
            {
                foreach (INotification n in notifications.Notifications)
                {
                    if (n.Type == "Email") EmailCount++;
                    if (n.Type == "Text") TextCount++;
                    if (n.Type == "MissedCall") MissedCallCount++;
                    if (n.Type == "Voice") VoiceCount++;

                }
            }
        }
Beispiel #2
0
        public App
        (
            IKnowStorage storageProvider,
            ICopyToClipboard clipboardProvider,
            IProvideNotifications notificationProvider
        )
        {
            InitializeComponent();

            IoCProviders.Register <IKnowStorage>(storageProvider);
            IoCProviders.Register <ICopyToClipboard>(clipboardProvider);
            IoCProviders.Register <IProvideNotifications>(notificationProvider);

            MainPage = new PasswordManager.MainPage();
        }
Beispiel #3
0
        public AnalogFace(IProvideNotifications notificationProvider, ISettings settings)
            : base(notificationProvider, settings)
        {

        }
Beispiel #4
0
        public void DrawTray(Bitmap screen, IProvideNotifications notificationProvider, Font font )
        {
            //battery level
            var level = Battery.Level;// Util.Random.Next(0, 100);
            this.DrawBattery(screen, new Point(1, 0), 13, 9, 1, Color.White, Color.Black, Battery.Charging,
                                level);
            screen.DrawText(level.ToString(), font, Color.White, 15, -2);

            var notificationSummary = new NotificationSummary(notificationProvider);
            if (notificationSummary.MissedCallCount > 99) notificationSummary.MissedCallCount = 99;
            if (notificationSummary.EmailCount > 99) notificationSummary.EmailCount = 99;
            if (notificationSummary.TextCount > 99) notificationSummary.TextCount = 99;
            if (notificationSummary.VoiceCount > 99) notificationSummary.VoiceCount = 99;

            if (notificationSummary.EmailCount > 0)
            {
                Debug.Print("Emails: " + notificationSummary.EmailCount.ToString());
                screen.DrawImage(33, 0, EmailImage, 0, 0, EmailImage.Width, EmailImage.Height);
                screen.DrawText(notificationSummary.EmailCount.ToString(), font, Color.White, 45, -2);
            }
            if (notificationSummary.TextCount > 0)
            {
                Debug.Print("Text: " + notificationSummary.TextCount.ToString());
                screen.DrawImage(58, 0, TextImage, 0, 0, TextImage.Width, TextImage.Height);
                screen.DrawText(notificationSummary.TextCount.ToString(), font, Color.White, 70, -2);
            }
            if (notificationSummary.VoiceCount > 0)
            {
                Debug.Print("Voice: " + notificationSummary.VoiceCount.ToString());
                screen.DrawImage(83, 0, VoiceMailImage, 0, 0, VoiceMailImage.Width, VoiceMailImage.Height);
                screen.DrawText(notificationSummary.VoiceCount.ToString(), font, Color.White, 95, -2);
            }
            if (notificationSummary.MissedCallCount > 0)
            {
                Debug.Print("Missed Calls: " + notificationSummary.MissedCallCount.ToString());
                screen.DrawImage(106, 0, CalendarImage, 0, 0, CalendarImage.Width, CalendarImage.Height);
                screen.DrawText(notificationSummary.MissedCallCount.ToString(), font, Color.White, 117, -2);
            }


        }
Beispiel #5
0
        public MonthFace(IProvideNotifications _notifications, ISettings settings)
            : base(_notifications, settings)
        {

            #region Setup the calendar data
            DateTime startDate = Settings.Now.AddDays(-7);
            DateTime endDate = Settings.Now.AddDays(21);

            int col = (int) startDate.DayOfWeek;
            int row = 0;
            TimeSpan diff = endDate - startDate;
            int rowStart = AGENT.Contrib.Device.Size/2 + 7;
            int colStart = 6;
            int colPos = 0;
            int rowPos = 0;
            for (int i = 0; i < diff.Days; i++)
            {
                DateTime current = startDate.AddDays(i);
                int width = current.Day.ToString().Length;
                switch (col)
                {
                    case 0:
                        colPos = colStart - width;
                        break;
                    case 1:
                        colPos = colStart + 20-width;
                        break;
                    case 2:
                        colPos = colStart + 40 - width;
                        break;
                    case 3:
                        colPos = colStart + 57 - width;
                        break;
                    case 4:
                        colPos = colStart + 75 - width;
                        break;
                    case 5:
                        colPos = colStart + 91 - width;
                        break;
                    default:
                        colPos = colStart + 108 - width;
                        break;
                };

                switch (row)
                {
                    case 0:
                        rowPos = rowStart;
                        break;
                    case 1:
                        rowPos = rowStart + 14;
                        break;
                    case 2:
                        rowPos = rowStart + 28;
                        break;
                    case 3:
                        rowPos = rowStart + 42;
                        break;
                    default:
                        rowPos = rowStart + 66;
                        break;
                };
                days.Add(new Day()
                    {
                        Text = current.Day.ToString(),
                        Point = new Point(colPos,rowPos),
                        Timestamp = current
                    });

                col++;
                if (col >= 7)
                {
                    row++;
                    col = 0;
                }
            }
            #endregion


        }
Beispiel #6
0
        public PolyFillFace(IProvideNotifications notificationProvider, ISettings settings)
            : base(notificationProvider, settings)
        {

        }
        public DigitalTimeFace(IProvideNotifications notificationProvider, ISettings settings) : base(notificationProvider, settings)
        {

        }
 public FaceWithTrayBase(IProvideNotifications notificationProvider, ISettings settings)
 {
     Settings = settings;
     _notificationProvider = notificationProvider;
     notificationProvider.OnNotificationReceived += notificationProvider_OnNotificationReceived;
 }