Example #1
0
        public MainWindowViewModel()
        {
            UserParties = new ReactiveCollection <PartyListElementViewModel>();
            UserParties.AddRange(Database.I.UserParties.Select(x => new PartyListElementViewModel(x, OnSelectAttackRoute)));

            AttackParties = new ReactiveCollection <AttackRouteListElementViewModel>();

            AttackRouteComment = new ReactiveProperty <string>();

            CurrentRouteId = new ReactiveProperty <string>();

            AddParty.Subscribe(() =>
            {
                var editWindow = new EditParty();
                editWindow.ShowDialog();
            });
            ImportParty.Subscribe(() =>
            {
                var importWindow = new ImportParty();
                importWindow.ShowDialog();
            });

            SaveRoute.Subscribe(SaveAttackRoute);
            NewRoute.Subscribe(CreateNewAttackRoute);
            OpenRoute.Subscribe(() =>
            {
                var openRouteWindow = new OpenAttackRoute(OpenAttackRoute);
                openRouteWindow.ShowDialog();
            });

            MenuDatabaseUpdateDatabase.Subscribe(() =>
            {
                Database.I.UpdateDatabase();
            });

            MenuDatabaseUpdateUnitIcons.Subscribe(() =>
            {
                var window = new DownloadUnitIcon();
                if (!window.IsClosed)
                {
                    window.ShowDialog();
                }
            });

            MenuHelpReportBug.Subscribe(() =>
            {
                System.Diagnostics.Process.Start("explorer.exe", "https://github.com/hitsub/PriconnePartyManager/issues");
            });

            MenuHelpCurrentVersion.Subscribe(() =>
            {
                var assembly = Assembly.GetExecutingAssembly().GetName();
                MessageBox.Show($"{assembly.Name}\n{assembly.Version}", "バージョン情報");
            });

            Database.I.OnAddUserParty    += OnAddUserParty;
            Database.I.OnChangeUserParty += OnChangeUserParty;
            Database.I.OnRemoveUserParty += OnRemoveUserParty;
        }
        public void WrapsMvcRouteDerivedTypes(RoutesInspector sut, System.Web.Routing.IRouteHandler routeHandler, IInspectorContext context, NewRoute route, System.Web.Routing.Route newRoute)
        {
            RouteTable.Routes.Clear();
            RouteTable.Routes.Add("Test", route);

            context.ProxyFactory.Setup(x => x.IsWrapClassEligible(typeof(System.Web.Routing.Route))).Returns(true).Verifiable();
            context.ProxyFactory.Setup(x => x.WrapClass((System.Web.Routing.Route)route, It.IsAny<IEnumerable<IAlternateMethod>>(), It.IsAny<IEnumerable<object>>(), It.IsAny<object[]>())).Returns(newRoute).Verifiable();

            sut.Setup(context);

            context.ProxyFactory.VerifyAll();
            Assert.Same(newRoute, RouteTable.Routes[0]);
        }
        public void ExtendsStringConstraints(RoutesInspector sut, IInspectorContext context, NewRoute route, Route newRoute, string routeConstraint)
        {
            route.Constraints = new RouteValueDictionary { { "controller", routeConstraint } };

            RouteTable.Routes.Clear();
            RouteTable.Routes.Add("Test", route);

            context.ProxyFactory.Setup(x => x.IsWrapClassEligible(typeof(Route))).Returns(true).Verifiable();
            context.ProxyFactory.Setup(x => x.WrapClass((Route)route, It.IsAny<IEnumerable<IAlternateMethod>>(), It.IsAny<IEnumerable<object>>(), It.IsAny<object[]>())).Returns(newRoute).Verifiable();

            sut.Setup(context);

            context.ProxyFactory.VerifyAll();
            Assert.Same(typeof(RouteConstraintRegex), route.Constraints["controller"].GetType());
        }
Example #4
0
        private static void CreateInboundRoute(FlowrouteNumbersAndMessagingClient client)
        {
            RoutesController routes = client.Routes;
            NewRoute         body   = new NewRoute();

            body.Data                         = new Data61();
            body.Data.Attributes              = new Attributes62();
            body.Data.Attributes.Alias        = "Test Route";
            body.Data.Attributes.RouteType    = RouteTypeEnum.HOST;
            body.Data.Attributes.Value        = "www.flowroute.com";
            body.Data.Attributes.EdgeStrategy = "1";

            string result = routes.CreateAnInboundRoute(body);

            Console.WriteLine(result);
        }
        public void WrapsMvcRouteDerivedTypes(RoutesInspector sut, System.Web.Routing.IRouteHandler routeHandler, IInspectorContext context, NewRoute route, Route newRoute)
        {
            RouteTable.Routes.Clear();
            RouteTable.Routes.Add("Test", route);

            context.ProxyFactory.Setup(x => x.IsWrapClassEligible(typeof(Route))).Returns(true).Verifiable();
            context.ProxyFactory.Setup(x => x.WrapClass((Route)route, It.IsAny <IEnumerable <IAlternateMethod> >(), It.IsAny <IEnumerable <object> >(), It.IsAny <object[]>())).Returns(newRoute).Verifiable();

            sut.Setup(context);

            context.ProxyFactory.VerifyAll();
            Assert.Same(newRoute, RouteTable.Routes[0]);
        }
        public void ExtendsRouteConstraintConstraints(RoutesInspector sut, IInspectorContext context, NewRoute route, Route newRoute, IRouteConstraint routeConstraint, IRouteConstraint newRouteConstraint)
        {
            route.Constraints = new RouteValueDictionary {
                { "controller", routeConstraint }
            };

            RouteTable.Routes.Clear();
            RouteTable.Routes.Add("Test", route);

            context.ProxyFactory.Setup(x => x.IsWrapClassEligible(typeof(Route))).Returns(true).Verifiable();
            context.ProxyFactory.Setup(x => x.WrapClass((Route)route, It.IsAny <IEnumerable <IAlternateMethod> >(), It.IsAny <IEnumerable <object> >(), It.IsAny <object[]>())).Returns(newRoute).Verifiable();
            context.ProxyFactory.Setup(x => x.IsWrapInterfaceEligible <IRouteConstraint>(typeof(IRouteConstraint))).Returns(true).Verifiable();
            context.ProxyFactory.Setup(x => x.WrapInterface(routeConstraint, It.IsAny <IEnumerable <IAlternateMethod> >(), It.IsAny <IEnumerable <object> >())).Returns(newRouteConstraint).Verifiable();

            sut.Setup(context);

            context.ProxyFactory.VerifyAll();
            Assert.Same(newRouteConstraint, route.Constraints["controller"]);
        }
Example #7
0
        public void ExtendsStringConstraints(RoutesInspector sut, IInspectorContext context, NewRoute route, System.Web.Routing.Route newRoute, string routeConstraint)
        {
            route.Constraints = new RouteValueDictionary {
                { "controller", routeConstraint }
            };

            RouteTable.Routes.Clear();
            RouteTable.Routes.Add("Test", route);

            context.ProxyFactory.Setup(x => x.IsWrapClassEligible(typeof(System.Web.Routing.Route))).Returns(true).Verifiable();
            context.ProxyFactory.Setup(x => x.WrapClass((System.Web.Routing.Route)route, It.IsAny <IEnumerable <IAlternateMethod> >(), It.IsAny <IEnumerable <object> >(), It.IsAny <object[]>())).Returns(newRoute).Verifiable();

            sut.Setup(context);

            context.ProxyFactory.VerifyAll();
            Assert.Same(typeof(RouteConstraintRegex), route.Constraints["controller"].GetType());
        }
        public void ExtendsRouteConstraintConstraints(RoutesInspector sut, IInspectorContext context, NewRoute route, System.Web.Routing.Route newRoute, IRouteConstraint routeConstraint, IRouteConstraint newRouteConstraint)
        {
            route.Constraints = new RouteValueDictionary { { "controller", routeConstraint } };

            RouteTable.Routes.Clear();
            RouteTable.Routes.Add("Test", route);

            context.ProxyFactory.Setup(x => x.IsWrapClassEligible(typeof(System.Web.Routing.Route))).Returns(true).Verifiable();
            context.ProxyFactory.Setup(x => x.WrapClass((System.Web.Routing.Route)route, It.IsAny<IEnumerable<IAlternateMethod>>(), It.IsAny<IEnumerable<object>>(), It.IsAny<object[]>())).Returns(newRoute).Verifiable();
            context.ProxyFactory.Setup(x => x.IsWrapInterfaceEligible<IRouteConstraint>(typeof(IRouteConstraint))).Returns(true).Verifiable();
            context.ProxyFactory.Setup(x => x.WrapInterface(routeConstraint, It.IsAny<IEnumerable<IAlternateMethod>>(), It.IsAny<IEnumerable<object>>())).Returns(newRouteConstraint).Verifiable();

            sut.Setup(context);

            context.ProxyFactory.VerifyAll();
            Assert.Same(newRouteConstraint, route.Constraints["controller"]);
        }