Пример #1
0
		protected virtual void OnTransactionAdd4(TransactionAddState state)
		{
			var ui = new InputDialogGump(User, Refresh())
			{
				Title = "Add Transaction: Step 4",
				Html = "Manually add a transaction.\n\n" + //
					   "Value:\nEnter the " + AutoDonate.CMOptions.MoneySymbol + " " + AutoDonate.CMOptions.MoneyAbbr +
					   " value for this transaction.\n\n" + //
					   "Click OK to continue or Cancel to exit.", //
				InputText = state.Value.ToString("F2"),
				CancelHandler = Refresh
			};

			ui.Callback = (b, val) => OnTransactionAdd4(state, ui);

			ui.Send();
		}
Пример #2
0
		protected virtual void OnTransactionAdd3(TransactionAddState state)
		{
			var ui = new InputDialogGump(User, Refresh())
			{
				Title = "Add Transaction: Step 3",
				Html = "Manually add a transaction.\n\n" + //
					   "Transaction ID:\nEnter the unique ID for this transaction.\n\n" + //
					   "Click OK to continue or Cancel to exit.", //
				InputText = state.ID,
				CancelHandler = Refresh
			};

			ui.Callback = (b, id) => OnTransactionAdd3(state, ui);

			ui.Send();
		}
Пример #3
0
		protected virtual void OnTransactionAdd1(TransactionAddState state)
		{
			var ui = new InputDialogGump(User, Refresh())
			{
				Title = "Add Transaction: Step 1",
				Html = "Manually add a transaction.\n\n" + //
					   "Account Name:\nEnter the account name of the recipient for this transaction.\n\n" + //
					   "Click OK to continue or Cancel to exit.", //
				InputText = User.Account.Username,
				CancelHandler = Refresh
			};

			ui.Callback = (b, username) => OnTransactionAdd1(state, ui);

			ui.Send();
		}
Пример #4
0
		protected virtual void OnTransactionAdd2(TransactionAddState state)
		{
			var ui = new InputDialogGump(User, Refresh())
			{
				Title = "Add Transaction: Step 2",
				Html = "Manually add a transaction.\n\n" + //
					   "Email Address:\nEnter the Email Address for this transaction.\n\n" + //
					   "Click OK to continue or Cancel to exit.", //
				InputText = state.Email,
				CancelHandler = Refresh
			};

			ui.Callback = (b, email) => OnTransactionAdd2(state, ui);

			ui.Send();
		}
Пример #5
0
        protected virtual void OnTransactionImport()
        {
            var input = new InputDialogGump(User, Hide())
            {
                Title = "Import Transactions",
                Html = "Import transactions from a file.\n\n" + //
                       "File Formats: \n*.json\n\n" + //
                       "Root Directory: " + Core.BaseDirectory
            };

            input.AcceptHandler = b =>
            {
                input.InputText = IOUtility.GetSafeFilePath(input.InputText, true);

                var path = Path.Combine(Core.BaseDirectory, input.InputText);

                if (!Insensitive.EndsWith(path, ".json"))
                {
                    input.InputText = String.Empty;
                    input.User.SendMessage("File not supported: {0}", path);
                    input.Refresh(true);
                    return;
                }

                if (!File.Exists(path))
                {
                    input.InputText = String.Empty;
                    input.User.SendMessage("File not found: {0}", path);
                    input.Refresh(true);
                    return;
                }

                OnTransactionImport(new FileInfo(path));
            };

            input.CancelHandler = Refresh;

            input.Send();
        }