예제 #1
0
        public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
        {
            SPRemoteEventResult result = new SPRemoteEventResult();

            //using (ClientContext clientContext = TokenHelper.CreateRemoteEventReceiverClientContext(properties))
            //{
            //    if (clientContext != null)
            //    {
            //        clientContext.Load(clientContext.Web);
            //        clientContext.ExecuteQuery();
            //    }
            //}

            try
            {
                WNSUtil.SendToastNotification(string.Format(@"
<toast launch=""{2}/Lists/Tasks/DispForm.aspx?ID={1}"">
                            <visual>
                                <binding template=""ToastText01"">
                                    <text id=""1"">{0}</text>
                                </binding>  
                            </visual>
                        </toast>
", properties.ItemEventProperties.AfterProperties["Title"],
                                                            properties.ItemEventProperties.ListItemId,
                                                            properties.ItemEventProperties.WebUrl),
                                              Database.Instance.GetChannelUrl(ConfigurationManager.AppSettings["TenantId"]));
            }
            catch { }
            return(result);
        }
예제 #2
0
        public void ProcessOneWayEvent(SPRemoteEventProperties properties)
        {
            //https://sokool-00db3f37d16e41.sharepoint.com/SendWin8AppNotification/Lists/Tasks/DispForm.aspx?ID=1
            //https://sokool-00db3f37d16e41.sharepoint.com/SendWin8AppNotification
            try
            {
                WNSUtil.SendToastNotification(string.Format(@"
<toast launch=""{2}/Lists/Tasks/DispForm.aspx?ID={1}"">
                            <visual>
                                <binding template=""ToastText01"">
                                    <text id=""1"">{0}</text>
                                </binding>  
                            </visual>
                        </toast>
", properties.ItemEventProperties.AfterProperties["Title"],
                                                            properties.ItemEventProperties.ListItemId,
                                                            properties.ItemEventProperties.WebUrl),
                                              Database.Instance.GetChannelUrl(ConfigurationManager.AppSettings["TenantId"]));
            }
            catch { }
        }
예제 #3
0
 protected void btnSemdToastNotification_Click(object sender, EventArgs e)
 {
     WNSUtil.SendToastNotification(string.Format(toastNotification, txt_toastNotificationTemplate.Text), Application["ChannelUrl"].ToString());
 }