Esempio n. 1
0
 private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     RequestInfo = null;
     Timeout.Dispose();
     Logger.Debugger.Debug("here");
     Picture.Source = null;
     Timeout        = null;
 }
Esempio n. 2
0
 public DiscordNotify(DiscordRPC.Message.JoinRequestMessage args)
 {
     WidgetActive     = true;
     WidgetHasContent = true;
     InitializeComponent();
     RequestInfo = args;
     SetInformation();
     Timeout = new Timer(_ => RejectRequest(), null, 15000, 0);
 }
Esempio n. 3
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();
        }
Esempio n. 4
0
        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(); }));
        }
Esempio n. 5
0
        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();
            }));
        }
Esempio n. 6
0
        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;
        }