public override void Dispose()
 {
     if (_lifetime != null)
     {
         _lifetime.Dispose();
         _lifetime = null;
     }
 }
        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();
        }
Example #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;
        }
        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);
        }
Example #5
0
 // Disposes the instance of the Singleton lifetime
 public void Dispose() => _baseLifetime.Dispose();
Example #6
0
 // Disposes the instance of the Singleton lifetime
 public void Dispose() => _baseSingletonLifetime.Dispose();