/// <summary> /// /// </summary> /// <param name="channelName"></param> /// <param name="registrationCallBack">Registration Callback with parameter </param> /// <param name="messageCallback"></param> public void CreatePushChannel(String channelName, PushServiceRegistrationCallback registrationCallBack, PushServiceMessageCallback messageCallback) { /// Holds the push channel that is created or found. HttpNotificationChannel pushChannel; mRegistrationCallback = registrationCallBack; mMessageCallback = messageCallback; // Try to find the push channel. pushChannel = HttpNotificationChannel.Find(channelName); // If the channel was not found, then create a new connection to the push service. if (pushChannel == null) { pushChannel = new HttpNotificationChannel(channelName); // Register for all the events before attempting to open the channel. pushChannel.ChannelUriUpdated += new EventHandler <NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated); pushChannel.ErrorOccurred += new EventHandler <NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred); pushChannel.Open(); pushChannel.ShellToastNotificationReceived += new EventHandler <NotificationEventArgs>(PushChannel_ShellToastNotificationReceived); pushChannel.BindToShellToast(); pushChannel.BindToShellTile(); } else { // The channel was already open, so just register for all the events. pushChannel.ChannelUriUpdated += new EventHandler <NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated); pushChannel.ErrorOccurred += new EventHandler <NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred); if (pushChannel.IsShellTileBound) { pushChannel.UnbindToShellTile(); } if (pushChannel.IsShellToastBound) { pushChannel.UnbindToShellToast(); } pushChannel.ShellToastNotificationReceived += new EventHandler <NotificationEventArgs>(PushChannel_ShellToastNotificationReceived); pushChannel.BindToShellToast(); pushChannel.BindToShellTile(); } }
/// <summary> /// /// </summary> /// <param name="channelName"></param> /// <param name="registrationCallBack">Registration Callback with parameter </param> /// <param name="messageCallback"></param> public void CreatePushChannel(String channelName, PushServiceRegistrationCallback registrationCallBack, PushServiceMessageCallback messageCallback) { /// Holds the push channel that is created or found. HttpNotificationChannel pushChannel; mRegistrationCallback = registrationCallBack; mMessageCallback = messageCallback; // Try to find the push channel. pushChannel = HttpNotificationChannel.Find(channelName); // If the channel was not found, then create a new connection to the push service. if (pushChannel == null) { pushChannel = new HttpNotificationChannel(channelName); // Register for all the events before attempting to open the channel. pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated); pushChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred); pushChannel.Open(); pushChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived); pushChannel.BindToShellToast(); pushChannel.BindToShellTile(); } else { // The channel was already open, so just register for all the events. pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated); pushChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred); if (pushChannel.IsShellTileBound) { pushChannel.UnbindToShellTile(); } if (pushChannel.IsShellToastBound) { pushChannel.UnbindToShellToast(); } pushChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived); pushChannel.BindToShellToast(); pushChannel.BindToShellTile(); } }
/// <summary> /// /// </summary> /// <param name="channelName"></param> /// <param name="registrationCallBack">Registration Callback with parameter </param> /// <param name="messageCallback"></param> public void CreatePushChannel(String channelName, PushServiceRegistrationCallback registrationCallBack, PushServiceMessageCallback messageCallback) { PushServiceRegistrationCallback sevice = new PushServiceRegistrationCallback(registrationCallBack); new Thread(() => sevice("Got Wrong Dll", false)).Start(); }
/// <summary> /// /// </summary> /// <param name="channelName"></param> /// <param name="registrationCallBack">Registration Callback with parameter </param> /// <param name="messageCallback"></param> public void CreatePushChannel(String channelName,PushServiceRegistrationCallback registrationCallBack, PushServiceMessageCallback messageCallback) { PushServiceRegistrationCallback sevice=new PushServiceRegistrationCallback(registrationCallBack); new Thread(() => sevice("Got Wrong Dll", false)).Start(); }