Exemple #1
0
        public ExpressPaymentRequest(
            Purse storePurse,
            uint orderId,
            Amount amount,
            Description description,
            MailAddress clientEmail,
            ConfirmationType confirmationType,
            CultureInfo culture = null)
        {
            if (null == clientEmail)
            {
                throw new ArgumentNullException(nameof(clientEmail));
            }

            if (null == culture)
            {
                culture = Thread.CurrentThread.CurrentUICulture;
            }

            StorePurse       = storePurse;
            OrderId          = orderId;
            Amount           = amount;
            Description      = description;
            ClientEmail      = clientEmail;
            ClientIdType     = ClientIdType.Email;
            ConfirmationType = confirmationType;
            Culture          = culture;
        }
 public PaymentConfirmationInstruction(long invoiceId, ConfirmationType confirmationType,
                                       string publicMessage)
 {
     InvoiceId        = invoiceId;
     ConfirmationType = confirmationType;
     PublicMessage    = publicMessage ?? throw new ArgumentNullException(nameof(publicMessage));
 }
 public Confirmation(DateTimeStamp dateTime, Location geoCoordinates, ConfirmationType confirmationType, string confirmationBlob)
 {
     DateTime         = dateTime;
     GeoCoordinates   = geoCoordinates;
     ConfirmationType = confirmationType;
     ConfirmationBlob = confirmationBlob;
 }
Exemple #4
0
        public override ConfirmationResult AskConfirmation(ConfirmationType confirmationType)
        {
            var cancelEventArgs = new CancelEventArgs();

            OnConfirmationRequired(cancelEventArgs);
            return(cancelEventArgs.Cancel ? ConfirmationResult.No : base.AskConfirmation(confirmationType));
        }
Exemple #5
0
        /// <summary>
        /// The client has responded to a confirmation box
        /// </summary>
        public bool HandleResponse(ConfirmationType confirmType, uint contextId, bool response, bool timeout = false)
        {
            // these should match up in current implementation
            if ((uint)confirmType != contextId)
            {
                log.Error($"{Player.Name}.ConfirmationManager.HandleResponse({confirmType}, {contextId}, {response}) - confirmType != contextId");
                return(false);
            }

            if (!confirmations.TryRemove(confirmType, out var confirm))
            {
                if (!timeout)
                {
                    log.Error($"{Player.Name}.ConfirmationManager.HandleResponse({confirmType}, {contextId}, {response}) - confirmType not found");
                }

                return(false);
            }

            if (timeout)
            {
                EnqueueAbort(confirmType, contextId);
            }

            confirm.ProcessConfirmation(response);

            return(true);
        }
        public ExpressTrustRequest(
            Purse storePurse,
            Amount dayLimit,
            Amount weekLimit,
            Amount monthLimit,
            MailAddress clientEmail,
            ConfirmationType confirmationType,
            CultureInfo culture = null)
        {
            if (null == clientEmail)
            {
                throw new ArgumentNullException(nameof(clientEmail));
            }

            if (null == culture)
            {
                culture = Thread.CurrentThread.CurrentCulture;
            }

            StorePurse       = storePurse;
            DayLimit         = dayLimit;
            WeekLimit        = weekLimit;
            MonthLimit       = monthLimit;
            ClientEmail      = clientEmail;
            ClientIdType     = ClientIdType.Email;
            ConfirmationType = confirmationType;
            Culture          = culture;
        }
Exemple #7
0
        public Confirmation(ulong id, ulong key, int type, ulong creator, string description, string receiving, string time)
        {
            this.ID          = id;
            this.Key         = key;
            this.IntType     = type;
            this.Creator     = creator;
            this.Description = description;
            this.Receiving   = receiving;
            this.Time        = time;

            //Do a switch simply because we're not 100% certain of all the possible types.
            switch (type)
            {
            case 1:
                this.ConfType = ConfirmationType.GenericConfirmation;
                break;

            case 2:
                this.ConfType = ConfirmationType.Trade;
                break;

            case 3:
                this.ConfType = ConfirmationType.MarketSellTransaction;
                break;

            default:
                this.ConfType = ConfirmationType.Unknown;
                break;
            }
        }
        private static void Confirm(
            TaskCompletionSource <object> confirmationTcs, ulong sequenceNumber, ConfirmationType type
            )
        {
            switch (type)
            {
            case ConfirmationType.Return:
                confirmationTcs.TrySetException(
                    new PublishReturnedException("Broker has signalled that message is returned")
                    );
                break;

            case ConfirmationType.Nack:
                confirmationTcs.TrySetException(
                    new PublishNackedException($"Broker has signalled that publish {sequenceNumber} was unsuccessful")
                    );
                break;

            case ConfirmationType.Ack:
                confirmationTcs.TrySetResult(null);;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
 public GameEventConfirmationRequest(Session session, ConfirmationType confirmationType, uint context, string text)
     : base(GameEventType.CharacterConfirmationRequest, GameMessageGroup.UIQueue, session)
 {
     Writer.Write((uint)confirmationType);
     Writer.Write(context);
     Writer.WriteString16L(text);
 }
Exemple #10
0
        private void SendConfirmUpdateMessage(ConfirmationType confirmationType)
        {
            ConfirmUpdateMessage message = new ConfirmUpdateMessage();

            message.ConfirmationType = confirmationType;
            Controller.GetInstance().Client.SendData(message);
        }
Exemple #11
0
        public Confirmation(ulong id, ulong key, int type, ulong creator)
        {
            this.ID      = id;
            this.Key     = key;
            this.IntType = type;
            this.Creator = creator;

            //Do a switch simply because we're not 100% certain of all the possible types.
            switch (type)
            {
            case 1:
                this.ConfType = ConfirmationType.GenericConfirmation;
                break;

            case 2:
                this.ConfType = ConfirmationType.Trade;
                break;

            case 3:
                this.ConfType = ConfirmationType.MarketSellTransaction;
                break;

            default:
                this.ConfType = ConfirmationType.Unknown;
                break;
            }
        }
Exemple #12
0
        async Task <bool> IConfirmationWatcherHandler <Rule, Watch, Watch> .ConfirmationUpdateAsync(
            Watch confirm,
            int count,
            ConfirmationType type,
            CancellationToken cancellationToken)
        {
            switch (type)
            {
            case ConfirmationType.Confirmed:
                if (count >= confirm.Context.Confirmations)
                {
                    await ConfirmAsync(confirm, cancellationToken);

                    return(true);
                }
                break;

            case ConfirmationType.Unconfirming:
                break;

            default:
                throw new NotSupportedException($"{type} is not supported.");
            }

            return(false);
        }
Exemple #13
0
        /// <summary>
        /// This only needs to be sent in the rare event the server needs to force close
        /// a confirmation dialog that is still active on the client
        /// </summary>
        public void EnqueueAbort(ConfirmationType confirmationType, uint contextId)
        {
            if (confirmations.TryGetValue(confirmationType, out var confirm) && confirm.ContextId == contextId)
            {
                Player.Session.Network.EnqueueSend(new GameEventConfirmationDone(Player.Session, confirmationType, contextId));

                switch (confirm.ConfirmationType)
                {
                case ConfirmationType.SwearAllegiance:
                    // This event automatically triggers a response from client, however due to the way ACE works, we want it to process as a timeout to match pcap output as best we can and inform players of results.
                    HandleResponse(confirm.ConfirmationType, confirm.ContextId, false, true);
                    break;

                case ConfirmationType.AlterSkill:
                case ConfirmationType.AlterAttribute:
                case ConfirmationType.CraftInteraction:
                case ConfirmationType.Augmentation:
                case ConfirmationType.Yes_No:
                    // These events automatically trigger a response from client, others do not.
                    // do nothing further
                    break;

                default:
                    HandleResponse(confirm.ConfirmationType, confirm.ContextId, false, true);
                    break;
                }
            }
        }
Exemple #14
0
 public TrustConfirmationInstruction(int reference, ConfirmationType confirmationType, string publicMessage,
                                     string smsReference)
 {
     Reference        = reference;
     ConfirmationType = confirmationType;
     PublicMessage    = publicMessage ?? throw new ArgumentNullException(nameof(publicMessage));
     SmsReference     = smsReference;
 }
Exemple #15
0
 public Confirmation(Guid user, Guid notificationId, ConfirmationType confirmationType, Guid deviceReceivedId) : this()
 {
     User             = user;
     NotificationId   = notificationId;
     ConfirmationDate = DateTime.UtcNow;
     ConfirmationType = confirmationType;
     DeviceReceivedId = deviceReceivedId;
 }
Exemple #16
0
 public Confirmation(ConfirmationType confirmationType, string message, uint initiator, uint target)
 {
     ConfirmationID   = GenerateContextId();
     ConfirmationType = confirmationType;
     Message          = message;
     Initiator        = initiator;
     Target           = target;
 }
Exemple #17
0
        /// <summary>
        /// Confirm a localized message
        /// </summary>
        /// <param name="localizationKey"></param>
        /// <param name="confirmationType"></param>
        /// <returns></returns>
        public Task <ConfirmationResult> ConfirmAsync(string localizationKey, ConfirmationType confirmationType)
        {
            if (localizationKey == null)
            {
                throw new ArgumentNullException(nameof(localizationKey));
            }

            return(this.GetService <IDialogManager>().ConfirmAsync(this.LocalizationManager.GetLocalMessage(localizationKey), confirmationType));
        }
 public GameMessageConfirmationDone(Player player, ConfirmationType confirmationType, uint contextId)
     : base(GameMessageOpcode.GameEvent, GameMessageGroup.UIQueue)
 {
     Writer.Write(player.Guid.Full);
     Writer.Write(player.Session.GameEventSequence++);
     Writer.Write((uint)GameEventType.CharacterConfirmationDone);
     Writer.Write((uint)confirmationType);
     Writer.Write(contextId);
 }
 protected NotificationDto(Guid id, IntegrationEvent @event, IntegrationEventType eventType,
                           ConfirmationType state, Importancy importancy) : this()
 {
     Id           = id;
     Event        = @event;
     EventType    = eventType;
     CreationTime = DateTime.UtcNow;
     State        = state;
     Importancy   = importancy;
 }
Exemple #20
0
        protected override void OnSessionEnding(SessionEndingCancelEventArgs e)
        {
            base.OnSessionEnding(e);

            if (ViewModelMain.Current.BitmapManager.Documents.Any(x => !x.ChangesSaved))
            {
                ConfirmationType confirmation = ConfirmationDialog.Show($"{e.ReasonSessionEnding} with unsaved data. Are you sure?", $"{e.ReasonSessionEnding}");
                e.Cancel = confirmation != ConfirmationType.Yes;
            }
        }
Exemple #21
0
        public Confirmation(ulong id, ulong key, ConfirmationType type, ulong creator)
        {
            Id      = id;
            Key     = key;
            Creator = creator;

            // Doesn't matter if we are not sure about all confirmation types.
            // Probably so as the library user. And it is always possible to convert to int.
            Type = type;
        }
 public Invite CreateRestorePassword(AuthenticationAccount account, ConfirmationType type)
 => new Invite
 {
     Id               = Guid.NewGuid(),
     Type             = type,
     Email            = account.ServiceId,
     ConfirmationCode = dataGenerator.GenerateSequence(FieldsLength.ConfirmationCode),
     IsUsed           = false,
     AccountId        = account.Id,
     PasswordRestore  = true,
 };
        public void Confirm(ConfirmationType confType)
        {
            _confirmation.Activate(confType);
            _stateManager.ShowCurrentMenu(false);
            HighlightMenuDefaultButton();

            if (_textInputActive)
            {
                DeactivateTextInput();
            }
        }
        public static void GetConfirmation(Confirm confirmFunction, ConfirmationType _type, Menu.MenuManager.MenuState _state)
        {
            ConfirmationWindow.confirmFunction = confirmFunction;
            _returnState = _state;

            if(_type.Equals(ConfirmationType.ApplyChanges))	_label.text = "Apply Changes?";
            else _label.text = "Are you sure?";

            _win.enabled = true;
            _yes.Select();
        }
Exemple #25
0
        public Confirmation(ConfirmationType confirmationType, string message, WorldObject source, WorldObject target, Player player = null)
        {
            ConfirmationID   = GenerateContextId();
            ConfirmationType = confirmationType;
            Message          = message;
            CreatedDateTime  = DateTime.UtcNow;

            // function parameters
            Player = player;
            Source = source;
            Target = target;
        }
Exemple #26
0
        /// <summary>
        /// The client has responded to a confirmation box
        /// </summary>
        public bool HandleResponse(ConfirmationType confirmType, uint contextId, bool response, bool timeout = false)
        {
            if (!confirmations.TryRemove(confirmType, out var confirm))
            {
                switch (confirmType)
                {
                case ConfirmationType.SwearAllegiance:
                    // do nothing.
                    break;

                case ConfirmationType.Fellowship:
                    // dialog box does not dismiss on ConfirmationDone, unlike on all other types, so we must let the player know when they click either yes or no, nothing occured because the offer has already expired.
                    Player.SendMessage("That offer of fellowship has expired.");     // still looking for pcap accurate response
                    break;

                default:
                    log.Error($"{Player.Name}.ConfirmationManager.HandleResponse({confirmType}, {contextId}, {response}, {timeout}) - confirmType not found");
                    break;
                }

                return(false);
            }

            if (confirm.ContextId != contextId)
            {
                if (confirm.ConfirmationType == ConfirmationType.Fellowship)
                {
                    // dialog box does not dismiss on ConfirmationDone, unlike on all other types, so we must let the player know when they click either yes or no, nothing occured because the offer has already expired.
                    if (!confirmations.TryAdd(confirm.ConfirmationType, confirm))
                    {
                        log.Error($"{Player.Name}.ConfirmationManager.HandleResponse({confirm.ConfirmationType}, {confirm.ContextId}) - Unable to re-add confirmation, duplicate confirmation type");
                    }

                    Player.SendMessage("That offer of fellowship has expired."); // still looking for pcap accurate response

                    return(false);
                }

                log.Error($"{Player.Name}.ConfirmationManager.HandleResponse({confirmType}, {contextId}, {response}, {timeout}) - contextId != confirm.ContextId");

                if (!confirmations.TryAdd(confirm.ConfirmationType, confirm))
                {
                    log.Error($"{Player.Name}.ConfirmationManager.HandleResponse({confirm.ConfirmationType}, {confirm.ContextId}) - Unable to re-add confirmation, duplicate confirmation type");
                }

                return(false);
            }

            confirm.ProcessConfirmation(response, timeout);

            return(true);
        }
Exemple #27
0
        public FormButton(string name, string parameter)
            : base(name)
        {
            this.content = string.Empty;

            this.disabled = null;

            this.update              = false;
            this.submit              = false;
            this.parameter           = parameter;
            this.type                = ButtonType.NotSet;
            this.confirmationType    = ConfirmationType.NotSet;
            this.confirmationMessage = string.Empty;
        }
Exemple #28
0
 public void RequestCloseDocument(Document document)
 {
     if (!document.ChangesSaved)
     {
         ConfirmationType result = ConfirmationDialog.Show(ConfirmationDialogMessage);
         if (result == ConfirmationType.Yes)
         {
             Owner.FileSubViewModel.SaveDocument(false);
         }
         else if (result == ConfirmationType.Canceled)
         {
             return;
         }
     }
     Owner.BitmapManager.CloseDocument(document);
 }
Exemple #29
0
        public EmailConfirmation GetByEmail(string email, ConfirmationType type)
        {
            var confirm = Context.Connection.Query <EmailConfirmation>("SELECT * FROM fso_email_confirm WHERE email = @email AND type = @type", new { email = email, type = type }).FirstOrDefault();

            if (confirm == null)
            {
                return(null);
            }

            if (Epoch.Now > confirm.expires)
            {
                Remove(confirm.token);
                return(null);
            }

            return(confirm);
        }
Exemple #30
0
        public static void GetConfirmation(Confirm confirmFunction, ConfirmationType _type, Menu.MenuManager.MenuState _state)
        {
            ConfirmationWindow.confirmFunction = confirmFunction;
            _returnState = _state;

            if (_type.Equals(ConfirmationType.ApplyChanges))
            {
                _label.text = "Apply Changes?";
            }
            else
            {
                _label.text = "Are you sure?";
            }

            _win.enabled = true;
            _yes.Select();
        }
 public Delivery(string id,
                 UserAccount owner,
                 Location pickup,
                 Location dropoff,
                 string deadline,
                 bool expedited,
                 ConfirmationType confirmationRequired,
                 string droneid)
 {
     Id                   = id;
     Owner                = owner;
     Pickup               = pickup;
     Dropoff              = dropoff;
     Deadline             = deadline;
     Expedited            = expedited;
     ConfirmationRequired = confirmationRequired;
     DroneId              = droneid;
 }
 /// <summary>
 /// Constructor with arguments
 /// </summary>
 public AddBankAccountRequest(RequestEnvelope requestEnvelope, string bankCountryCode, ConfirmationType? confirmationType)
 {
     this.requestEnvelope = requestEnvelope;
     this.bankCountryCode = bankCountryCode;
     this.confirmationType = confirmationType;
 }
 /// <summary>
 /// Constructor with arguments
 /// </summary>
 public AddPaymentCardRequest(RequestEnvelope requestEnvelope, NameType nameOnCard, AddressType billingAddress, string cardNumber, CardTypeType? cardType, ConfirmationType? confirmationType)
 {
     this.requestEnvelope = requestEnvelope;
     this.nameOnCard = nameOnCard;
     this.billingAddress = billingAddress;
     this.cardNumber = cardNumber;
     this.cardType = cardType;
     this.confirmationType = confirmationType;
 }
Exemple #34
0
 public override ConfirmationResult AskConfirmation(ConfirmationType confirmationType) {
     var cancelEventArgs = new CancelEventArgs();
     OnConfirmationRequired(cancelEventArgs);
     return cancelEventArgs.Cancel ? ConfirmationResult.No : base.AskConfirmation(confirmationType);
 }