Ejemplo n.º 1
0
        public IEnumerable <NotificationsDTO> GetNotifications([FromBody] NameDTO id)//Wade Please Review this Code, Will this work?
        {
            DesktopNotification t = new DesktopNotification()
            {
                Company = new Company(), LoginDetails = new LoginDetails()
                {
                    Company = new Company(), Role = new Role()
                }
            };

            t.InsertDocument();
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("Company.Name", id.Name);
            List <CRUDAble> notes = t.SearchDocument(parameters);

            notes.Remove(t);
            t.Delete();
            List <NotificationsDTO> notifications = new List <NotificationsDTO> ();


            foreach (DesktopNotification item in notes)
            {
                notifications.Add(new NotificationsDTO(item));
            }

            return(notifications);
        }
Ejemplo n.º 2
0
        private void RaiseButton_Click(object sender, RoutedEventArgs e)
        {
            // 4.1 Raise a notification here
            // 4.2 The notification should invoke the method registered in the Clients application which opens the Contact Info
            var notification = new DesktopNotification(NotificationTitle.Text, NotificationSeverity.Low, GlueRoutingDetailMethodName: "Clients.ShowContacts");

            App.Glue.Notifications.Publish(notification);
        }
Ejemplo n.º 3
0
        protected virtual void LoadTweet(DesktopNotification tweet)
        {
            currentNotification = tweet;
            resourceHandler.SetResource(new ByteArrayResource(browserImpl.GetTweetHTML(tweet), Encoding.UTF8));

            browser.Load(TwitterUrls.TweetDeck);
            DisplayTooltip(null);
        }
Ejemplo n.º 4
0
        // notification methods

        public virtual void HideNotification()
        {
            browser.Load(NotificationBrowser.BlankURL);
            DisplayTooltip(null);

            Location            = ControlExtensions.InvisibleLocation;
            currentNotification = null;
        }
        protected override string GetTweetHTML(DesktopNotification tweet)
        {
            string html = tweet.GenerateHtml("td-screenshot", HeadLayout, Config.CustomNotificationCSS);

            foreach (InjectedHTML injection in plugins.NotificationInjections)
            {
                html = injection.InjectInto(html);
            }

            return(html);
        }
        public FormNotificationExample(FormBrowser owner, PluginManager pluginManager) : base(owner, pluginManager, false)
        {
            browser.LoadingStateChanged += browser_LoadingStateChanged;

            string exampleTweetHTML = Program.Resources.LoadSilent("pages/example.html")?.Replace("{avatar}", AppLogo.Url) ?? string.Empty;

            #if DEBUG
            exampleTweetHTML = exampleTweetHTML.Replace("</p>", @"</p><div style='margin-top:256px'>Scrollbar test padding...</div>");
            #endif

            exampleNotification = new DesktopNotification(string.Empty, string.Empty, "Home", exampleTweetHTML, 176, string.Empty, string.Empty);
        }
Ejemplo n.º 7
0
        // notification methods

        public override void ShowNotification(DesktopNotification notification)
        {
            tweetQueue.Enqueue(notification);

            if (!IsPaused)
            {
                UpdateTitle();

                if (totalTime == 0)
                {
                    LoadNextNotification();
                }
            }

            needsTrim |= tweetQueue.Count >= TrimMinimum;
        }
Ejemplo n.º 8
0
        private void OnSendNotificationClick(object sender, RoutedEventArgs e)
        {
            if (_glue == null)
            {
                //glue is not initialized
                return;
            }

            //object state
            var parameters = new List <GlueMethodParameter>()
            {
                new GlueMethodParameter("customerId", new GnsValue("11"))
            };

            var actions = new List <GlueRoutingMethod>()
            {
                new GlueRoutingMethod("AcceptNotification", Description: "Accept", Parameters: parameters),
                new GlueRoutingMethod("RejectNotification", Description: "Reject")
            };

            var notification = new DesktopNotification(Title.Text,
                                                       (NotificationSeverity)Enum.Parse(typeof(NotificationSeverity), Severity.Text),
                                                       "type",
                                                       Description.Text,
                                                       "category",
                                                       "source",
                                                       "AcceptedHandler",
                                                       actions
                                                       );

            _glue.Notifications.Publish(notification)
            .ContinueWith(r =>
            {
                if (r.Status != TaskStatus.RanToCompletion)
                {
                }
                else
                {
                }
            });
        }
Ejemplo n.º 9
0
 public NotificationsDTO(DesktopNotification x)
 {
     Message     = x.Message;
     DateCreated = x.CreationDate;
 }