public override void Dispose()
 {
     if (_lifetime != null)
     {
         _lifetime.Dispose();
         _lifetime = null;
     }
 }
Ejemplo n.º 2
0
        public void Show(string id)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            ILifetime <NonModalPresenter> presenter = CreatePresenter <NonModalPresenter>(id);

            presenter.Instance.Closed += (sender, e) =>
            {
                presenter.Dispose();
            };

            presenter.Instance.Bind();
            presenter.Instance.Show();
        }
Ejemplo n.º 3
0
        private void Refresh()
        {
            if (Width == 0 || Height == 0)
            {
                return;
            }


            seekLt?.Dispose();
            var leftDest   = CalculateLeftDestination();
            var centerDest = CalculateCenterDestination();
            var rightDest  = CalculateRightDestination();

            if (center == null)
            {
                var thisMonth = new DateTime(Options.Year, Options.Month, 1);
                var lastMonth = thisMonth.AddMonths(-1);
                var nextMonth = thisMonth.AddMonths(1);
                left = ProtectedPanel.Add(new MonthCalendar(new MonthCalendarOptions()
                {
                    CustomizeContent = Options.CustomizeContent, MinMonth = Options.MinMonth, MaxMonth = Options.MaxMonth, AdvanceMonthBackwardKey = null, AdvanceMonthForwardKey = null, TodayHighlightColor = Options.TodayHighlightColor, Month = lastMonth.Month, Year = lastMonth.Year
                }));
                center = ProtectedPanel.Add(new MonthCalendar(new MonthCalendarOptions()
                {
                    CustomizeContent = Options.CustomizeContent, MinMonth = Options.MinMonth, MaxMonth = Options.MaxMonth, AdvanceMonthBackwardKey = null, AdvanceMonthForwardKey = null, TodayHighlightColor = Options.TodayHighlightColor, Month = thisMonth.Month, Year = thisMonth.Year
                }));
                right = ProtectedPanel.Add(new MonthCalendar(new MonthCalendarOptions()
                {
                    CustomizeContent = Options.CustomizeContent, MinMonth = Options.MinMonth, MaxMonth = Options.MaxMonth, AdvanceMonthBackwardKey = null, AdvanceMonthForwardKey = null, TodayHighlightColor = Options.TodayHighlightColor, Month = nextMonth.Month, Year = nextMonth.Year
                }));
            }

            left.Bounds   = leftDest;
            center.Bounds = centerDest;
            right.Bounds  = rightDest;
        }
Ejemplo n.º 4
0
        public void ShowContextMenu(string id, Point screenLocation)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            if (CloseOpenContextMenu(id))
            {
                return;
            }

            ILifetime <ContextMenuPresenter, IPresenterMetadata> presenter = CreatePresenter <ContextMenuPresenter>(id);

            presenter.Instance.Closed += (sender, e) =>
            {
                _openContextMenus.Remove(presenter);
                presenter.Dispose();
            };

            _openContextMenus.Add(presenter);
            presenter.Instance.Bind();
            presenter.Instance.Show(screenLocation);
        }
Ejemplo n.º 5
0
 // Disposes the instance of the Singleton lifetime
 public void Dispose() => _baseLifetime.Dispose();
Ejemplo n.º 6
0
 // Disposes the instance of the Singleton lifetime
 public void Dispose() => _baseSingletonLifetime.Dispose();