Ejemplo n.º 1
0
        /// <summary>
        /// Creates and initializes a new instance of the Popup class.
        /// </summary>
        /// <param name="parent">The EvasObject to which the new Popup will be attached as a child.</param>
        /// <since_tizen> preview </since_tizen>
        public Popup(EvasObject parent) : base(parent)
        {
            _dismissed     = new SmartEvent(this, "dismissed");
            _dismissed.On += (sender, e) =>
            {
                Dismissed?.Invoke(this, EventArgs.Empty);
            };

            _blockClicked     = new SmartEvent(this, "block,clicked");
            _blockClicked.On += (sender, e) =>
            {
                OutsideClicked?.Invoke(this, EventArgs.Empty);
            };

            _timeout     = new SmartEvent(this, "timeout");
            _timeout.On += (sender, e) =>
            {
                TimedOut?.Invoke(this, EventArgs.Empty);
            };

            _showFinished     = new SmartEvent(this, "show,finished");
            _showFinished.On += (sender, e) =>
            {
                ShowAnimationFinished?.Invoke(this, EventArgs.Empty);
            };
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates and initializes a new instance of the Hoversel class.
 /// </summary>
 /// <param name="parent">The parent is a given container which will be attached by Hoversel as a child. It's <see cref="EvasObject"/> type.</param>
 /// <since_tizen> preview </since_tizen>
 public Hoversel(EvasObject parent) : base(parent)
 {
     _clicked     = new SmartEvent(this, "clicked");
     _clicked.On += (sender, e) =>
     {
         Clicked?.Invoke(this, EventArgs.Empty);
     };
     _expanded     = new SmartEvent(this, "expanded");
     _expanded.On += (sender, e) =>
     {
         Expanded?.Invoke(this, EventArgs.Empty);
     };
     _dismissed     = new SmartEvent(this, "dismissed");
     _dismissed.On += (sender, e) =>
     {
         Dismissed?.Invoke(this, EventArgs.Empty);
     };
     _selected     = new SmartEvent <HoverselItemEventArgs>(this, RealHandle, "selected", HoverselItemEventArgs.CreateFromSmartEvent);
     _selected.On += (s, e) =>
     {
         if (e.Item != null)
         {
             ItemSelected?.Invoke(this, e);
         }
     };
     _onItemSelected = (data, obj, info) =>
     {
         HoverselItem item = ItemObject.GetItemById((int)data) as HoverselItem;
         item?.SendItemSelected();
     };
 }
Ejemplo n.º 3
0
 private void DismissAnimationTimer_Tick(object sender, object e)
 {
     _animationTimer.Stop();
     Dismissed?.Invoke(this, EventArgs.Empty);
     Closed?.Invoke(this, new InAppNotificationClosedEventArgs(_lastDismissKind));
     _animationTimer.Tick -= DismissAnimationTimer_Tick;
 }
        public ContextPopupImplementation()
        {
            _popup = new EContextPopup(TForms.NativeParent)
            {
                Style = "select_mode",
            };

            _popup.BackButtonPressed += (s, e) =>
            {
                _popup.Dismiss();
            };

            _popup.Dismissed += (s, e) =>
            {
                Dismissed?.Invoke(this, EventArgs.Empty);
            };

            _popup.SetDirectionPriorty(
                EContextPopupDirection.Down,
                EContextPopupDirection.Down,
                EContextPopupDirection.Down,
                EContextPopupDirection.Down);

            _items = new Dictionary <ContextPopupItem, EContextPopupItem>();
        }
Ejemplo n.º 5
0
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            Root                 = (Grid)GetTemplateChild(nameof(Root));
            ShadowRect           = (Rectangle)GetTemplateChild(nameof(ShadowRect));
            SnackBarRoot         = (Grid)GetTemplateChild(nameof(SnackBarRoot));
            BeforeIconContainer  = (Border)GetTemplateChild(nameof(BeforeIconContainer));
            BeforeIconPresenter  = (ContentPresenter)GetTemplateChild(nameof(BeforeIconPresenter));
            BeforeAva            = (Ellipse)GetTemplateChild(nameof(BeforeAva));
            BeforeAvaBitmapImage = (BitmapImage)GetTemplateChild(nameof(BeforeAvaBitmapImage));
            //AfterIconContainer = (Border)GetTemplateChild(nameof(AfterIconContainer));
            //AfterIconPresenter = (ContentPresenter)GetTemplateChild(nameof(AfterIconPresenter));
            AfterAva                  = (Ellipse)GetTemplateChild(nameof(AfterAva));
            AfterAvaBitmapImage       = (BitmapImage)GetTemplateChild(nameof(AfterAvaBitmapImage));
            Presenter                 = (StackPanel)GetTemplateChild(nameof(Presenter));
            ActionButtonForHorizontal = (HyperlinkButton)GetTemplateChild(nameof(ActionButtonForHorizontal));
            ActionButtonForVertical   = (HyperlinkButton)GetTemplateChild(nameof(ActionButtonForVertical));

            long bic = RegisterPropertyChangedCallback(BeforeIconProperty, (a, b) => DrawIcon(BeforeIconContainer, BeforeIcon, BeforeIconPresenter));
            //long aic = RegisterPropertyChangedCallback(AfterIconProperty, (a, b) => DrawIcon(AfterIconContainer, AfterIcon, AfterIconPresenter));
            long bac = RegisterPropertyChangedCallback(BeforeAvatarProperty, (a, b) => Render());
            long aac = RegisterPropertyChangedCallback(AfterAvatarProperty, (a, b) => Render());
            long oc  = RegisterPropertyChangedCallback(OrientationProperty, (a, b) => Render());
            long atc = RegisterPropertyChangedCallback(ActionTextProperty, (a, b) => Render());
            long hac = RegisterPropertyChangedCallback(HorizontalAlignmentProperty, (a, b) => Render());

            ActionButtonForHorizontal.Click += (a, b) => {
                Dismiss();
                Dismissed?.Invoke(this, true);
            };
            ActionButtonForVertical.Click += (a, b) => {
                Dismiss();
                Dismissed?.Invoke(this, true);
            };
            SnackBarRoot.LayoutUpdated += (a, b) => {
                ShadowRect.Width  = SnackBarRoot.RenderSize.Width;
                ShadowRect.Height = SnackBarRoot.RenderSize.Height;
                Shadow.Draw(SnackBarRoot, ShadowRect, 24, 0.24f);
            };
            SnackBarRoot.SizeChanged += (a, b) => Render();
            Loaded += (a, b) => {
                DrawIcon(BeforeIconContainer, BeforeIcon, BeforeIconPresenter);
                //DrawIcon(AfterIconContainer, AfterIcon, AfterIconPresenter);
                Render();
            };
            Unloaded += (a, b) => {
                UnregisterPropertyChangedCallback(BeforeIconProperty, bic);
                //UnregisterPropertyChangedCallback(AfterIconProperty, aic);
                UnregisterPropertyChangedCallback(BeforeAvatarProperty, bac);
                UnregisterPropertyChangedCallback(AfterAvatarProperty, aac);
                UnregisterPropertyChangedCallback(OrientationProperty, oc);
                UnregisterPropertyChangedCallback(ActionTextProperty, atc);
                UnregisterPropertyChangedCallback(HorizontalAlignmentProperty, hac);
            };
            if (nonXamlDuration >= 0)
            {
                Show(nonXamlDuration);
                nonXamlDuration = -1;
            }
        }
Ejemplo n.º 6
0
        public async Task CloseEventAsync()
        {
            await Dismissed.InvokeAsync();

            _dismissed = true;
            await InvokeAsync(StateHasChanged);
        }
Ejemplo n.º 7
0
        void IOnDismissListener.OnDismiss(View view)
        {
            view.Alpha      = 1;
            view.Visibility = ViewStates.Invisible;
            view.RequestLayout();

            Dismissed?.Invoke(this, EventArgs.Empty);
        }
Ejemplo n.º 8
0
 public Snackbar()
 {
     this.DefaultStyleKey = typeof(Snackbar);
     timer.Tick          += (a, b) => {
         Dismiss();
         Dismissed?.Invoke(this, false);
     };
 }
 /// <summary>
 /// Dismiss the notification
 /// </summary>
 public void Dismiss()
 {
     if (Visibility == Visibility.Visible)
     {
         VisualStateManager.GoToState(this, StateContentCollapsed, true);
         Dismissed?.Invoke(this, EventArgs.Empty);
     }
 }
Ejemplo n.º 10
0
 private void DismissEvent()
 {
     if (Dismissed != null)
     {
         Dismissed.Invoke(this, EventArgs.Empty);
     }
     Dismiss();
 }
Ejemplo n.º 11
0
        public override void OnDismiss(IDialogInterface dialog)
        {
            base.OnDismiss(dialog);

            Dismissed?.Invoke(this, null);

            ViewModel.DialogComponent.CloseCommand.Execute(null);
        }
Ejemplo n.º 12
0
        private void OnWindowClosed(object sender, EventArgs e)
        {
            _isAdvised = false;

            CompletionWindowManager.Wnd.SelectionChanged -= OnSelectionChanged;
            CompletionWindowManager.WordCompleted        -= OnWordCompleted;

            CompletionWindowManager.WindowClosed -= OnWindowClosed;

            Dismissed?.Invoke(this, EventArgs.Empty);
        }
Ejemplo n.º 13
0
 public override void Dismiss()
 {
     if (IsDismissed)
     {
         return;
     }
     isDismissed     = true;
     HexView.Closed -= HexView_Closed;
     Dismissed?.Invoke(this, EventArgs.Empty);
     DisposeQuickInfoSources();
 }
Ejemplo n.º 14
0
 public void Dismiss()
 {
     if (IsDismissed)
     {
         return;
     }
     IsDismissed      = true;
     TextView.Closed -= TextView_Closed;
     Dismissed?.Invoke(this, EventArgs.Empty);
     DisposeQuickInfoSources();
 }
Ejemplo n.º 15
0
        public static async Task  EmployeePenaltySum(this PayrollDbContext payrollDb, int?count, int?employeeId, DateTime date)
        {
            if (count != null)
            {
                decimal?amount = payrollDb.Placeswork.Where(x => x.EmployeeId == employeeId)
                                 .Include(x => x.Positions)
                                 .ThenInclude(x => x.EmployeeSalaries)
                                 .Single().Positions.EmployeeSalaries.Salary;


                if (amount.HasValue)
                {
                    var WillBeFined = await payrollDb.DisciplinePenalties.FirstOrDefaultAsync();//olunacaq cerime

                    if (WillBeFined != null)
                    {
                        if (CountIsBigNumberMax((int)count, WillBeFined.MaxDay))
                        {
                            var employee = await payrollDb.Employees.Where(x => x.Id == employeeId).FirstOrDefaultAsync();

                            Dismissed dismissed = new Dismissed()
                            {
                                Name    = employee.Name,
                                Surname = employee.Surname,
                                Number  = employee.Number,
                                Photo   = employee.Photo,
                                Email   = employee.Email,
                                DistrictRegistration = employee.DistrictRegistration,
                                IDCardSerialNumber   = employee.IDCardSerialNumber,
                                PlasiyerCode         = employee.PlasiyerCode,
                                EndDate = date.AddDays((double)-count)
                            };//isden cixanlar
                            payrollDb.Dismisseds.Add(dismissed);
                            payrollDb.Employees.Remove(employee);
                            await payrollDb.SaveChangesAsync();
                        }
                        else
                        {
                            var     penaltyAmount = SalaryPenalty((decimal)amount, (int)count, WillBeFined.PenaltyValue);
                            Penalty penalty       = new Penalty
                            {
                                Amount     = penaltyAmount,
                                Date       = DateTime.Now.Date,
                                EmployeeId = (int)employeeId
                            };
                            await payrollDb.Penalties.AddAsync(penalty);

                            await payrollDb.SaveChangesAsync();
                        }
                    }
                }
            }
        }
 public void Dismiss()
 {
     if (IsDismissed)
     {
         return;
     }
     IsDismissed = true;
     TextView.Caret.PositionChanged -= Caret_PositionChanged;
     TextView.Closed -= TextView_Closed;
     Dismissed?.Invoke(this, EventArgs.Empty);
     DisposeSignatureHelpSources();
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Creates and initializes a new instance of the ContextPopup class.
 /// </summary>
 /// <param name="parent">The parent is a given container, which will be attached by ContextPopup
 /// as a child. It's <see cref="EvasObject"/> type.</param>
 /// <since_tizen> preview </since_tizen>
 public ContextPopup(EvasObject parent) : base(parent)
 {
     _dismissed     = new SmartEvent(this, this.RealHandle, "dismissed");
     _dismissed.On += (sender, e) =>
     {
         Dismissed?.Invoke(this, EventArgs.Empty);
     };
     _onSelected = (data, obj, info) =>
     {
         ContextPopupItem item = ItemObject.GetItemById((int)data) as ContextPopupItem;
         item?.SendSelected();
     };
 }
        public void Close()
        {
            Dismissed?.Invoke(this, EventArgs.Empty);
            textView.LostAggregateFocus -= CloseOnTextviewLostFocus;
            Instance = null;
            textView.Properties ["RoslynCompletionPresenterSession.IsCompletionActive"] = false;
            HideDescription();
            var manager = textView.GetSpaceReservationManager("completion");

            if (agent != null)
            {
                manager.RemoveAgent(agent);
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// The constructor, which creates a new ContextPopup instance.
        /// </summary>
        public ContextPopup()
        {
            _contextPopup = DependencyService.Get <IContextPopup>(DependencyFetchTarget.NewInstance);

            _contextPopup.Dismissed    += (s, e) => Dismissed?.Invoke(this, EventArgs.Empty);
            _contextPopup.ItemSelected += (s, e) => ItemSelected?.Invoke(this, EventArgs.Empty);

            _items = new ObservableCollection <ContextPopupItem>();
            _items.CollectionChanged += ItemsCollectionChanged;

            SetBinding(IsAutoHidingEnabledProperty, new Binding(nameof(IsAutoHidingEnabled), mode: BindingMode.TwoWay, source: _contextPopup));
            SetBinding(DirectionPrioritiesProperty, new Binding(nameof(DirectionPriorities), mode: BindingMode.TwoWay, source: _contextPopup));
            SetBinding(SelectedItemProperty, new Binding(nameof(SelectedItem), mode: BindingMode.TwoWay, source: _contextPopup));
        }
Ejemplo n.º 20
0
        public void Update()
        {
            if (Visible)
            {
                if (GameboyInputs.UpPressed())
                {
                    _current++;
                    if (_current > _max)
                    {
                        _current = 1;
                    }
                }
                else if (GameboyInputs.DownPressed())
                {
                    _current--;
                    if (_current == 0)
                    {
                        _current = _max;
                    }
                }
                else if (GameboyInputs.RightPressed())
                {
                    _current += 10;
                    if (_current > _max)
                    {
                        _current = _max;
                    }
                }
                else if (GameboyInputs.LeftPressed())
                {
                    _current -= 10;
                    if (_current <= 0)
                    {
                        _current = 1;
                    }
                }

                if (GameboyInputs.APressed())
                {
                    AmountSelected?.Invoke(_current);
                    Close();
                }
                else if (GameboyInputs.BPressed())
                {
                    Dismissed?.Invoke();
                    Close();
                }
            }
        }
Ejemplo n.º 21
0
 /// <summary>
 /// Dismiss the notification
 /// </summary>
 public void Dismiss()
 {
     try
     {
         if (Visibility == Visibility.Visible)
         {
             VisualStateManager.GoToState(this, StateContentCollapsed, true);
             Dismissed?.Invoke(this, System.EventArgs.Empty);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine(e.Message);
     }
 }
        public FullScreenControlPad()
            : base(new CGRect(new CGPoint(0, 0), defaultSize))
        {
            BackgroundColor = UIColor.FromWhiteAlpha(0.0f, 0.5f);
            ClipsToBounds   = true;

            RestoreXY();

            dismissButton.Frame            = Bounds;
            dismissButton.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
            dismissButton.TintColor        = UIColor.White;
            dismissButton.SetTitle("Dismiss " + Frame, UIControlState.Normal);
            dismissButton.TouchUpInside += (sender, e) => Dismissed?.Invoke(this, EventArgs.Empty);
            AddSubview(dismissButton);
        }
Ejemplo n.º 23
0
        /// <summary>
        /// The constructor, which creates a new ContextPopup instance.
        /// </summary>
        /// <since_tizen> 4 </since_tizen>
        public ContextPopup()
        {
            _contextPopup = DependencyService.Get <IContextPopup>(DependencyFetchTarget.NewInstance);

            _items = new ObservableCollection <ContextPopupItem>();
            _items.CollectionChanged += ItemsCollectionChanged;

            SetBinding(SelectedItemProperty, new Binding(nameof(SelectedItem), mode: BindingMode.TwoWay, source: _contextPopup));

            _contextPopup.Dismissed    += (s, e) => Dismissed?.Invoke(this, EventArgs.Empty);
            _contextPopup.ItemSelected += (s, e) =>
            {
                SelectedItem = e.SelectedItem as ContextPopupItem;
                ItemSelected?.Invoke(this, new SelectedItemChangedEventArgs(e.SelectedItem));
            };
        }
    private void OnTimeGotFocus(object sender, RoutedEventArgs e)
    {
        if (!_active)
        {
            return;
        }

        _active = false;

        if (!_timeChanged)
        {
            Dismissed?.Invoke(this, EventArgs.Empty);
        }

        _timeChanged = false;
    }
        /// <summary>
        /// ContextPopupRenderer class constructor.
        /// </summary>
        public ContextPopupRenderer()
        {
            _popup = new EContextPopup(TForms.NativeParent);

            _popup.BackButtonPressed += (s, e) =>
            {
                _popup.Dismiss();
            };

            _popup.Dismissed += (s, e) =>
            {
                Dismissed?.Invoke(this, EventArgs.Empty);
            };

            _items = new Dictionary <ContextPopupItem, EContextPopupItem>();
        }
Ejemplo n.º 26
0
 /// <summary>
 /// Dismiss the notification
 /// </summary>
 public void Dismiss()
 {
     try
     {
         if (Visibility == Visibility.Visible)
         {
             VisualStateManager.GoToState(this, StateContentCollapsed, true);
             Dismissed?.Invoke(this, System.EventArgs.Empty);
         }
     }
     catch (Exception e)
     {
         LogService.AddLogMessage(e.Message);
         throw new Base.Exceptions.Exception("Unhandled exception", e);
     }
 }
Ejemplo n.º 27
0
        public virtual void Dismiss()
        {
            if (!(popup is null))
            {
                popup.Closed -= OnPopupClosed;
                popup.IsOpen  = false;
                popup.Child   = null;

                textView.TextBuffer.Changed -= OnTextBufferChanged;
            }

            if (Dismissed is null)
            {
                return;
            }
            Dismissed?.Invoke(this, EventArgs.Empty);
        }
Ejemplo n.º 28
0
 public void Dismiss()
 {
     if (IsDismissed)
     {
         return;
     }
     IsDismissed      = true;
     TextView.Closed -= TextView_Closed;
     completionSessionCommandTargetFilter?.Close();
     completionSessionCommandTargetFilter = null;
     Dismissed?.Invoke(this, EventArgs.Empty);
     if (completionSources != null)
     {
         foreach (var source in completionSources)
         {
             source.Dispose();
         }
         completionSources = null;
     }
 }
Ejemplo n.º 29
0
        void OnDismissed()
        {
            Dismissed?.Invoke();

            if (_subHuntWindow != null)
            {
                _subHuntWindow.Close();
            }

            _container.LayoutUpdated -= Container_LayoutUpdated;
            _container.PopupOpened   -= PopupOpened;
            _session.StateChanged    -= Session_StateChanged;
            _wpfTextView.VisualElement.MouseWheel -= MouseWheel;

            _timer.Stop();
            _timer.Tick -= _timer_Tick;
            Current      = null;
            _container   = null;
            Debug.WriteLine("Dismissed");
        }
Ejemplo n.º 30
0
        protected override IntPtr CreateHandle(EvasObject parent)
        {
            _popup = new Popup(parent);

            _popup.Dismissed += (s, e) =>
            {
                OnDismissed();
                Dismissed?.Invoke(s, e);
            };
            _popup.OutsideClicked += (s, e) =>
            {
                OutsideClicked?.Invoke(s, e);
            };
            _popup.TimedOut += (s, e) =>
            {
                TimedOut?.Invoke(s, e);
            };
            _popup.ShowAnimationFinished += (s, e) =>
            {
                ShowAnimationFinished?.Invoke(s, e);
            };

            return(_popup);
        }