Пример #1
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (_loaded)
            {
                return;
            }
            _loaded = true;

            AboutHelper.Instance.PropertyChanged += OnAboutPropertyChanged;
            UpdateAboutIsNew();

            var background = AppArguments.Get(AppFlag.Background);

            if (string.IsNullOrWhiteSpace(background))
            {
                FancyBackgroundManager.Instance.AddListener(this);
                SetThemeDynamicBackgroundListener();
            }
            else
            {
                background = FileUtils.GetFullPath(background, () => FilesStorage.Instance.GetDirectory("Themes", "Backgrounds"));
                ApplyDynamicBackground(background, AppArguments.GetDouble(AppFlag.BackgroundOpacity, 0.5));
            }

            if (CupViewModel.Instance.ToUpdate.Count > 0)
            {
                FancyHints.ContentUpdatesArrived.Trigger();
            }
            else
            {
                CupViewModel.Instance.NewUpdate += (o, args) => FancyHints.ContentUpdatesArrived.Trigger();
            }
            Logging.Debug("Main window is loaded and ready");
        }
Пример #2
0
        public static void Reset()
        {
            try
            {
                if (!AppArguments.Contains("-fullReset"))
                {
                    return;
                }

                if (AppArguments.Contains("-fullResetPConf") &&
                    Directory.Exists(Path.Combine(Root, "conf")))
                {
                    Directory.Delete(Path.Combine(Root, "conf"), true);
                    return;
                }

                if (!Directory.Exists(Root))
                {
                    return;
                }
                Directory.Delete(Root, true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(
                    "Logger not initialized, so for throwing exception i use console."
                    );
                Console.WriteLine(ex);
            }
        }
Пример #3
0
        internal AppArguments ParseArgs(string[] args)
        {
            var appArguments = new AppArguments();

            if (args == null)
            {
                appArguments.Errors.Add("Expected 2 arguments but did not receive any.");
            }
            else if (args.Length != 2)
            {
                appArguments.Errors.Add($"Expected 2 arguments but received {args.Length}.");
            }
            else
            {
                appArguments.Source = new FileInfo(args[0]);
                if (!appArguments.Source.Exists)
                {
                    appArguments.Errors.Add($"The source file '{appArguments.Source.FullName}' does not exist, nothing to read from so quitting.");
                }

                appArguments.Destination = new FileInfo(args[1]);
            }

            appArguments.UnableToParseArguments = appArguments.Errors.Any();

            return(appArguments);
        }
Пример #4
0
        /// <summary>
        /// Initialise la librairie
        /// </summary>
        /// <param name="options">Options de la ligne de commande</param>
        static void Action_Init(AppArguments options)
        {
            // initialise le document
            XmlDocument doc = new XmlDocument();

            try
            {
                doc.Load(options.outputFile);
            }
            catch (Exception)
            {
                XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
                doc.AppendChild(docNode);

                XmlNode rootNode = doc.CreateElement("root");
                doc.AppendChild(rootNode);
            }

            // supprime le noeud de la librairie existante
            XmlNode libNode = doc.DocumentElement.SelectSingleNode(String.Format("lib[@title='{0}' and @version='{1}']", options.title, options.version));

            if (libNode != null)
            {
                doc.DocumentElement.RemoveChild(libNode);
            }

            // initialise le noeud de la librairie
            libNode = doc.CreateElement("lib");
            doc.DocumentElement.AppendChild(libNode);
            AppendAttribute(doc, libNode, "title", options.title);
            AppendAttribute(doc, libNode, "version", options.version);

            // sauvegarde les modifs
            doc.Save(options.outputFile);
        }
Пример #5
0
        public App()
        {
            try
            {
                var arguments = Environment.GetCommandLineArgs();
                AppArguments.Instance.AppName = "MicSwitch";

                if (!AppArguments.Parse(arguments))
                {
                    SharedLog.Instance.InitializeLogging("Startup", AppArguments.Instance.AppName);
                    throw new ApplicationException($"Failed to parse command line args: {string.Join(" ", arguments)}");
                }
                InitializeContainer();
                InitializeLogging();

                Log.Debug($"Arguments: {arguments.DumpToText()}");
                Log.Debug($"ProcessID: {Process.GetCurrentProcess().Id}");
                Log.Debug($"Parsed args: {AppArguments.Instance}");
                Log.Debug($"Culture: {Thread.CurrentThread.CurrentCulture}, UICulture: {Thread.CurrentThread.CurrentUICulture}");

                Log.Debug($"UI Scheduler: {RxApp.MainThreadScheduler}");
                RxApp.MainThreadScheduler = container.Resolve <IScheduler>(WellKnownSchedulers.UI);
                RxApp.TaskpoolScheduler   = TaskPoolScheduler.Default;
                Current.ShutdownMode      = ShutdownMode.OnMainWindowClose;
                Log.Debug($"New UI Scheduler: {RxApp.MainThreadScheduler}");
                InitializeUpdateSettings();
            }
            catch (Exception ex)
            {
                Log.HandleException(ex);
                throw;
            }
        }
Пример #6
0
        protected override void Start(AppArguments arguments)
        {
            // Logging
            _logger.Start();

            // Go to a specific plugin if needed
            string id;

            if (arguments.NavigationArguments.TryGetValue(TileService.PluginKey, out id))
            {
                _navigationService.NavigateTo <MainViewModel, ViewPluginRequest>(new ViewPluginRequest(id));
                return;
            }

            // or to a custom URI
            string redirect;

            if (arguments.NavigationArguments.TryGetValue(RedirectRequestKey, out redirect))
            {
                redirect = HttpUtility.UrlDecode(redirect);
                Messenger.Send(new EventLogRequest(CustomUriEventId, redirect, CustomUriScreenId));
                NavigateToCustomUri(redirect);
                return;
            }

            // Go to main
            _navigationService.NavigateTo <MainViewModel, ViewPluginRequest>(new ViewPluginRequest());
        }
Пример #7
0
        /// <summary>
        /// Point d'entrée
        /// </summary>
        /// <param name="args">Arguments de la ligne de commande</param>
        static void Main(string[] args)
        {
            // lit les arguments
            AppArguments options = new AppArguments();

            options.ReadArguments(args);

            if (options.action == null)
            {
                Console.WriteLine("Action non définit");
                return;
            }

            switch (options.action.ToLower())
            {
            case "init":
                Action_Init(options);
                break;

            case "add":
                Action_Add(options);
                break;

            default:
                Console.WriteLine("Action inconnue");
                break;
            }

            /*
             * try
             * {
             *  // lit les arguments
             *  AppArguments options = new AppArguments();
             *  options.ReadArguments(args);
             *
             *  if (options.action == null)
             *  {
             *      Console.WriteLine("Action non définit");
             *      return;
             *  }
             *
             *  switch (options.action.ToLower())
             *  {
             *      case "init":
             *          Action_Init(options);
             *          break;
             *      case "add":
             *          Action_Add(options);
             *          break;
             *      default:
             *          Console.WriteLine("Action inconnue");
             *          break;
             *  }
             * }
             * catch (Exception ex)
             * {
             *  Console.WriteLine(ex.Message);
             * }*/
        }
Пример #8
0
 public AllocationsListVM(FundReqCrudVM fundReqCrudVM)
 {
     _crud                    = fundReqCrudVM;
     _arg                     = _crud.AppArgs;
     _accts                   = GetGLAccounts();
     AddDebitCmd              = R2Command.Relay(_ => AddNewItem("Debit", -1), null, "Add Debit entry");
     AddCreditCmd             = R2Command.Relay(_ => AddNewItem("Credit", +1), null, "Add Credit entry");
     Items.CollectionChanged += Items_CollectionChanged;
 }
Пример #9
0
 public MainWindowVM(AppArguments appArguments) : base(appArguments)
 {
     FillAccountNames();
     UpdateNotifier  = new UpdatedExeNotifier(AppArgs.OrigCrudExe);
     FundRequests    = new FundReqListVM(this);
     PreparedCheques = new PreparedChequesListVM(this);
     IssuedCheques   = new IssuedChequesListVM(this);
     ClickRefresh();
 }
Пример #10
0
        private static void Execute(string[] args)
        {
            NameValueCollection settings  = args.ToNameValueCollection();
            AppArguments        arguments = AppArguments.Parse(settings);

            Context context = new Context(arguments, Cancellation.Token, Console.Out);
            AppHost host    = new AppHost(context, new RequestSenderCreator());

            host.Run();
        }
Пример #11
0
        public void HelpTest()
        {
            AppArguments appArgs = new AppArguments();

            appArgs.LoadArguments(new[] { @"--h" });
            ReturnCode retCode;

            Assert.False(appArgs.ValidateArguments(out retCode));
            Assert.Equal(ReturnCode.EXIT_SUCCESS, retCode);
        }
Пример #12
0
        public virtual WepayApp Get(AppArguments arguments)
        {
            arguments.ClientId     = arguments.ClientId.Equals(null) ? (ClientId == null ? WePayConfiguration.GetClientId() : ClientId) : arguments.ClientId;
            arguments.ClientSecret = string.IsNullOrWhiteSpace(arguments.ClientSecret) ? (string.IsNullOrWhiteSpace(ClientSecret) ? WePayConfiguration.GetClientSecret() : ClientSecret) : arguments.ClientSecret;

            var parameters = ParameterBuilder.ApplyParameters(arguments);
            var response   = Requestor.PostString(Urls.App, parameters);

            return(WepayMapping <WepayApp> .MapFromJson(response));
        }
Пример #13
0
        private static void MissingArgs(string[] args)
        {
            AppArguments appArgs = new AppArguments();

            appArgs.LoadArguments(args);
            ReturnCode retCode;

            Assert.False(appArgs.ValidateArguments(out retCode));
            Assert.Equal(ReturnCode.EXIT_ERROR, retCode);
        }
Пример #14
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (AppName != null ? AppName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AppLocation != null ? AppLocation.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AppArguments != null ? AppArguments.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AppIcon != null ? AppIcon.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EnabledMods != null ? EnabledMods.GetHashCode() : 0);
         return(hashCode);
     }
 }
Пример #15
0
 public MainWindowVM(AppArguments appArguments, bool clickRefresh = true) : base(appArguments)
 {
     MainToolBar    = new MainToolbarVM(this);
     ActiveLeases   = new ActiveLeasesVM(appArguments);
     InactiveLeases = new InactiveLeasesVM(appArguments);
     ActiveLeases.Crud.SaveCompleted += (s, e) => ClickRefresh();
     ActiveLeases.LeaseDeactivated   += (s, e) => ClickRefresh();
     if (clickRefresh)
     {
         ClickRefresh();
     }
 }
Пример #16
0
        public void Should_Return_Default_Values()
        {
            // Act
            AppArguments result = AppArguments.Parse(_mandatoryArguments);

            // Assert
            Assert.That(result.Loop, Is.EqualTo(1));
            Assert.That(result.Method, Is.EqualTo(HttpMethod.Get));
            Assert.That(result.Port, Is.EqualTo(80));
            Assert.That(result.Srv, Is.EqualTo("localhost"));
            Assert.That(result.Status, Is.EqualTo(200));
            Assert.That(result.Threads, Is.EqualTo(1));
            Assert.That(result.Uri, Is.EqualTo("/"));
        }
Пример #17
0
        public void should_output_a_missing_password_error()
        {
            var properties = new Dictionary <string, string>();

            properties["fn"]    = "Louis";
            properties["ln"]    = "Salin";
            properties["email"] = "*****@*****.**";

            var arguments = new AppArguments {
                Command = "add", Properties = properties
            };

            sut.Run(arguments);
            ((OutputStub)output).Contains("error: no password specified").ShouldBeTrue();
        }
Пример #18
0
        public MainWindowVM(AppArguments args) : base(args)
        {
            Sections = new SectionsListVM(args);
            Stalls   = new StallsListVM(this, args);

            Sections.SelectedChanged += (s, e) => ClickRefresh();
            Sections.Selected         = Sections.ItemsList.FirstOrDefault();


            //var sec    = AppArgs.CurrentSection;
            //var stalls = AppArgs.MarketState.Stalls.ForSection(sec);
            //foreach (var stall in stalls)
            //{
            //    AppArgs.MarketState.Stalls.Delete(stall);
            //}
        }
Пример #19
0
        /// <summary>
        /// Ajoute le contenu de la documentation à une librairie existante
        /// </summary>
        /// <param name="options">Options de la ligne de commande</param>
        static void Action_Add(AppArguments options)
        {
            // Scan les groupes
            List <ParamGroup> groups = new List <ParamGroup>();

            if (Directory.Exists(options.defDir + @"\groups"))
            {
                string[] groupsPaths = Directory.GetFiles(options.defDir + @"\groups", "*");
                foreach (var syntaxFile in groupsPaths)
                {
                    Syntax curGroup = new Syntax();
                    ReadObjectSyntax(syntaxFile, ref curGroup);
                    groups.Add(new ParamGroup(curGroup.type, curGroup.content, curGroup.param));
                }
            }

            // lit les fichiers sources
            List <Object> objets = new List <Object>();

            string[] srcPaths = Directory.GetFiles(options.inputDir, options.inputFilter, (options.recursive == true ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly));
            foreach (var filePath in srcPaths)
            {
                Console.WriteLine(String.Format("Scan file: {0}", filePath));
                Log(String.Format("Scan file: {0}", filePath));
                string relativeFileName = filePath.Substring(options.inputDir.Length);
                string text             = string.Empty;
                using (StreamReader streamReader = new StreamReader(filePath, Encoding.UTF8))
                {
                    text = streamReader.ReadToEnd().Replace("\r\n", "\n");
                }

                // Scan les objets
                int      objCnt    = objets.Count;
                Syntax   curSyntax = new Syntax();
                string[] filePaths = Directory.GetFiles(options.defDir, "*");
                foreach (var syntaxFile in filePaths)
                {
                    ReadObjectSyntax(syntaxFile, ref curSyntax);
                    MakeObject(text, relativeFileName, curSyntax, groups.ToArray(), objets);
                }
                objCnt = objets.Count - objCnt;

                Console.WriteLine(String.Format("{0} objets traités", objCnt));
            }
            ExportToXML(options.outputFile, options.title, options.version, objets);
        }
Пример #20
0
        public void GetUrl_Should_Return_Absolute_Url()
        {
            // Arrange
            NameValueCollection rawArguments = new NameValueCollection
            {
                {"-srv", "test.test"},
                {"-port", "8080"},
                {"-uri", "api/users"}
            };
            AppArguments arguments = AppArguments.Parse(rawArguments);

            // Act
            string result = arguments.GetUrl();

            // Assert
            Assert.That(result, Is.EqualTo("http://test.test:8080/api/users"));
        }
Пример #21
0
        public void LoadArgumentTest()
        {
            AppArguments appArgs = new AppArguments();

            appArgs.LoadArguments(new[] { @"--targetDir=C:\TargetDir", @"--targetPath=C:\TargetPath", @"--projectDir=C:\ProjectDir",
                                          @"--outputFileName=app.manifest", @"--rootElementTag=App", @"--typeElementTag=Type", @"--serialisableTypesTag=SerialisableTypes",
                                          @"--deserialisableTypesTag=DeserialisableTypes", @"--includeDependencies=BP.*,Something", @"--excludeDependencies=Microsoft.*,BP.Synergy.App" });
            ReturnCode retCode;

            Assert.True(appArgs.ValidateArguments(out retCode));
            Assert.Equal(ReturnCode.EXIT_SUCCESS, retCode);
            Assert.Equal(@"C:\TargetPath", appArgs.TargetPath);
            Assert.Equal(@"C:\TargetDir", appArgs.TargetDir);
            Assert.Equal(@"C:\ProjectDir", appArgs.ProjectDir);
            Assert.Equal(@"BP.*,Something", appArgs.IncludedDependencies);
            Assert.Equal(@"Microsoft.*,BP.Synergy.App", appArgs.ExcludedDependencies);
        }
        public ServerPresetEntryList()
        {
            InitializeComponent();
            this.AddWidthCondition(720)
            .Add(SavedDriversPanel);
            this.AddWidthCondition(960)
            .Add(BallastColumn)
            .Add(RestrictorColumn)
            .AddInverted(SomethingMightBeHiddenPanel);
            this.AddWidthCondition(1080)
            .Add(TeamColumn);

            if (AppArguments.Has(AppFlag.ServerManagementMode))
            {
                EntriesGrid.RowStyle = TryFindResource("RowStyleWithSpacing") as Style ?? EntriesGrid.RowStyle;
            }
        }
Пример #23
0
        public App()
        {
            try
            {
                var arguments = Environment.GetCommandLineArgs();
                AppArguments.Instance.AppName = "EyeAuras";

                if (!AppArguments.Parse(arguments))
                {
                    SharedLog.Instance.InitializeLogging("Startup", AppArguments.Instance.AppName);
                    throw new ApplicationException($"Failed to parse command line args: {string.Join(" ", arguments)}");
                }

                InitializeLogging();

                Log.Debug($"Arguments: {arguments.DumpToText()}");
                Log.Debug($"Parsed args: {AppArguments.Instance.DumpToText()}");
                Log.Debug($"OS Version: {Environment.OSVersion}, is64bit: {Environment.Is64BitProcess} (OS: {Environment.Is64BitOperatingSystem})");
                Log.Debug($"Is Elevated: {AppArguments.Instance.IsElevated}");
                Log.Debug($"Culture: {Thread.CurrentThread.CurrentCulture}, UICulture: {Thread.CurrentThread.CurrentUICulture}");

                Log.Debug($"UI Scheduler: {RxApp.MainThreadScheduler}");
                RxApp.MainThreadScheduler = DispatcherScheduler.Current;
                RxApp.TaskpoolScheduler   = TaskPoolScheduler.Default;
                Current.ShutdownMode      = ShutdownMode.OnMainWindowClose;
                Log.Debug($"New UI Scheduler: {RxApp.MainThreadScheduler}");

                Log.Debug($"Configuring AllowSetForegroundWindow permissions");
                UnsafeNative.AllowSetForegroundWindow();

                aurasBootstrapper = new EyeAurasBootstrapper();
                Disposable.Create(
                    () =>
                {
                    Log.Info("Disposing bootstrapper...");
                    aurasBootstrapper.Dispose();
                })
                .AddTo(anchors);
            }
            catch (Exception ex)
            {
                Log.HandleException(ex);
                throw;
            }
        }
Пример #24
0
        public static void Launch(AppArguments args)
        {
            var now = DateTime.Now.Date;
            var bgn = new DateTime(now.Year, now.Month, 1);
            var end = args.Collections.LastPostedDate();

            if (!PopUpInput.TryGetDateRange
                    ("Dates covered by Collection Summary Report",
                    out (DateTime Start, DateTime End)rng, bgn, end))
            {
                return;
            }

            var splash = new LoadingSplash();

            new ColxnSummaryReport(rng.Start, rng.End, args).ToExcel();

            splash.Close();
        }
Пример #25
0
        private void LaunchReport(AppArguments args)
        {
            switch (args.Param1.ToUpper())
            {
            case "OVERDUES": WithOverduesReport.Show(args);        break;

            case "COLXNSMRY": ColxnSummaryExcelWriter.Launch(args); break;

            case "DAILYSTATUS": DailyStatusReportVM.Launch(args);     break;

            case "GLRECAP": GLRecapExcelWriter.Launch(args);      break;

            case "COLLECTORS": CollectorsMainVM.Launch(args);        break;

            case "CHKVOUCHERS": CheckVouchersReporter.Launch(args);   break;

            default: throw Bad.Arg("Param1", args.Param1);
            }
        }
Пример #26
0
        public void should_save_the_user()
        {
            var properties = new Dictionary <string, string>();

            properties["fn"]    = "Louis";
            properties["ln"]    = "Salin";
            properties["email"] = "*****@*****.**";
            properties["p"]     = "pass123";

            var arguments = new AppArguments {
                Command = "add", Properties = properties
            };

            sut.Run(arguments);
            persister.SavedUser.FirstName.ShouldEqual("Louis");
            persister.SavedUser.LastName.ShouldEqual("Salin");
            persister.SavedUser.Email.ShouldEqual("*****@*****.**");
            persister.SavedUser.Password.ShouldEqual("pass123");
        }
Пример #27
0
        public static void Print()
        {
            if (!Settings.EnablePrintBaseInfoToLog ||
                AppArguments.Contains("-disablePrintBaseInfoToLog"))
            {
                return;
            }

            Log.Info("============================================================");
            Log.Info(ApplicationInfo.Type == "Alpha"
                ? $"Starting {Name} configurator version {AlphaVersion}"
                : $"Starting {Name} configurator version {ApplicationInfo.Version}");
            Log.Info($"You have launched an official {ApplicationInfo.Type} build");
            Log.Info($"Current launched SacredUtils app name {CurrentExe}");
            Log.Info(AppDomain.CurrentDomain.IsFullyTrusted
                ? "Current launched SacredUtils application is fully trusted"
                : "Current launched SacredUtils application is not fully trusted");
            Log.Info($"Version of the common language runtime {Environment.Version}");
            Log.Info(
                $"Full version of the common language runtime {RuntimeInformation.FrameworkDescription}"
                );
            Log.Info(
                $"OS version {Environment.OSVersion.VersionString} {RuntimeInformation.OSArchitecture} bit"
                );
            Log.Info(
                $"Bitness of the current SacredUtils process {RuntimeInformation.ProcessArchitecture} bit"
                );
            Log.Info(
                $"Allocated memory for SacredUtils {Environment.WorkingSet / 1024 / 1024} MB or {Environment.WorkingSet / 1024} KB"
                );
            Log.Info($"Running by current user name profile {Environment.UserName}"
                     );
            Log.Info(
                $"SacredUtils current domain assemblies count {AppDomain.CurrentDomain.GetAssemblies().Length}"
                );
            Log.Info(
                $"Involved dirs ({InvolvedDirs.Length}) : {InvolvedDirs.ToNormalString()}"
                );
            Log.Info("============================================================");
        }
Пример #28
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (_loaded)
            {
                return;
            }
            _loaded = true;

            AboutHelper.Instance.PropertyChanged += OnAboutPropertyChanged;
            UpdateAboutIsNew();

            var background = AppArguments.Get(AppFlag.Background);

            if (string.IsNullOrWhiteSpace(background))
            {
                FancyBackgroundManager.Instance.AddListener(this);
                SetThemeDynamicBackgroundListener();
            }
            else
            {
                background = FileUtils.GetFullPath(background, () => FilesStorage.Instance.GetDirectory("Themes", "Backgrounds"));
                ApplyDynamicBackground(background, AppArguments.GetDouble(AppFlag.BackgroundOpacity, 0.5));
            }
        }
Пример #29
0
        static Config()
        {
            var section = MonitorSection.GetSection();

            ColumnMappings = ReadColumnMappings(section);
            LevelColors    = ReadLevelColors(section);
            SavedLogs      = ReadSavedLogs(section);

            var window = ReadWindowProperties(section);

            WindowWidth    = window.Width;
            WindowHeight   = window.Height;
            WindowMonitor  = window.Monitor;
            WindowPosition = window.Position;

            var args = AppArguments.FromCommandLine();

            DefaultColumnMapping = GetMapping(args.GetOption(AppArgs.Mapping));
            FilterLevels         = ParseFilterLevels(args.GetOption(AppArgs.Levels));
            FilterHighlight      = args.GetOptionInteger(AppArgs.Highlight);
            RunImmediately       = args.HasOption(AppArgs.Run);
            RunLogFile           = args.GetCommand(1);
            Language             = args.GetOption(AppArgs.Lang, CultureInfo.CurrentCulture.Name);
            LogEnabled           = new[] { "1", "true", "on" }.Contains(args.GetOption(AppArgs.Log, "1").ToLower());

            if (FilterLevels == null)
            {
                FilterLevels = Enum.GetValues(typeof(LevelValues)).Cast <LevelValues>().ToList();
            }
            if (SavedLogs != null && !string.IsNullOrWhiteSpace(RunLogFile) && SavedLogs.All(log => log.FileName != RunLogFile))
            {
                SavedLogs.Insert(0, new LogFile(RunLogFile, DefaultColumnMapping, false));
            }

            Initialize();
        }
Пример #30
0
        public ActionResult TestAll()
        {
            #region Variables

            var  clientSecret = Request.Form["clientSecret"];
            long clientId     = 0;
            long.TryParse(Request.Form["clientId"], out clientId);

            var email       = Request.Form["email"];
            var firstName   = Request.Form["firstName"];
            var lastName    = Request.Form["lastName"];
            var callbackUri = Request.Form["callbackUri"];

            var userAgent = Request.UserAgent;
            var IPAddress = Request.UserHostAddress;

            WepayAddress Address1 = new WepayAddress {
                Address1 = "605 Seward Ave NW", City = "Grand Rapids", State = "MI", Zip = "49504", Country = "US"
            };

            #endregion

            #region SetUp

            #region User

            var wePayUserService = new WePay.WePayUserService(null, clientId, clientSecret);

            var ParametersRegister = new UserRegisterArguments {
                ClientId          = clientId,
                ClientSecret      = clientSecret,
                Email             = email,
                FirstName         = firstName,
                LastName          = lastName,
                OriginalIp        = IPAddress,
                OriginalDevice    = userAgent,
                TOSAcceptanceTime = DateTime.Now
            };
            WePayUserRegisterd user = null;

            try
            {
                user = wePayUserService.Register(ParametersRegister);
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }
            #endregion

            #region Accounts

            var          wePayAccountService = new WePay.WePayAccountrService(user.AccessToken);
            WepayAccount account             = null;
            try
            {
                account = wePayAccountService.Create(new AccountCreateArgument
                {
                    Name        = "SDK Test",
                    Description = "An account that is a test made one.",
                    ReferenceId = "abc123",
                    Type        = "personal",
                    ImageUri    = "http://www.payitsquare.com/content/img/design/logo.png",
                    mcc         = 7299,
                    Country     = "US",
                    currencies  = new string[] { "USD" }
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }

            WepayAccount accountDelete = null;
            try
            {
                accountDelete = wePayAccountService.Create(new AccountCreateArgument {
                    Name = "SDK Test delete", Description = "An account that is a test made one to delete."
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }
            #endregion

            #region CreditCard
            WePayCreditCardState CreditCard          = null;
            WePayCreditCardState CreditCardDelete    = null;
            WePayCreditCardState CreditCardAuthorize = null;

            var wePayCreditCardService = new WePay.WePayCreditCardService(user.AccessToken);
            try
            {
                CreditCard = wePayCreditCardService.Create(new CreditCardCreateArguments
                {
                    ClientId        = clientId,
                    CCnumber        = "4003830171874018",
                    CVV             = 123,
                    ExpirationMonth = 12,
                    ExpirationYear  = 25,
                    FullName        = "John Smith",
                    Email           = "*****@*****.**",
                    Address         = Address1,
                    OriginalIp      = IPAddress,
                    OriginalDevice  = userAgent
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }

            try
            {
                CreditCardDelete = wePayCreditCardService.Create(new CreditCardCreateArguments
                {
                    ClientId        = clientId,
                    CCnumber        = "5496198584584769",
                    CVV             = 123,
                    ExpirationMonth = 12,
                    ExpirationYear  = 25,
                    FullName        = "Jan Smith",
                    Email           = "*****@*****.**",
                    Address         = Address1,
                    OriginalIp      = IPAddress,
                    OriginalDevice  = userAgent
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }

            try
            {
                CreditCardAuthorize = wePayCreditCardService.Create(new CreditCardCreateArguments
                {
                    ClientId        = clientId,
                    CCnumber        = "5496198584584769",
                    CVV             = 123,
                    ExpirationMonth = 12,
                    ExpirationYear  = 25,
                    FullName        = "Jim Smith",
                    Email           = "*****@*****.**",
                    Address         = Address1,
                    OriginalIp      = IPAddress,
                    OriginalDevice  = userAgent
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }
            #endregion

            #region Preapproval

            WePayPreapprovalCreate Preapproval       = null;
            WePayPreapprovalCreate PreapprovalCancel = null;

            var wePayPreapprovalService = new WePay.WePayPreapprovalService(user.AccessToken);

            try
            {
                Preapproval = wePayPreapprovalService.Create(new PreapprovalCreateArguments
                {
                    AccountId         = account.AccountId,
                    ShortDescription  = "Test a checkout Preapproval",
                    Amount            = (decimal)100.75,
                    Currency          = "USD",
                    AppFee            = (decimal)3.02,
                    Period            = "once",
                    Frequency         = 1,
                    FeePayer          = "payee",
                    PayerEmailMessage = "Thank you for the money.",
                    PaymentMethodId   = CreditCard.CreditCardId,
                    PaymentMethodType = "credit_card"
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }

            try
            {
                PreapprovalCancel = wePayPreapprovalService.Create(new PreapprovalCreateArguments
                {
                    AccountId         = account.AccountId,
                    ShortDescription  = "Test a checkout Preapproval Cancel",
                    Amount            = (decimal)100.75,
                    Currency          = "USD",
                    AppFee            = (decimal)3.02,
                    Period            = "once",
                    Frequency         = 1,
                    FeePayer          = "payee",
                    PayerEmailMessage = "Thank you for the money.",
                    PaymentMethodId   = CreditCard.CreditCardId,
                    PaymentMethodType = "credit_card"
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }
            #endregion

            #region Checkout

            WePayCheckout checkout       = null;
            WePayCheckout checkoutCancel = null;
            WePayCheckout checkoutRefund = null;

            var wePayCheckoutService = new WePay.WePayCheckoutService(user.AccessToken);

            try
            {
                checkout = wePayCheckoutService.Create(new CheckoutCreateArguments
                {
                    AccountId        = account.AccountId,
                    ShortDescription = "Test a checkout",
                    Type             = "personal",
                    Amount           = (decimal)100.75,
                    Currency         = "USD",
                    Fee = new WepayFee
                    {
                        AppFee   = (decimal)3.02,
                        FeePayer = "payee"
                    },
                    EmailMessage = new WepayEmailMessage
                    {
                        ToPayee = "You have just got money.",
                        ToPayer = "Thank you for the money.",
                    },
                    PaymentMethod = new WepayPaymentMethod
                    {
                        Type       = "credit_card",
                        CreditCard = new WepayCreditCardInfo
                        {
                            Id = CreditCard.CreditCardId
                        }
                    }
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }

            try
            {
                checkoutCancel = wePayCheckoutService.Create(new CheckoutCreateArguments
                {
                    AccountId        = account.AccountId,
                    ShortDescription = "Test a checkout",
                    Type             = "personal",
                    Amount           = (decimal)100.75,
                    Currency         = "USD",
                    Fee = new WepayFee
                    {
                        AppFee   = (decimal)3.02,
                        FeePayer = "payee"
                    },
                    EmailMessage = new WepayEmailMessage
                    {
                        ToPayee = "You have just got money.",
                        ToPayer = "Thank you for the money.",
                    },
                    PaymentMethod = new WepayPaymentMethod
                    {
                        Type       = "credit_card",
                        CreditCard = new WepayCreditCardInfo
                        {
                            Id = CreditCard.CreditCardId
                        }
                    }
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }

            try
            {
                checkoutRefund = wePayCheckoutService.Create(new CheckoutCreateArguments
                {
                    AccountId        = account.AccountId,
                    ShortDescription = "Test a checkout",
                    Type             = "personal",
                    Amount           = (decimal)100.75,
                    Currency         = "USD",
                    Fee = new WepayFee
                    {
                        AppFee   = (decimal)3.02,
                        FeePayer = "payee"
                    },
                    EmailMessage = new WepayEmailMessage
                    {
                        ToPayee = "You have just got money.",
                        ToPayer = "Thank you for the money.",
                    },
                    PaymentMethod = new WepayPaymentMethod
                    {
                        Type       = "credit_card",
                        CreditCard = new WepayCreditCardInfo
                        {
                            Id = CreditCard.CreditCardId
                        }
                    }
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }
            #endregion

            #region Subscription Plan

            WePaySubscriptionPlan SubsPlan       = null;
            WePaySubscriptionPlan SubsPlanDelete = null;

            var wePaySubscriptionPlanService = new WePay.WePaySubscriptionPlanService(user.AccessToken);

            try
            {
                SubsPlan = wePaySubscriptionPlanService.Create(new SubscriptionPlanCreateArguments
                {
                    AccountId        = account.AccountId,
                    ShortDescription = "Test a Subscription Plan",
                    Name             = "Test a Subscription Plan",
                    Amount           = (decimal)100.75,
                    Currency         = "USD",
                    AppFee           = (decimal)3.02,
                    Period           = "monthly",
                    SetupFee         = (decimal)0.50
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }

            try
            {
                SubsPlanDelete = wePaySubscriptionPlanService.Create(new SubscriptionPlanCreateArguments
                {
                    AccountId        = account.AccountId,
                    ShortDescription = "Test a Subscription Plan delete",
                    Name             = "Test a Subscription Plan delete",
                    Amount           = (decimal)100.75,
                    Currency         = "USD",
                    AppFee           = (decimal)3.02,
                    Period           = "monthly",
                    SetupFee         = (decimal)0.50
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }

            #endregion

            #region Subscription

            WePaySubscriptionCreate Subs       = null;
            WePaySubscriptionCreate SubsCancel = null;

            var wePaySubscriptionService = new WePay.WePaySubscriptionService(user.AccessToken);

            try
            {
                Subs = wePaySubscriptionService.Create(new SubscriptionCreateArguments
                {
                    SubscriptionPlanId = SubsPlan.SubscriptionPlanId,
                    PaymentMethodId    = CreditCard.CreditCardId,
                    PaymentMethodType  = "credit_card"
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }

            try
            {
                SubsCancel = wePaySubscriptionService.Create(new SubscriptionCreateArguments
                {
                    SubscriptionPlanId = SubsPlanDelete.SubscriptionPlanId,
                    PaymentMethodId    = CreditCard.CreditCardId,
                    PaymentMethodType  = "credit_card"
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }

            #endregion

            #region Subscription Charge

            WePaySubscriptionCharge[] SubsCharge = null;
            var wePaySubscriptionChargeService   = new WePay.WePaySubscriptionChargeService(user.AccessToken);
            try
            {
                SubsCharge = wePaySubscriptionChargeService.Find(new SubscriptionChargeFindArguments
                {
                    SubscriptionId = Subs.SubscriptionId
                });
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }

            #endregion

            #region Withdrawal
            WePayWithdrawalCreated withdrawal = new WePayWithdrawalCreated();
            try {
                var wePayWithdrawalService = new WePay.WePayWithdrawalService(user.AccessToken);
                withdrawal = wePayWithdrawalService.Create(new WithdrawalCreateArguments
                {
                    AccountId = account.AccountId
                });
            }
            catch
            {
            }

            #endregion

            #endregion

            #region Batch

            WePayBatchService wePayBatchService = new WePay.WePayBatchService(user.AccessToken, clientId, clientSecret);

            #region BatchArguments

            #region User
            var UserSendConfirmation = new UserSendConfirmationArguments {
                EmailMessage = "Test From Wepay SDK. Made by Pay it Square team."
            };
            var UserModify = new UserModifyArguments {
                CallbackUri = callbackUri
            };
            #endregion

            #region App
            var AppParameters = new AppArguments {
                ClientId = clientId, ClientSecret = clientSecret
            };
            var AppsModify = new AppModifyArguments {
                ClientId = clientId, ClientSecret = clientSecret
            };
            #endregion

            #region Account
            var AccountParameters = new AccountArguments {
                AccountId = account.AccountId
            };
            var AccountFindParameters = new AccountFindArguments {
                SortOrder = "ASC"
            };
            var AccountModifyParameters = new AccountModifyArguments {
                AccountId = account.AccountId, Description = "SDK test modify"
            };
            var AccountGetReserveDetailsParameters = new AccountGetReserveDetailsArguments {
                AccountId = account.AccountId
            };
            var AccountUpdateUriParameters = new AccountGetUpdateUriArguments {
                AccountId = account.AccountId
            };
            var AccountDeleteParameters = new AccountDeleteArguments {
                AccountId = accountDelete.AccountId, Reason = "Test for delete"
            };
            #endregion

            #region CreditCard
            var CreditCardParameters = new CreditCardArguments {
                ClientId = clientId, ClientSecret = clientSecret, CreditCardId = CreditCard.CreditCardId
            };
            var CreditCardFindParameters = new CreditCardFindArguments {
                ClientId = clientId, ClientSecret = clientSecret
            };
            var CreditCardAuthorizeParameters = new CreditCardArguments {
                ClientId = clientId, ClientSecret = clientSecret, CreditCardId = CreditCardAuthorize.CreditCardId
            };
            var CreditCardDeleteParameters = new CreditCardArguments {
                ClientId = clientId, ClientSecret = clientSecret, CreditCardId = CreditCardDelete.CreditCardId
            };
            #endregion

            #region preapproval
            var PreapprovalParameters = new PreapprovalArguments {
                PreapprovalId = Preapproval.PreapprovalId
            };
            var PreapprovalFindParameters = new PreapprovalFindArguments {
                AccountId = account.AccountId
            };
            var PreapprovalModifyParameters = new PreapprovalModifyArguments {
                PreapprovalId = Preapproval.PreapprovalId
            };
            var PreapprovalCancelParameters = new PreapprovalArguments {
                PreapprovalId = PreapprovalCancel.PreapprovalId
            };
            #endregion

            #region Checkout
            var CheckoutParameters = new CheckoutArguments {
                CheckoutId = checkout.CheckoutId ?? 0
            };
            var CheckoutFindParameters = new CheckoutFindArguments {
                AccountId = account.AccountId
            };
            var CheckoutModifyParameters = new CheckoutModifyArguments {
                CheckoutId = checkout.CheckoutId
            };
            var CheckoutCancelParameters = new CheckoutCancelArguments {
                CheckoutId = checkoutCancel.CheckoutId, CancelReason = "To test the sdk"
            };
            var CheckoutRefundParameters = new CheckoutRefundArguments {
                CheckoutId = checkoutRefund.CheckoutId
            };
            #endregion

            #region Subscription Plan
            var SubPlanParameters = new SubscriptionPlanArguments {
                SubscriptionPlanId = SubsPlan.SubscriptionPlanId
            };
            var SubPlanFindParameters = new SubscriptionPlanFindArguments {
                AccountId = account.AccountId
            };
            var SubPlanModifyParameters = new SubscriptionPlanModifyeArguments {
                SubscriptionPlanId = SubsPlan.SubscriptionPlanId
            };
            var SubPlanDeleteParameters = new SubscriptionPlanDeleteArguments {
                SubscriptionPlanId = SubsPlanDelete.SubscriptionPlanId, reason = "Test the delete."
            };
            #endregion

            #region Subscription
            var SubParameters = new SubscriptionArguments {
                SubscriptionId = Subs.SubscriptionId
            };
            var SubFindParameters = new SubscriptionFindArguments {
                SubscriptionPlanId = SubsPlan.SubscriptionPlanId
            };
            var SubModifyParameters = new SubscriptionModifyArguments {
                SubscriptionId = Subs.SubscriptionId
            };
            var SubCancelParameters = new SubscriptionCancelArguments {
                SubscriptionId = SubsCancel.SubscriptionId, Reason = "Testing the Cancel"
            };
            #endregion

            #region Subscription Charge
            var SubChargeParameters = new SubscriptionChargeArguments {
                subscriptionChargeId = SubsCharge[0].SubscriptionChargeId
            };
            var SubChargeRefundParameters = new SubscriptionChargeRefundArguments {
                SubscriptionChargeId = SubsCharge[0].SubscriptionChargeId, Reason = "Test the Refund"
            };
            #endregion

            #region Withdrawal
            var WithdrawalParameters = new WithdrawalArguments {
                WithdrawalId = withdrawal.WithdrawalId
            };
            var WithdrawalFindParameters = new WithdrawalFindArguments {
                AccountId = account.AccountId
            };
            var WithdrawalModifyParameters = new WithdrawalModifyArguments {
                WithdrawalId = withdrawal.WithdrawalId
            };
            #endregion

            #endregion

            #region BatchCalls
            try
            {
                var batchCalls = wePayBatchService.Create(new BatchArguments
                {
                    Calls = new BatchCallsArguments[37] {
                        #region User
                        new BatchCallsArguments {
                            Call = "/user", Authorization = user.AccessToken, ReferenceId = "1"
                        },
                        new BatchCallsArguments {
                            Call = UserSendConfirmation.BatchUrl(), ReferenceId = "2", Authorization = user.AccessToken, Parameters = UserSendConfirmation
                        },
                        new BatchCallsArguments {
                            Call = UserModify.BatchUrl(), ReferenceId = "3", Authorization = user.AccessToken, Parameters = UserModify
                        },
                        #endregion

                        #region App
                        new BatchCallsArguments {
                            Call = AppParameters.BatchUrl(), Authorization = user.AccessToken, ReferenceId = "4", Parameters = AppParameters
                        },
                        new BatchCallsArguments {
                            Call = AppsModify.BatchUrl(), ReferenceId = "5", Authorization = user.AccessToken, Parameters = AppsModify
                        },
                        #endregion

                        #region Account
                        new BatchCallsArguments {
                            Call = AccountParameters.BatchUrl(), Authorization = user.AccessToken, ReferenceId = "6", Parameters = AccountParameters
                        },
                        new BatchCallsArguments {
                            Call = AccountFindParameters.BatchUrl(), ReferenceId = "7", Authorization = user.AccessToken, Parameters = AccountFindParameters
                        },
                        new BatchCallsArguments {
                            Call = AccountModifyParameters.BatchUrl(), ReferenceId = "8", Authorization = user.AccessToken, Parameters = AccountModifyParameters
                        },
                        new BatchCallsArguments {
                            Call = AccountGetReserveDetailsParameters.BatchUrl(), ReferenceId = "9", Authorization = user.AccessToken, Parameters = AccountGetReserveDetailsParameters
                        },
                        new BatchCallsArguments {
                            Call = AccountUpdateUriParameters.BatchUrl(), ReferenceId = "10", Authorization = user.AccessToken, Parameters = AccountUpdateUriParameters
                        },
                        new BatchCallsArguments {
                            Call = AccountDeleteParameters.BatchUrl(), ReferenceId = "11", Authorization = user.AccessToken, Parameters = AccountDeleteParameters
                        },
                        #endregion

                        #region CreditCard
                        new BatchCallsArguments {
                            Call = CreditCardParameters.BatchUrl(BatchUrlType.Get), ReferenceId = "12", Authorization = user.AccessToken, Parameters = CreditCardParameters
                        },
                        new BatchCallsArguments {
                            Call = CreditCardFindParameters.BatchUrl(), ReferenceId = "13", Authorization = user.AccessToken, Parameters = CreditCardFindParameters
                        },
                        new BatchCallsArguments {
                            Call = CreditCardAuthorizeParameters.BatchUrl(BatchUrlType.Authorize), ReferenceId = "14", Authorization = user.AccessToken, Parameters = CreditCardAuthorizeParameters
                        },
                        new BatchCallsArguments {
                            Call = CreditCardDeleteParameters.BatchUrl(BatchUrlType.Delete), ReferenceId = "15", Authorization = user.AccessToken, Parameters = CreditCardDeleteParameters
                        },
                        #endregion

                        #region preapproval
                        new BatchCallsArguments {
                            Call = PreapprovalParameters.BatchUrl(BatchUrlType.Get), ReferenceId = "16", Authorization = user.AccessToken, Parameters = PreapprovalParameters
                        },
                        new BatchCallsArguments {
                            Call = PreapprovalFindParameters.BatchUrl(), ReferenceId = "17", Authorization = user.AccessToken, Parameters = PreapprovalFindParameters
                        },
                        new BatchCallsArguments {
                            Call = PreapprovalModifyParameters.BatchUrl(), ReferenceId = "18", Authorization = user.AccessToken, Parameters = PreapprovalModifyParameters
                        },
                        new BatchCallsArguments {
                            Call = PreapprovalCancelParameters.BatchUrl(BatchUrlType.Cancel), ReferenceId = "19", Authorization = user.AccessToken, Parameters = PreapprovalCancelParameters
                        },
                        #endregion

                        #region Checkout
                        new BatchCallsArguments {
                            Call = CheckoutParameters.BatchUrl(BatchUrlType.Get), ReferenceId = "20", Authorization = user.AccessToken, Parameters = CheckoutParameters
                        },
                        new BatchCallsArguments {
                            Call = CheckoutFindParameters.BatchUrl(), ReferenceId = "21", Authorization = user.AccessToken, Parameters = CheckoutFindParameters
                        },
                        new BatchCallsArguments {
                            Call = CheckoutModifyParameters.BatchUrl(), ReferenceId = "22", Authorization = user.AccessToken, Parameters = CheckoutModifyParameters
                        },
                        new BatchCallsArguments {
                            Call = CheckoutCancelParameters.BatchUrl(), ReferenceId = "23", Authorization = user.AccessToken, Parameters = CheckoutCancelParameters
                        },
                        new BatchCallsArguments {
                            Call = CheckoutRefundParameters.BatchUrl(), ReferenceId = "24", Authorization = user.AccessToken, Parameters = CheckoutRefundParameters
                        },
                        #endregion

                        #region Subscription Plan
                        new BatchCallsArguments {
                            Call = SubPlanParameters.BatchUrl(), ReferenceId = "25", Authorization = user.AccessToken, Parameters = SubPlanParameters
                        },
                        new BatchCallsArguments {
                            Call = SubPlanFindParameters.BatchUrl(), ReferenceId = "26", Authorization = user.AccessToken, Parameters = SubPlanFindParameters
                        },
                        new BatchCallsArguments {
                            Call = SubPlanModifyParameters.BatchUrl(), ReferenceId = "27", Authorization = user.AccessToken, Parameters = SubPlanModifyParameters
                        },
                        new BatchCallsArguments {
                            Call = SubPlanDeleteParameters.BatchUrl(), ReferenceId = "28", Authorization = user.AccessToken, Parameters = SubPlanDeleteParameters
                        },
                        #endregion

                        #region Subscription
                        new BatchCallsArguments {
                            Call = SubParameters.BatchUrl(), ReferenceId = "29", Authorization = user.AccessToken, Parameters = SubParameters
                        },
                        new BatchCallsArguments {
                            Call = SubFindParameters.BatchUrl(), ReferenceId = "30", Authorization = user.AccessToken, Parameters = SubFindParameters
                        },
                        new BatchCallsArguments {
                            Call = SubModifyParameters.BatchUrl(), ReferenceId = "31", Authorization = user.AccessToken, Parameters = SubModifyParameters
                        },
                        new BatchCallsArguments {
                            Call = SubCancelParameters.BatchUrl(), ReferenceId = "32", Authorization = user.AccessToken, Parameters = SubCancelParameters
                        },
                        #endregion

                        #region Subscription Charge
                        new BatchCallsArguments {
                            Call = SubChargeParameters.BatchUrl(), ReferenceId = "33", Authorization = user.AccessToken, Parameters = SubChargeParameters
                        },
                        new BatchCallsArguments {
                            Call = SubChargeRefundParameters.BatchUrl(), ReferenceId = "34", Authorization = user.AccessToken, Parameters = SubChargeRefundParameters
                        },
                        #endregion

                        #region Withdrawal
                        new BatchCallsArguments {
                            Call = WithdrawalParameters.BatchUrl(), ReferenceId = "35", Authorization = user.AccessToken, Parameters = WithdrawalParameters
                        },
                        new BatchCallsArguments {
                            Call = WithdrawalFindParameters.BatchUrl(), ReferenceId = "36", Authorization = user.AccessToken, Parameters = WithdrawalFindParameters
                        },
                        new BatchCallsArguments {
                            Call = WithdrawalModifyParameters.BatchUrl(), ReferenceId = "37", Authorization = user.AccessToken, Parameters = WithdrawalModifyParameters
                        }
                        #endregion
                    }
                });

                return(View(batchCalls));
            }
            catch (WePayException ex)
            {
                return(View("Error", ex));
            }
            #endregion

            #endregion
        }
Пример #31
0
        protected override void Start( AppArguments arguments )
        {
            // Logging
            _logger.Start();

            // Go to a specific plugin if needed
            string id;
            if ( arguments.NavigationArguments.TryGetValue( TileService.PluginKey, out id ) )
            {
                _navigationService.NavigateTo<MainViewModel, ViewPluginRequest>( new ViewPluginRequest( id ) );
                return;
            }

            // or to a custom URI
            string redirect;
            if ( arguments.NavigationArguments.TryGetValue( RedirectRequestKey, out redirect ) )
            {
                redirect = HttpUtility.UrlDecode( redirect );
                Messenger.Send( new EventLogRequest( CustomUriEventId, redirect, CustomUriScreenId ) );
                NavigateToCustomUri( redirect );
                return;
            }

            // Go to main
            _navigationService.NavigateTo<MainViewModel, ViewPluginRequest>( new ViewPluginRequest() );
        }