Ejemplo n.º 1
0
        public async Task <ActionResult> Start(StartModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            //1. Create a meeting
            var responseCreateMeeting = await client.CreateMeetingAsync(new CreateMeetingRequest
            {
                name      = "Test Meeting",
                meetingID = model.Id
            });

            //Check the response from the BigBlueButton server and return error if has error.
            if (responseCreateMeeting.returncode == Returncode.FAILED)
            {
                ModelState.AddModelError("", responseCreateMeeting.message);
                return(View(model));
            }

            //2. Join the meeting as moderator
            var url = client.GetJoinMeetingUrl(new JoinMeetingRequest
            {
                meetingID = model.Id,
                fullName  = model.Name,
                password  = responseCreateMeeting.moderatorPW
            });

            return(Redirect(url));
        }
Ejemplo n.º 2
0
    public IBaseTextModel StartModelSolver(string line)
    {
        string[]   splitedStr = CutOutStrSet(line);
        StartModel startModel = new StartModel(splitedStr[0]);

        return(startModel);
    }
Ejemplo n.º 3
0
 public StartView()
 {
     firstDrag = false;
     sModel    = new StartModel();
     SetController(new BaseFuncController());
     SetModel(sModel);
 }
Ejemplo n.º 4
0
        public ActionResult Index(LocationModel locationModel)
        {
            //long = 90.4125181
            //lat = 23.810332
            //add = 532/4 Road No 11, Dhaka 1212, Bangladesh

            List <Restaurant>        restaurants         = restService.GetAll() as List <Restaurant>;
            List <RestaurantAddress> restaurantAddresses = restAddService.GetAll() as List <RestaurantAddress>;
            StartModel startModel = new StartModel();

            foreach (RestaurantAddress restaurantAddress in restaurantAddresses)
            {
                if ((Math.Acos(Math.Sin(toRadians(restaurantAddress.Latitude)) * Math.Sin(toRadians(locationModel.Latitude)) + Math.Cos(toRadians(restaurantAddress.Latitude))
                               * Math.Cos(toRadians(locationModel.Latitude)) * Math.Cos(toRadians(restaurantAddress.Longitude) - toRadians(locationModel.Longitude)))) * 6380 < 10)
                {
                    Restaurant rest = restService.Get(restaurantAddress.RestaurantId);
                    if (((DateTime.Now - rest.LastOnline).Hours) < 1)
                    {
                        startModel.openRestaurants.Add(rest);
                    }
                    else
                    {
                        startModel.closedRestaurants.Add(rest);
                    }
                }
            }
            return(View("Start", startModel));
        }
    // Use this for initialization
    void Start()
    {
        Instance = this;

        _controllers = new List <IController>();

        Contexts    contexts = Contexts.sharedInstance;
        GameContext context  = contexts.game;

        _rootSystem = new RootSystem(contexts);

        _rootSystem.Initialize();

        HexGenerator.Instance = GetComponent <HexGenerator>();

        PlayerHealthModel = new PlayerHealthModel(20);

        PlayerHealthController PlayerHealthController = new PlayerHealthController
        {
            View       = PlayerHealthView,
            Model      = PlayerHealthModel,
            MainMenuUI = MainMenuUI
        };

        PlayerHealthController.Init();

        AboutController About = new AboutController
        {
            View    = AboutView,
            AboutUI = AboutUI
        };

        About.Init();

        MainMenuController MainMenu = new MainMenuController
        {
            View       = MainMenuView,
            MainMenuUI = MainMenuUI,
            AboutUI    = AboutUI
        };

        MainMenu.Init();

        StartModel = new StartModel();

        StartController start = new StartController
        {
            View  = StartView,
            Model = StartModel
        };

        start.Init();

        CreateMoneyController();

        TowerModel model = CreateTowerController();

        CreateTiles(context, model);
    }
Ejemplo n.º 6
0
        /// <summary>
        /// creates new project
        /// </summary>
        /// <param name="name"></param>
        /// <returns>currently created experiment</returns>
        private BaseModel newStartPage()
        {
            var exp = new StartModel(ActiveModelChanged);

            m_appModel.Project.Add(exp);

            return(exp);
        }
Ejemplo n.º 7
0
        public IActionResult Start(StartModel model)
        {
            var player      = new Jugador(model.PlayerName, model.SecretWord);
            var gameManager = new GameManager(player);

            MemoryStorageHelper.AddOrReplace($"{HttpContext.Session.Id}_{Constants.GameManagerKey}", gameManager);
            return(RedirectToAction("Index", "Game"));
        }
Ejemplo n.º 8
0
        public StartModel MakeStartModel()
        {
            StartModel model = new StartModel();

            model.Tags               = DbManager.GetTagsFromServer();
            model.LatestItems        = GetLatestItems(DefaultItemsCount);
            model.BiggestCollections = DbManager.GetBiggestCollections(DefualtCollectionsCount);
            return(model);
        }
Ejemplo n.º 9
0
 public MonthlyTrigger(int interval, IntervalMode mode, StartModel startModel, TimeZoneInfo timeZone) : base(timeZone)
 {
     _interval = interval;
     _         = startModel ?? throw new ArgumentNullException();
     _mode     = mode;
     _nth      = startModel.Nth;
     if (mode == IntervalMode.DayOfWeek)
     {
         _dayOfWeek = startModel.DayOfWeek;
     }
 }
Ejemplo n.º 10
0
 public IActionResult Start()
 {
     if (_session._isLoggedin)
     {
         StartModel model = new StartModel();
         return(View(model));
     }
     else
     {
         return(RedirectToAction("Login", "Account"));
     }
 }
Ejemplo n.º 11
0
        public async Task <IActionResult> IndexAsync()
        {
            IdentityUser currentUser = await _userManager.GetUserAsync(HttpContext.User);

            if (currentUser != null)
            {
                ViewBag.Role = _userManager.GetRolesAsync(currentUser).Result;
            }
            StartModel model = _modelHelper.MakeStartModel();

            return(View(model));
        }
Ejemplo n.º 12
0
        public ActionResult Start()
        {
            var userRepository = CurrentAccountDbContext.GetUserRepository();
            var user           = userRepository.GetById(CurrentUser.Id);
            var hasMobilePhone = user.UserContacts.Any(t => t.Type == UserContactType.MobilePhone && !string.IsNullOrEmpty(t.Value));

            var model = new StartModel()
            {
                HintSetMobilePhone = !hasMobilePhone && CurrentUser.CanEditPrivateData()
            };

            return(View(model));
        }
Ejemplo n.º 13
0
 public ActionResult Start(StartModel model)
 {
     if (ModelState.IsValid)
     {
         //if(model.Continue)
         //    return RedirectToAction("Guess", "UserGuess", new { userGuid = model.Hash });
         //else
         return(RedirectToAction("GuessNoFeedback", "UserGuess"));
     }
     else
     {
         return(View());
     }
 }
Ejemplo n.º 14
0
        private void SetupStartModel()
        {
            var model = new StartModel();

            // モデルのバインド
            appUriTxt.DataBindings.Add(Bind(nameof(appUriTxt.Text), model.Uri));
            startWithMeChk.DataBindings.Add(Bind(nameof(startWithMeChk.Checked), model.StartWithMe));
            model.StatusMsg.Subscribe(StatusDrain);

            startBtn.Click       += (_, __) => model.Start();
            gameStartMItem.Click += (_, __) => model.Start();
            FormClosed           += (_, __) => model.Dispose();

            // ロード完了時の処理を実行
            model.OnLoad();
        }
Ejemplo n.º 15
0
        public IHttpActionResult StartNewGame([FromBody] StartModel inputs)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Please check the parameters"));
            }

            var gameInstance = Appservice.StartNewGame(inputs.playerOneName, inputs.playerTwoName);

            if (gameInstance == null)
            {
                return(NotFound());
            }

            return(Ok(gameInstance));
        }
Ejemplo n.º 16
0
        public async Task <ActionResult> Start()
        {
            var setupOk = await isBigBlueButtonAPISettingsOKAsync();

            if (setupOk)
            {
                var Id    = Guid.NewGuid().ToString();
                var model = new StartModel
                {
                    Id   = Id,
                    Url  = Url.Action("Join", "Zoom", new { Id = Id }, Request.Url.Scheme),
                    Name = ""
                };
                return(View(model));
            }
            return(View());
        }
Ejemplo n.º 17
0
        public ActionResult Start(string val)
        {
            StringComparison  comp       = StringComparison.OrdinalIgnoreCase;
            List <Restaurant> rests      = restService.GetAll().Where(rest => rest.Name.IndexOf(val, StringComparison.OrdinalIgnoreCase) >= 0).ToList();
            StartModel        startModel = new StartModel();

            foreach (Restaurant rest in rests)
            {
                if (((DateTime.Now - rest.LastOnline).Hours) < 1)
                {
                    startModel.openRestaurants.Add(rest);
                }
                else
                {
                    startModel.closedRestaurants.Add(rest);
                }
            }
            return(View(startModel));
        }
Ejemplo n.º 18
0
        void CreateGUI()
        {
            EditorApplication.playModeStateChanged    += OnPlayModeStateChanged;
            AssemblyReloadEvents.beforeAssemblyReload += OnBeforeAssemblyReload;
            AssemblyReloadEvents.afterAssemblyReload  += OnAfterAssemblyReload;

            var root = rootVisualElement;

            root.styleSheets.Add(AssetDatabase.LoadAssetAtPath <StyleSheet>(MainStylePath));

            root.AddToClassList(EditorGUIUtility.isProSkin
                ? UiConstants.ussDark
                : UiConstants.ussLight);

            AssetDatabase.LoadAssetAtPath <VisualTreeAsset>(k_LayoutPath).CloneTree(root);

            m_Provider = new Collab();
            m_Provider.UpdatedProjectStatus += OnUpdatedProjectStatus;

            m_ViewContainer = root.Q <VisualElement>(className: ContainerUssClassName);

            // Create models and configure them.
            var mainModel  = new MainModel(m_Provider);
            var startModel = new StartModel(m_Provider);

            m_Models = new List <IModel> {
                mainModel, startModel
            };
            m_Models.ForEach(m => m.OnStart());

            // Get the views and configure them.
            m_MainView            = new MainPageView();
            m_MainView.Presenter  = new MainPresenter(m_MainView, mainModel);
            m_StartView           = new StartPageView();
            m_StartView.Presenter = new StartPresenter(m_StartView, startModel);
            m_ErrorPageView       = new ErrorPageView();

            // Add floating dialogue so it can be displayed anywhere in the window.
            root.Add(FloatingDialogue.Instance);

            OnUpdatedProjectStatus(m_Provider.GetProjectStatus());
        }
Ejemplo n.º 19
0
        private async void Start(object sender, EventArgs e)
        {
            server = new ServerForm();
            enemy  = new EnemyForm(server);
            client = new ClientForm(server);

            client.Show();
            server.Show();

            StartModel.Enabled = false;



            await client.Initialize();

            Maximize.Show();
            Minimize.Show();
            StartModel.Hide();
            enemy.Show();
        }
Ejemplo n.º 20
0
        public ActionResult ApplyFilter(FormCollection filters)
        {
            StartModel startModel = new StartModel();

            foreach (Restaurant rest in restService.GetAll())
            {
                foreach (var filter in filters[0].Split(','))
                {
                    if (itemService.GetAllByRestaurantId(rest.Id).Any(it => it.Type == filter.ToString()))
                    {
                        if (((DateTime.Now - rest.LastOnline).Hours) < 1)
                        {
                            startModel.openRestaurants.Add(rest);
                        }
                        else
                        {
                            startModel.closedRestaurants.Add(rest);
                        }
                        break;
                    }
                }
            }
            return(Json(startModel, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 21
0
 public StartViewModel(UserModel user)
 {
     Model = new StartModel(user);
 }