private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e) { RequestInfo = null; Timeout.Dispose(); Logger.Debugger.Debug("here"); Picture.Source = null; Timeout = null; }
public DiscordNotify(DiscordRPC.Message.JoinRequestMessage args) { WidgetActive = true; WidgetHasContent = true; InitializeComponent(); RequestInfo = args; SetInformation(); Timeout = new Timer(_ => RejectRequest(), null, 15000, 0); }
private void OnDiscordRequestAccepted(object source, DiscordRPC.Message.JoinRequestMessage args) { GUI.Widgets.Notification_Widget.DiscordNotify src = (GUI.Widgets.Notification_Widget.DiscordNotify)source; src.OnRequestAccepted -= OnDiscordRequestAccepted; src.OnRequestRejected -= OnDiscordRequestRejected; Client.Respond(args, true); src.Close(); }
private void OnDiscordRequestRejected(object source, DiscordRPC.Message.JoinRequestMessage args) { GUI.Widgets.Notification_Widget.DiscordNotify src = (GUI.Widgets.Notification_Widget.DiscordNotify)source; src.OnRequestAccepted -= OnDiscordRequestAccepted; src.OnRequestRejected -= OnDiscordRequestRejected; Client.Respond(args, false); App.Current.Dispatcher.Invoke(new Action(() => { src.Close(); })); }
private void Client_OnJoinRequested(object sender, DiscordRPC.Message.JoinRequestMessage args) { Debugger.Discord(GStrings.GetLocalizationByXPath("/Console/String[@ID='MESSAGE_DISCORD_JOIN_REQUEST']").Replace("{Username}", args.User.ToString())); App.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() => { GUI.Widgets.Notification_Widget.DiscordNotify DiscordNotification = new GUI.Widgets.Notification_Widget.DiscordNotify(args); DiscordNotification.OnRequestAccepted += OnDiscordRequestAccepted; DiscordNotification.OnRequestRejected += OnDiscordRequestRejected; DiscordNotification.Show(); })); }
public void SetMessage(DiscordRPC.Message.JoinRequestMessage message) { this.message = message; this.user = message.User; Debug.Log("Invite Received for " + message.User); //Update the username username.text = message.User.Username + "#" + message.User.Discriminator; //Update the avatar user.CacheAvatar(this, size: DiscordAvatarSize.x128, callback: (u, texture) => { Debug.Log("Downloaded Texture for Invite"); avatar.texture = texture; }); //Set our ignore start time _ignoreStartTime = Time.time; _incrementIgnoreTimer = true; }