public void SelectDay(CalendarDay day, Keys modifierKeys)
        {
            var ctrlSelect  = (modifierKeys & Keys.Control) == Keys.Control;
            var shiftSelect = (modifierKeys & Keys.Shift) == Keys.Shift;

            if (!(ctrlSelect | shiftSelect))
            {
                ClearSelection();
            }
            if (shiftSelect)
            {
                var prevSelectedDay = SelectedDays.LastOrDefault();
                if (prevSelectedDay != null)
                {
                    var minDate = prevSelectedDay.Date > day.Date ? day.Date : prevSelectedDay.Date;
                    var maxDate = prevSelectedDay.Date < day.Date ? day.Date : prevSelectedDay.Date;
                    foreach (var dayToSelect in ParentView.Calendar.ActiveCalendarSection.Days.Where(x => (x.Date >= minDate && x.Date < maxDate) && !SelectedDays.Contains(x)))
                    {
                        ParentView.SelectDay(dayToSelect, true);
                        SelectedDays.Add(dayToSelect);
                    }
                }
            }
            if (!SelectedDays.Contains(day))
            {
                ParentView.SelectDay(day, true);
                SelectedDays.Add(day);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Show the popup view.
        /// </summary>
        /// <param name="animation">The method is passed the VisualElement that contains the body, header, and footer</param>
        /// <remarks>
        /// This method is not limited adding animations.
        /// </remarks>
        public async Task ShowAsync(Func <Popup, Task> animation)
        {
            if (IsVisible)
            {
                return;
            }

            var parent = ParentView.FindParent <Layout>();

            if (parent != null)
            {
                parent.RaiseChild(_popupView);
            }

            var handlerResponse = OnShowing();

            if (handlerResponse.Cancel)
            {
                return;
            }

            IsVisible = true;

            if (animation == null)
            {
                await Task.FromResult(0);
            }
            else
            {
                // the overlay is not passed to the caller
                await animation(this);
            }

            OnShown();
        }
Exemplo n.º 3
0
        private void CreateItemMenu <T>(string text) where T : BaseExampleView
        {
            var button = _scrollView.Button(new UIButtonSettings
            {
                Sprite = Game.GetSprite("mp_bar_text"),
            });

            button.Label(new UILabelSettings
            {
                Text      = text,
                Color     = Color.black,
                Font      = "Arial",
                TextStyle =
                {
                    FontStyle     = FontStyle.Bold,
                    TextAlignment = TextAlignment.Center,
                    Size          = 40
                }
            }).SortingOrder(1);

            button.OnClick += sender =>
            {
                Hide();
                ParentView.View <T>().BeforeDestroy += s =>
                {
                    Show();
                };
            };
        }
Exemplo n.º 4
0
 public void RemoveFromParentView()
 {
     if (ParentView != null)
     {
         ParentView.RemoveSubview(this);
     }
 }
        private void PrepareSurfaceView()
        {
            _surfaceView = new UIView(ParentView.Bounds);
            ParentView.Superview.AddSubview(_surfaceView);
            ParentView.BringSubviewToFront(_surfaceView);
            _surfaceView.UserInteractionEnabled = true;

            _tapGesture = new UITapGestureRecognizer((UITapGestureRecognizer obj) =>
            {
                HideSideBar();
            });

            _tapGesture.ShouldReceiveTouch += (UIGestureRecognizer recognizer, UITouch touch) =>
            {
                bool isSurfaceView = (touch.View != _surfaceView);
                return(!isSurfaceView);
            };

            _swipeGesture = new UISwipeGestureRecognizer((UISwipeGestureRecognizer obj) =>
            {
                HideSideBar();
            });

            _swipeGesture.Direction           = UISwipeGestureRecognizerDirection.Left;
            _swipeGesture.ShouldReceiveTouch += (UIGestureRecognizer recognizer, UITouch touch) =>

            {
                return(true);
            };

            _surfaceView.AddGestureRecognizer(_tapGesture);
            _surfaceView.AddGestureRecognizer(_swipeGesture);
        }
Exemplo n.º 6
0
        public bool HandleBackKey()
        {
            bool      res    = false;
            BlockBase notify = backKeyListener;

            // try the back key listener first
            if (notify != null)
            {
                res = notify.HasAction(Anchor.Back, ActionType.GotoBack);

                notify.FireAction(Anchor.Back);
            }

            // if not, try going back
            if (!res)
            {
                res = GoBack();

                if (!res && (ParentView != null))
                {
                    return(ParentView.HandleBackKey());
                }
            }

            return(res);
        }
 protected override bool OnMouseLeave()
 {
     ParentView.ShowInfoTip(String.Empty);
     UpdateTransparency(Point.Empty);
     Refresh();
     return(false);
 }
Exemplo n.º 8
0
        private void PropertyChangedHandler(object sender, PropertyChangedEventArgs e)
        {
            switch (e.PropertyName)
            {
            case nameof(Modpack.Name):
                OnPropertyChanged(new PropertyChangedEventArgs(nameof(DisplayName)));
                break;

            case nameof(Modpack.Active):
                OnPropertyChanged(new PropertyChangedEventArgs(nameof(Active)));
                break;

            case nameof(Modpack.HasUnsatisfiedDependencies):
                OnPropertyChanged(new PropertyChangedEventArgs(nameof(HasUnsatisfiedDependencies)));
                break;

            case nameof(Modpack.Editing):
                if (Modpack.Editing)
                {
                    ParentView.EditItem(this);
                }
                else
                {
                    ParentView.CommitEdit();
                }
                break;
            }
        }
Exemplo n.º 9
0
 protected virtual void OnClose(bool useGroup)
 {
     if (IsRecord)
     {
         BaseUIMgr.RemoveRecordView(this);
     }
     if (ParentView != null)
     {
         //关闭界面的时候自动刷新父级界面
         if (ParentView.IsShow && !ParentView.IsRootView)
         {
             ParentView.SetDirtyAll();
         }
     }
     if (DirtyAllWhenClose.Count > 0)
     {
         //关闭界面的时候自动刷新关联界面
         foreach (var item in DirtyAllWhenClose)
         {
             item.SetDirtyAll();
         }
         DirtyAllWhenClose.Clear();
     }
     //不是RootView的话就关闭所有子界面
     if (!IsRootView)
     {
         foreach (var item in SubViews)
         {
             item.Show(false);
         }
     }
     Callback_OnClose?.Invoke(this, useGroup);
 }
        public object this [int[] aIdx] {
            get {
                if ((aIdx == null) || (aIdx.Length == 0))
                {
                    throw new NullReferenceException("Hierarchical index (int[]) can't be null or empty");
                }

                if (IsFiltered == false)
                {
                    if (TypeValidator.IsCompatible(ParentView.GetType(), typeof(IObservableList)) == true)
                    {
                        return((ParentView as IObservableList)[aIdx]);
                    }
                    else
                    {
                        return(HierarchicalList.Get(ParentView, aIdx));
                    }
                }

                if ((aIdx[0] < 0) || (aIdx[0] >= Count))
                {
                    throw new IndexOutOfRangeException(string.Format("Index {0} is out of range", aIdx.PathToString()));
                }

                return(HierarchicalList.Get(this, aIdx));
            }
        }
Exemplo n.º 11
0
 protected override bool OnKeyDown(KeyEventArgs eventArgs)
 {
     if (eventArgs.KeyValue == (int)Keys.Escape)
     {
         ParentView.RemoveDesignerMessageFilter(this);
     }
     return(true);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Obsługa naciśnięcia btn Anuluj.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">EventArgs.</param>
 private void cancelRadButtonElement_Click(object sender, EventArgs e)
 {
     if (ParentView.GetType() == typeof(CarProductList))
     {
         ParentView.Hide();
     }
     base.CancelAndClose();
 }
 public void ClearSelection()
 {
     foreach (var day in SelectedDays)
     {
         ParentView.SelectDay(day, false);
     }
     SelectedDays.Clear();
 }
 void IDesignerGlyphProviderService.AddGlyphProvider(IDesignerGlyphProvider glyphProvider)
 {
     if (!this.designerGlyphProviders.Contains(glyphProvider))
     {
         this.designerGlyphProviders.Add(glyphProvider);
         ParentView.InvalidateClientRectangle(Rectangle.Empty);
     }
 }
 private void OnAutoExpand(object sender, EventArgs eventArgs)
 {
     if (this.autoExpandableDesigner != null)
     {
         this.autoExpandableDesigner.Expanded = true;
         ParentView.PerformLayout(true);
     }
     SetAutoExpandableDesigner(null);
 }
Exemplo n.º 16
0
        protected virtual NSLayoutYAxisAnchor GetCenterYAnchor()
        {
            if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0) || Snackbar.ParentController == null)
            {
                return(ParentView.SafeCenterYAnchor());
            }

            return(Snackbar.ParentController.View?.CenterYAnchor);
        }
Exemplo n.º 17
0
        protected virtual NSLayoutYAxisAnchor GetTopAnchor()
        {
            if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0) || Snackbar.ParentController == null)
            {
                return(ParentView.SafeTopAnchor());
            }

            return(Snackbar.ParentController.TopLayoutGuide.GetBottomAnchor());
        }
Exemplo n.º 18
0
        // This should be implemented by any inspector class that wants to define its own GraphSettings
        // which for SG, is a representation of the settings in GraphData
        protected virtual void ShowGraphSettings_Internal(VisualElement contentContainer)
        {
            var graphEditorView = ParentView.GetFirstAncestorOfType<GraphEditorView>();
            if (graphEditorView == null)
                return;

            contentContainer.Clear();
            DrawInspectable(contentContainer, (IInspectable)ParentView, m_graphSettingsPropertyDrawer);
            contentContainer.MarkDirtyRepaint();
        }
        protected override bool OnMouseDown(MouseEventArgs eventArgs)
        {
            Debug.Assert(this.dragStarted == false);
            if (eventArgs.Button == MouseButtons.Left)
            {
                this.startDrag = this.endDrag = ParentView.ClientPointToLogical(new Point(eventArgs.X, eventArgs.Y));
            }

            return(false);
        }
 public void RemoveAt(int aIdx)
 {
     if (IsFiltered == true)
     {
         ParentView.Remove(filtredList[aIdx]);
     }
     else
     {
         ParentView.RemoveAt(aIdx);
     }
 }
Exemplo n.º 21
0
        protected void DrawCommands()
        {
            var Iter = currentGroup.Commands.GetEnumerator();

            int Index = 0;

            while (Iter.MoveNext())
            {
                if (Iter.Current.Value.isHiddenInMobile)
                {
                    continue;
                }

                GUILayout.BeginHorizontal();

                try
                {
                    string FunctionName = Iter.Current.Value.comment;

                    if (Count++ >= ParentView.skipCount)
                    {
                        if (DrawButton(FunctionName, Iter.Current.Value.fullyHelper))
                        {
                            ICheatCommand Command = Iter.Current.Value;

                            if (Command.argumentsTypes == null ||
                                Command.argumentsTypes.Length == 0)
                            {
                                // execute this command directly.
                                logger.AddMessage(Command.StartProcess(new string[] { "" }));
                            }
                            else
                            {
                                logger.Clear();
                                ParentView.SelectionCommand(Iter.Current.Value);
                                break;
                            }
                        }

                        GUILayout.Label(GUI.tooltip, ParentView.CustomLabelStyle);

                        GUI.tooltip = "";
                    }

                    ++Index;
                }
                finally
                {
                    GUILayout.EndHorizontal();
                }

                GUILayout.Space(SpaceHeight);
            }
        }
 public void RemoveAt(int aIdx)
 {
     if (IsFiltered == true)
     {
         ParentView.RemoveAt(localIndex[aIdx]);
     }
     else
     {
         ParentView.RemoveAt(aIdx);
     }
 }
Exemplo n.º 23
0
 /// <summary>
 /// Invalida una particolare area del controllo corrente
 /// </summary>
 public void Invalidate(RectangleF rc)
 {
     if (ParentView != null)
     {
         var absLoc = this.GetAbsoluteLocation();
         ParentView.Invalidate(new Rectangle(
                                   (int)Math.Floor(absLoc.X + rc.X),
                                   (int)Math.Floor(absLoc.Y + rc.Y),
                                   (int)Math.Ceiling(rc.Width),
                                   (int)Math.Ceiling(rc.Height)));
     }
 }
 /// <summary>
 /// Checks if view contains specified object
 /// </summary>
 /// <param name="value">
 /// Searched object <see cref="System.Object"/>
 /// </param>
 /// <returns>
 /// true if yes, false if not <see cref="System.Boolean"/>
 /// </returns>
 public bool Contains(object value)
 {
     if (IsFiltered == true)
     {
         if (OnIsVisibleInFilter(value) == false)
         {
             return(false);
         }
         return(filtredList.Contains(value));
     }
     return(ParentView.Contains(value));
 }
Exemplo n.º 25
0
        protected bool CheckCandinateState(ICheatCommand InCommand)
        {
            string InputText = inputText.TrimStart(' ');

            if (InCommand == null || InputText.IndexOf(' ') == -1)
            {
                ParentView.ChangeState("CommandCandinateState");
                return(false);
            }

            return(true);
        }
Exemplo n.º 26
0
 /// <summary>
 /// Usuwa dany samochód.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">EventArgs.</param>
 private void deleteCarButton_Click(object sender, EventArgs e)
 {
     if (loanButton.Text.Contains(Resources.CarServicesCarButton))
     {
         Presenter.DeleteHandledCarProduct(CurrentHandledCarProduct);
     }
     else
     {
         Presenter.DeleteCarServicesCar(CurrentCarServicesCar);
     }
     ParentView.Close();
 }
Exemplo n.º 27
0
        public UserInfoView(UserInfoViewModel viewModel)
        {
            InitializeComponent();
            ViewModel = viewModel;

            this.WhenActivated(disposableRegistration =>
            {
                this.OneWayBind(ViewModel,
                                vm => vm.UserName,
                                v => v.UserGravatar.Id)
                .DisposeWith(disposableRegistration);
                this.OneWayBind(ViewModel,
                                vm => vm.UserName,
                                v => v.UserNameTextBox.Text)
                .DisposeWith(disposableRegistration);
                this.OneWayBind(ViewModel,
                                vm => vm.Name,
                                v => v.NameTextBox.Text)
                .DisposeWith(disposableRegistration);
                this.OneWayBind(ViewModel,
                                vm => vm.NationalIdentificationNumber,
                                v => v.NationalIdentificationNumberTextBox.Text)
                .DisposeWith(disposableRegistration);
                this.OneWayBind(ViewModel,
                                vm => vm.CreditValue,
                                v => v.CreditValueTextBox.Text)
                .DisposeWith(disposableRegistration);
                this.OneWayBind(ViewModel,
                                vm => vm.AccreditedDays,
                                v => v.AccreditedDaysTextBox.Text)
                .DisposeWith(disposableRegistration);
                this.OneWayBind(ViewModel,
                                vm => vm.AuthorityLevel,
                                v => v.AuthorityLevelTextBox.Text)
                .DisposeWith(disposableRegistration);

                this.BindCommand(ViewModel,
                                 vm => vm.RefreshCommand,
                                 v => v.RefreshButton)
                .DisposeWith(disposableRegistration);
                this.BindCommand(ViewModel,
                                 vm => vm.LogoutCommand,
                                 v => v.LogoutButton)
                .DisposeWith(disposableRegistration);

                ViewModel.LoggedOut.RegisterHandler(interactioni =>
                {
                    interactioni.SetOutput(Unit.Default);
                    ParentView.Navigate(ParentView.LoginSideMenu.Name);
                });
            });
        }
 public void Refilter()
 {
     if (IsFiltered == false)
     {
         filtredList = ParentView.Cast <object> ().ToList();
         return;
     }
     else
     {
         filtredList = ParentView.Cast <object> ().Where(OnIsVisibleInFilter).ToList();
     }
     OnListChanged();
 }
 protected override bool OnKeyDown(KeyEventArgs eventArgs)
 {
     if (eventArgs.KeyValue == (int)Keys.Escape)
     {
         ParentView.RemoveDesignerMessageFilter(this);
     }
     else
     {
         this.currentState = ((eventArgs.Modifiers & Keys.Shift) != 0) ? ((this.initialState == ZoomState.In) ? ZoomState.Out : ZoomState.In) : this.initialState;
         RefreshUIState();
     }
     return(true);
 }
        protected override bool OnDragEnter(DragEventArgs eventArgs)
        {
            //Invalidate the autoscrollindicator area
            this.startAutoScroll = true;

            Rectangle[] scrollIndicatorRectangles = ScrollIndicatorRectangles;
            foreach (Rectangle rectangle in scrollIndicatorRectangles)
            {
                ParentView.InvalidateClientRectangle(rectangle);
            }

            return(false);
        }