Пример #1
0
        /*public GameViewModel(GameServiceReference.Game game, int userId)
         * {
         *  _game = game;
         *  _userId = userId;
         *  Init();
         * }*/

        public GameViewModel()
        {
            BottomMenu = new BottomMenu();
            CenterView = new CenterView {
                DataContext = this
            };

            /*Players = new ObservableCollection<Player>
             * {
             *  new Player
             *  {
             *      Name = "Петя",
             *      CardsCount = 3,
             *      GoldCount = 4
             *  },
             *  new Player
             *  {
             *      Name = "Вася",
             *      CardsCount = 4,
             *      GoldCount = 7
             *  },
             *  new Player
             *  {
             *      Name = "Дима",
             *      CardsCount = 1,
             *      GoldCount = 2
             *  },
             *  new Player
             *  {
             *      Name = "Женя",
             *      CardsCount = 5,
             *      GoldCount = 2
             *  },
             * };*/
        }
Пример #2
0
        public GetCenterResponse GetCenter(GetRequest request)
        {
            GetCenterResponse response = new GetCenterResponse();

            try
            {
                Center center = _centerRepository.FindBy(request.ID);

                if (center != null)
                {
                    CenterView centerView = center.ConvertToCenterView();

                    Infrastructure.Querying.Query query = new Infrastructure.Querying.Query();
                    Criterion criteria = new Criterion("Center.ID", center.ID, CriteriaOperator.Equal);
                    query.Add(criteria);
                    IEnumerable <NetworkCenter>     networkCenters     = _networkCenterRepository.FindBy(query);
                    IEnumerable <NetworkCenterView> networkCenterViews = networkCenters.ConvertToNetworkCenterViews();

                    centerView.NetworkCenters = networkCenterViews;


                    response.CenterView = centerView;
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            return(response);
        }
Пример #3
0
    // Use this for initialization
    IEnumerator Start()
    {
        yield return(new WaitForEndOfFrame());

        _centerView = GetComponentInChildren <CenterView>();
        _centerView.Init();
        _centerView.GotoPage(initPageIndex);
    }
Пример #4
0
        void addComments()
        {
            _commentScroll = new CommentsScrollView(new CGRect(0, 346, 320, 167));
            CenterView.Add(_commentScroll);
            var vm = ViewModel as MainViewModel;

            if (vm.PostsList != null)
            {
                _commentScroll.PostsList = vm.PostsList;
            }
            vm.PropertyChanged += (sender, e) => {
                if (e.PropertyName == "PostsList")
                {
                    _commentScroll.PostsList = vm.PostsList;
                }
            };
        }
Пример #5
0
        void addUsersScroll()
        {
            _userscrollview = new UsersScrollView(new CGRect(0, 246, 320, 100));
            CenterView.Add(_userscrollview);

            var vm = ViewModel as MainViewModel;

            if (vm.UsersList != null)
            {
                _userscrollview.UsersList = vm.UsersList;
            }
            vm.PropertyChanged += (sender, e) => {
                if (e.PropertyName == "UsersList")
                {
                    _userscrollview.UsersList = vm.UsersList;
                }
            };
        }
Пример #6
0
        private void styleView()
        {
            HelloLabel.Font              = Styles.SetHelveticaFont(25);
            ContactDataTitleLabel.Font   = Styles.SetHelveticaBoldFont(15);
            ContactDataDescripLabel.Font = Styles.SetHelveticaFont(15);
            HealthDataTitleLabel.Font    = Styles.SetHelveticaBoldFont(15);
            HealthDataDescripLabel.Font  = Styles.SetHelveticaFont(15);
            CloseSessionLabel.Font       = Styles.SetHelveticaFont(15);
            CenterTitle.Font             = Styles.SetHelveticaBoldFont(15);
            CenterDesc.Font              = Styles.SetHelveticaFont(15);

            ContactDataDescripLabel.TextColor = UIColor.LightGray;
            HealthDataDescripLabel.TextColor  = UIColor.LightGray;
            CenterDesc.TextColor = UIColor.LightGray;

            HealthDataView.setBorderShadow();
            ContactDataView.setBorderShadow();
            CenterView.setBorderShadow();
        }
Пример #7
0
        //[HttpPost]
        //public ActionResult Edit(string id, CenterDetailView centerDetailView)
        //{
        //    centerDetailView.EmployeeView = GetEmployee();

        //    #region Access Check
        //    bool hasPermission = GetEmployee().IsGuaranteed("Center_Update");
        //    if (!hasPermission)
        //    {
        //        ModelState.AddModelError("", "AccessDenied");
        //        return View(centerDetailView);
        //    }
        //    #endregion

        //    if (ModelState.IsValid)
        //        try
        //        {
        //            EditCenterRequest request = new EditCenterRequest();

        //            request.ID = Guid.Parse(id);
        //            request.ModifiedEmployeeID = GetEmployee().ID;
        //            request.CenterName = centerDetailView.CenterView.CenterName;
        //            request.Note = centerDetailView.CenterView.Note;
        //            request.RowVersion = centerDetailView.CenterView.RowVersion;

        //            GeneralResponse response = this._centerService.EditCenter(request);

        //            if (response.success)
        //                return RedirectToAction("Index");
        //            else
        //            {
        //                foreach (string error in response.ErrorMessages)
        //                    ModelState.AddModelError("", error);
        //                return View(centerDetailView);
        //            }
        //        }
        //        catch (Exception ex)
        //        {
        //            ModelState.AddModelError("", ex.Message);
        //            return View(centerDetailView);
        //        }

        //    return View(centerDetailView);
        //}
        #endregion

        #region Details
        public ActionResult Details(string id)
        {
            CenterDetailView centerDetailView = new CenterDetailView();

            centerDetailView.EmployeeView = GetEmployee();

            #region Access Check
            bool hasPermission = GetEmployee().IsGuaranteed("Center_Read");
            if (!hasPermission)
            {
                ModelState.AddModelError("", "AccessDenied");
                return(View(centerDetailView));
            }
            #endregion

            CenterView centerView = this.GetCenterView(id);

            centerDetailView.CenterView = centerView;

            return(View(centerDetailView));
        }
Пример #8
0
        private void initInputComment()
        {
            NewCommentView = new UIView(new CGRect(0, 513, 320, 45));
            CenterView.Add(NewCommentView);

            var img = new UIImageView(new CGRect(20, 12, 22, 22))
            {
                ContentMode = UIViewContentMode.ScaleToFill
            };

            img.Image = UIImage.FromFile("MLResources/IconsMuro/icon_enter.png");
            NewCommentView.Add(img);

            inputComment = new UITextField(new CGRect(50, 14, 250, 18))
            {
                Placeholder = "Comment"
            };
            inputComment.Font      = UIFont.FromName(fontname, 11);
            inputComment.TextColor = UIColor.White;
            NewCommentView.Add(inputComment);
        }
Пример #9
0
        private void initCenter()
        {
            los_scroll           = new LOsScrollView(new CGRect(0, 48, 320, 198));
            los_scroll.DoOpenLO += (sender, lo_index) => {
                var vm1 = ViewModel as MainViewModel;


                vm1.OpenLOCommand.Execute(vm1.LearningOjectsList[0]);
                LoadingView = new LoadingOverlay(new CGRect(0, 0, 320, 568));
                View.Add(LoadingView);
            };
            CenterView.Add(los_scroll);

            var vm = ViewModel as MainViewModel;

            if (vm.LearningOjectsList != null)
            {
                los_scroll.LearningOjectsList = vm.LearningOjectsList;
            }
            vm.PropertyChanged += (sender, e) => {
                los_scroll.LearningOjectsList = vm.LearningOjectsList;
            };
        }
Пример #10
0
        protected override void AssingViews()
        {
            styleView();
            applyTraslations();

            UITapGestureRecognizer gestureRecognizerContact = new UITapGestureRecognizer(() => presenter.OpenContactData());
            UITapGestureRecognizer gestureRecognizerHealth  = new UITapGestureRecognizer(() => presenter.OpenMedicalInfo());
            UITapGestureRecognizer gestureRecognizerCenter  = new UITapGestureRecognizer(() => presenter.OpenCenter());

            HealthDataView.AddGestureRecognizer(gestureRecognizerHealth);
            ContactDataView.AddGestureRecognizer(gestureRecognizerContact);
            CenterView.AddGestureRecognizer(gestureRecognizerCenter);

            CloseSessionButton.TouchUpInside += (sender, e) => presenter.LogoutClicked();
            LanguageButton.TouchUpInside     += (sender, e) => presenter.LanguageClicked();


            HelloLabel.Text        = "";
            CloseSessionLabel.Text = "";

            CloseSessionButton.Layer.CornerRadius = 8.0f;

            labeVersion.Text = String.Format(AppDelegate.LanguageBundle.GetLocalizedString("version"), NSBundle.MainBundle.InfoDictionary["CFBundleShortVersionString"]);
        }
Пример #11
0
        /// <inheritdoc/>
        public override IDock CreateLayout()
        {
            // Home

            var homeView = new HomeView
            {
                Id     = "Home",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Home"
            };

            // Center

            var centerView = new CenterView
            {
                Id     = "Center",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Center"
            };

            // Left / Top

            var leftTopView1 = new LeftTopView1
            {
                Id     = "LeftTop1",
                Dock   = "LeftTop1",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftTop1"
            };

            var leftTopView2 = new LeftTopView2
            {
                Id     = "LeftTop2",
                Dock   = "",
                Width  = 200,
                Height = 200,
                Title  = "LeftTop2"
            };

            var leftTopView3 = new LeftTopView3
            {
                Id     = "LeftTop3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftTop3"
            };

            // Left / Bottom

            var leftBottomView1 = new LeftBottomView1
            {
                Id     = "LeftBottom1",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom1"
            };

            var leftBottomView2 = new LeftBottomView2
            {
                Id     = "LeftBottom2",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom2"
            };

            var leftBottomView3 = new LeftBottomView3
            {
                Id     = "LeftBottom3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom3"
            };

            // Right / Top

            var rightTopView1 = new RightTopView1
            {
                Id     = "RightTop1",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop1"
            };

            var rightTopView2 = new RightTopView2
            {
                Id     = "RightTop2",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop2"
            };

            var rightTopView3 = new RightTopView3
            {
                Id     = "RightTop3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop3"
            };

            // Right / Bottom

            var rightBottomView1 = new RightBottomView1
            {
                Id     = "RightBottom1",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom1"
            };

            var rightBottomView2 = new RightBottomView2
            {
                Id     = "RightBottom2",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom2"
            };

            var rightBottomView3 = new RightBottomView3
            {
                Id     = "RightBottom3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom3"
            };

            // Left Pane

            var leftPane = new DockLayout
            {
                Id          = "LeftPane",
                Dock        = "Left",
                Width       = 200,
                Height      = double.NaN,
                Title       = "LeftPane",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    new DockStrip
                    {
                        Id          = "LeftPaneTop",
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "LeftPaneTop",
                        CurrentView = leftTopView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            leftTopView1,
                            leftTopView2,
                            leftTopView3
                        }
                    },
                    new DockSplitter()
                    {
                        Id    = "LeftPaneTopSplitter",
                        Dock  = "Top",
                        Title = "LeftPaneTopSplitter"
                    },
                    new DockStrip
                    {
                        Id          = "LeftPaneBottom",
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "LeftPaneBottom",
                        CurrentView = leftBottomView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            leftBottomView1,
                            leftBottomView2,
                            leftBottomView3
                        }
                    }
                }
            };

            // Right Pane

            var rightPane = new DockLayout
            {
                Id          = "RightPane",
                Dock        = "Right",
                Width       = 240,
                Height      = double.NaN,
                Title       = "RightPane",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    new DockStrip
                    {
                        Id          = "RightPaneTop",
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "RightPaneTop",
                        CurrentView = rightTopView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            rightTopView1,
                            rightTopView2,
                            rightTopView3
                        }
                    },
                    new DockSplitter()
                    {
                        Id    = "RightPaneTopSplitter",
                        Dock  = "Top",
                        Title = "RightPaneTopSplitter"
                    },
                    new DockStrip
                    {
                        Id          = "RightPaneBottom",
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "RightPaneBottom",
                        CurrentView = rightBottomView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            rightBottomView1,
                            rightBottomView2,
                            rightBottomView3
                        }
                    }
                }
            };

            // Main

            var mainLayout = new DockLayout
            {
                Id          = "MainLayout",
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "MainLayout",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    leftPane,
                    new DockSplitter()
                    {
                        Id    = "LeftSplitter",
                        Dock  = "Left",
                        Title = "LeftSplitter"
                    },
                    rightPane,
                    new DockSplitter()
                    {
                        Id    = "RightSplitter",
                        Dock  = "Right",
                        Title = "RightSplitter"
                    },
                    centerView
                }
            };

            var mainView = new MainView
            {
                Id          = "Main",
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Main",
                CurrentView = mainLayout,
                Views       = new ObservableCollection <IDock>
                {
                    mainLayout
                }
            };

            // Root

            var layout = new DockRoot
            {
                Id          = "Root",
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Root",
                CurrentView = homeView,
                DefaultView = homeView,
                Views       = new ObservableCollection <IDock>
                {
                    homeView,
                    mainView,
                }
            };

            return(layout);
        }
        void ReleaseDesignerOutlets()
        {
            if (CenterDesc != null)
            {
                CenterDesc.Dispose();
                CenterDesc = null;
            }

            if (CenterTitle != null)
            {
                CenterTitle.Dispose();
                CenterTitle = null;
            }

            if (CenterView != null)
            {
                CenterView.Dispose();
                CenterView = null;
            }

            if (CloseSessionButton != null)
            {
                CloseSessionButton.Dispose();
                CloseSessionButton = null;
            }

            if (CloseSessionLabel != null)
            {
                CloseSessionLabel.Dispose();
                CloseSessionLabel = null;
            }

            if (ContactDataDescripLabel != null)
            {
                ContactDataDescripLabel.Dispose();
                ContactDataDescripLabel = null;
            }

            if (ContactDataTitleLabel != null)
            {
                ContactDataTitleLabel.Dispose();
                ContactDataTitleLabel = null;
            }

            if (ContactDataView != null)
            {
                ContactDataView.Dispose();
                ContactDataView = null;
            }

            if (HealthDataDescripLabel != null)
            {
                HealthDataDescripLabel.Dispose();
                HealthDataDescripLabel = null;
            }

            if (HealthDataTitleLabel != null)
            {
                HealthDataTitleLabel.Dispose();
                HealthDataTitleLabel = null;
            }

            if (HealthDataView != null)
            {
                HealthDataView.Dispose();
                HealthDataView = null;
            }

            if (HelloLabel != null)
            {
                HelloLabel.Dispose();
                HelloLabel = null;
            }

            if (labeVersion != null)
            {
                labeVersion.Dispose();
                labeVersion = null;
            }

            if (LanguageButton != null)
            {
                LanguageButton.Dispose();
                LanguageButton = null;
            }
        }