void InitAfterLoad(IBaseView previousView, IBaseView currentView, IBaseView nextView)
 {
     currentView.ActionAfterLoad = () =>
     {
         OnAfterLoad(previousView, currentView, nextView);
     };
 }
Exemplo n.º 2
0
        /// <summary>
        /// Tworzy widok CarProductList.
        /// </summary>
        /// <param name="parentView">Widok nadrzędny.</param>
        public CarProductList(IBaseView parentView)
            : base(parentView)
        {
            InitializeComponent();
            AfterInitializeComponent();
            SupportsShowSubElements = false;

            if (!VSDesignMode)
            {
                this.Presenter = new CarProductListPresenter(this);

                this.SupportsShowDetails = false;
                this.SupportsDelete      = false;
                this.SupportsAddNew      = false;
                this.SupportsEdit        = false;

                this.TopMost = true;
            }


            if (parentView != null)
            {
                FactoryList factory = new FactoryList();
                if (parentView.GetType() == factory.GetType())
                {
                    factory = (FactoryList)parentView;
                    this.SetViewForOneFactoryMode(factory.CurrentFactory);
                }
            }
        }
 private void InitMoveFocusAction(IBaseView currentView, IBaseView nextView)
 {
     currentView.ActionMoveFocusToNextView = () =>
     {
         OnMoveFocus(currentView, nextView);
     };
 }
Exemplo n.º 4
0
    /**
     * 根据唯一标识获取一个UI对象
     * @param key
     * @returns {any}
     */
    public IBaseView getView(int key)
    {
        IBaseView view = null;

        this._views.TryGetValue(key, out view);
        return(view);
    }
Exemplo n.º 5
0
    /**
     * 关闭面板
     * @param key 面板唯一标识
     * @param param 参数
     *
     */
    public void close(int key, params object[] param)
    {
        if (!this.isShow(key))
        {
            return;
        }

        IBaseView view = this.getView(key);

        if (view == null)
        {
            return;
        }

        int viewIndex = this._opens.IndexOf(key);

        if (key >= 0)
        {
            this._opens.RemoveRange(viewIndex, 1);
        }

        this.closeUIPlaySound(key);

        //view.removeFromParent();
        view.close(param);
    }
Exemplo n.º 6
0
        /// <summary>
        /// Tworzy widok CityList.
        /// </summary>
        /// <param name="parentView">Widok nadrzędny.</param>
        public CityList(IBaseView parentView)
            : base(parentView)
        {
            InitializeComponent();
            AfterInitializeComponent();
            SupportsShowSubElements = false;

            if (!VSDesignMode)
            {
                this.Presenter = new CityListPresenter(this);

                this.SupportsShowDetails = true;
                this.SupportsDelete      = true;
                this.SupportsAddNew      = true;
                this.SupportsEdit        = true;
            }

            if (parentView != null)
            {
                CountryList country = new CountryList();
                if (parentView.GetType() == country.GetType())
                {
                    country = (CountryList)parentView;
                    this.SetViewForOneCountryMode(country.CurrentCountry);
                }
            }
        }
Exemplo n.º 7
0
        public bool Show(int panelId)
        {
            IBaseView panel = CreatePanel(panelId);

            Push(panelId);
            return(true);
        }
Exemplo n.º 8
0
        public void AddExteralControl(IBaseView view)
        {
            if ((view.ViewPos == ViewLocation.Center) || (view.ViewPos == ViewLocation.Bottom))
            {
                LayoutDocumentPane docPane = GetControlObject <LayoutDocumentPane>(Enum.GetName(typeof(ViewLocation), view.ViewPos));
                if (docPane == null)
                {
                    docPane = Center;
                }

                LayoutDocument LayoutDoc = new LayoutDocument();
                LayoutDoc.ContentId = view.ViewID;
                LayoutDoc.Title     = view.ViewName;
                LayoutDoc.CanClose  = true;
                LayoutDoc.Closed   += LayoutDoc_Closed;
                LayoutDoc.Content   = view as UserControl;
                docPane.Children.Add(LayoutDoc);
            }
            else
            {
                LayoutAnchorablePane docPane = GetControlObject <LayoutAnchorablePane>(Enum.GetName(typeof(ViewLocation), view.ViewPos));

                LayoutAnchorable LayoutDoc = new LayoutAnchorable();
                LayoutDoc.ContentId = view.ViewID;
                LayoutDoc.Title     = view.ViewName;
                LayoutDoc.CanClose  = true;
                LayoutDoc.Closed   += LayoutDoc_Closed;
                LayoutDoc.Content   = view as UserControl;
                docPane.Children.Add(LayoutDoc);
            }
        }
        public void LoadIncludedPolicyClassesTest()
        {
            var       document = new UnitTestDocument();
            IBaseView view     = null;

            document.MockDocumentProperties = new List <string>();

            var target   = new InsuranceRenewealReportWizardPresenter(document, view);
            var template = new InsuranceRenewalReport
            {
                ClientName       = "client name test",
                ClientCommonName = "client common name test"
            };

            var expected = new InsuranceRenewalReport
            {
                ClientName       = "client name test",
                ClientCommonName = "client common name test"
            };
            IInsuranceRenewalReport actual = target.LoadIncludedPolicyClasses(template);

            Assert.AreEqual(expected.ClientCommonName, actual.ClientCommonName);
            Assert.AreEqual(expected.ClientName, actual.ClientName);
            Assert.AreEqual(expected.CoverPageTitle, actual.CoverPageTitle);
        }
Exemplo n.º 10
0
    /**
     * 置顶界面(界面在打开中才可以置顶)
     */
    public void topView(int key)
    {
        IBaseView view = this.getView(key);

        if (view == null)
        {
            Logger.Log("UI_" + key + "不存在");
            return;
        }

        if (!view.isShow())
        {
            Logger.Log("请先打开" + "UI_" + key);
            return;
        }

        bool boolean = view is BaseEuiView;

        if (boolean)
        {
            //int maxDepth = this._viewParent.transform.childCount;
            //this._viewParent.setChildIndex(view as BaseEuiView, maxDepth);
        }
        else
        {
            Logger.Log("view type error");
        }
    }
Exemplo n.º 11
0
        /// <summary>
        /// Tworzy widok CarServicesCarList.
        /// </summary>
        /// <param name="parentView">Widok nadrzędny.</param>
        public CarServicesCarList(IBaseView parentView)
            : base(parentView)
        {
            InitializeComponent();
            AfterInitializeComponent();

            if (!VSDesignMode)
            {
                if (parentView != null)
                {
                    CarServiceDetails carServiceDetails = new CarServiceDetails();
                    if (parentView.GetType() == carServiceDetails.GetType())
                    {
                        this.CarService = (CarService)parentView.CurrentObject;
                    }
                }

                this.Presenter = new CarServicesCarListPresenter(this);

                this.SupportsShowDetails = false;
                this.SupportsDelete      = false;
                this.SupportsAddNew      = false;
                this.SupportsEdit        = false;
            }
        }
Exemplo n.º 12
0
 public BaseRectangle(IBaseView owningView)
 {
     if (owningView == null)
     {
         throw new ArgumentNullException("owningView", "Owning view cannot be null in this constructor.");
     }
     OwningView = owningView;
 }
Exemplo n.º 13
0
        protected virtual void OnMoveFocus(IBaseView currentView, IBaseView nextView)
        {
            Logger.Instance.Debug("BaseComplexView OnMoveFocus " + currentView.GetType().Name, Logger.Categories.UI);
            var nextDataGrid = nextView.GridView.dataGrid;

            nextDataGrid.FocusCell(
                nextDataGrid.Items.Count - 1,
                nextDataGrid.FindFirstEditableColumn());
        }
Exemplo n.º 14
0
        public void CloseView(string viewName)
        {
            IBaseView view = null;

            if (m_views.TryGetValue(viewName, out view))
            {
                view.Close();
            }
        }
Exemplo n.º 15
0
        public static void AddView(IBaseView view)
        {
            string viewName = view.ViewName.ToString();

            if (!m_views.ContainsKey(viewName))
            {
                m_views.Add(viewName, view);
            }
        }
Exemplo n.º 16
0
        public virtual void InitializeView(IBaseView view)
        {
            if ((object)view == null)
            {
                throw new ArgumentNullException("view");
            }

            this.View = view;
        }
Exemplo n.º 17
0
        public override sealed void InitializeView(IBaseView view)
        {
            if ((object)view == null)
            {
                throw new ArgumentNullException("view");
            }

            base.InitializeView(view);
        }
Exemplo n.º 18
0
        protected virtual void OnMoveFocus(IBaseView currentView, IBaseView nextView)
        {
            _logger.LogDebug("BaseComplexView OnMoveFocus {0}", currentView.GetType().Name);
            var nextDataGrid = nextView.GridView.dataGrid;

            nextDataGrid.FocusCell(
                nextDataGrid.Items.Count - 1,
                nextDataGrid.FindFirstEditableColumn());
        }
Exemplo n.º 19
0
 public Mediator(string mediatorName, IBaseView view)
 {
     this.m_mediatorName = (mediatorName != null) ? mediatorName : "Mediator";
     if (null == view)
     {
         throw new Exception(string.Format("The {0}'s view is null.", m_mediatorName));
     }
     this.View          = view;
     this.View.Mediator = this;
 }
        protected override void OnMoveFocus(IBaseView currentView, IBaseView nextView)
        {
            if (currentView is TChuyenHangDonHangView)
            {
                System.Windows.Input.Keyboard.Focus(nextView.GridView.dataGrid);
                return;
            }

            base.OnMoveFocus(currentView, nextView);
        }
        public void CheckNameTest()
        {
            var          document = new UnitTestDocument();
            IBaseView    view     = null;
            var          target   = new InsuranceRenewealReportWizardPresenter(document, view);
            const string name     = "Unit Test";
            bool         actual   = target.CheckName(name);

            Assert.AreEqual(true, actual);
        }
Exemplo n.º 22
0
 /// <summary>
 /// Detaches this presenter from the view.
 /// </summary>
 public virtual void DetachView()
 {
     if (View == null)
     {
         return;
     }
     Template.UnmountAttachedScalarBindings();
     View.Presenter = null;
     View           = null;
 }
Exemplo n.º 23
0
 private void setViewLoading(IBaseView view, string[] resources, params object[] param)
 {
     //view.setResources(resources);
     //App.EasyLoading.showLoading();
     //view.loadResource(function() {
     //    view.preloadTrue(true);
     //    this.setViewOpen(view, param);
     //    App.EasyLoading.hideLoading();
     //}.bind(this),null);
 }
Exemplo n.º 24
0
        /// <summary>
        /// Tworzy widok CountryDetails.
        /// </summary>
        /// <param name="parentView">Widok nadrzędny.</param>
        public CountryDetails(IBaseView parentView)
            : base(parentView)
        {
            InitializeComponent();
            AfterInitializeComponent();

            if (!VSDesignMode)
            {
                this.Presenter = new CountryDetailsPresenter(this);
            }
        }
Exemplo n.º 25
0
 /**
  * 关闭面板
  * @param view
  * @param param
  */
 public void closeView(IBaseView view, params object[] param)
 {
     foreach (var item in this._views)
     {
         if (item.Value == view)
         {
             this.close(item.Key, param);
             return;
         }
     }
 }
Exemplo n.º 26
0
        public void TryAddView(IBaseView view)
        {
            //TODO: make this work.
            //if (view.IsModal == false) {
            //    if (views.Count >= 2) {
            //        views.Pop();
            //    }
            //}

            views.Push(view);
        }
Exemplo n.º 27
0
 private void setViewOpen(IBaseView view, params object[] param)
 {
     if (!view.isInit())
     {
         view.initUI();
     }
     view.initData();
     view.addToParent();
     view.setVisible(true);
     view.open(param);
 }
Exemplo n.º 28
0
        protected bool DispatchPresentationEvent(IBaseView targetView, Uri controllerActionUri, object controllerActionContext, out IEnumerable <object> controllerActionResult)
        {
            MethodInfo[] methodInfos;
            DispatchActionUriAttribute dispatchActionUriAttribute;
            Uri                     tempUri;
            object                  retval;
            List <object>           controllerActionResults;
            IDispatchTargetProvider dispatchTargetProvider;
            object                  dispatchTarget;

            if ((object)controllerActionUri == null)
            {
                throw new ArgumentNullException("controllerActionUri");
            }

            if ((object)targetView == null)
            {
                throw new ArgumentNullException("targetView");
            }

            controllerActionResults = new List <object>();

            dispatchTarget         = null;
            dispatchTargetProvider = targetView as IDispatchTargetProvider;

            if ((object)dispatchTargetProvider != null)
            {
                dispatchTarget = dispatchTargetProvider.Target;
            }

            if ((object)dispatchTarget != null)
            {
                methodInfos = dispatchTarget.GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance);

                if ((object)methodInfos != null)
                {
                    foreach (MethodInfo methodInfo in methodInfos)
                    {
                        dispatchActionUriAttribute = ReflectionFascade.Instance.GetOneAttribute <DispatchActionUriAttribute>(methodInfo);

                        if ((object)dispatchActionUriAttribute != null &&
                            Uri.TryCreate(dispatchActionUriAttribute.Uri, UriKind.Absolute, out tempUri) &&
                            tempUri == controllerActionUri)
                        {
                            retval = methodInfo.Invoke(dispatchTarget, new object[] { /* the view of the controller raising event */ this.View, controllerActionContext });
                            controllerActionResults.Add(retval);
                        }
                    }
                }
            }

            controllerActionResult = controllerActionResults.ToArray();
            return(controllerActionResults.Count < 1);
        }
Exemplo n.º 29
0
        public void TryAddView(IBaseView view) {

            //TODO: make this work.
            //if (view.IsModal == false) {
            //    if (views.Count >= 2) {
            //        views.Pop();
            //    }
            //}

            views.Push(view);
        }
Exemplo n.º 30
0
        internal void AttachView(IBaseView value)
        {
            if (View != null)
            {
                DetachView();
            }

            Debug.Assert(View == null && value != null);
            View           = value;
            View.Presenter = this;
        }
Exemplo n.º 31
0
        CribbageView GetCribbageView()
        {
            if (_frame.Content == null)
            {
                return(null);
            }

            IBaseView baseView = _frame.Content as IBaseView;

            return(baseView.GetCommonView());
        }
Exemplo n.º 32
0
        private ReportService(IBaseView view, BarButtonItem bbiReport, string reportIds)
        {
            if (bbiReport == null)
                throw new ArgumentNullException("bbiReport");

            if (reportIds.IsEmpty())
                throw new ArgumentNullException("reportIds");

            this.view = view;
            this.bbiReport = bbiReport;
            this.reportIds = reportIds;
        }
Exemplo n.º 33
0
 //Declararation of all variables, vectors and haarcascades
 public AdminFormPresenter(IBaseView view)
     : base(view)
 {
     if (view is IAdminView)
     {
         this.AdminView = (view as IAdminView);
         this.AdminView.Init += new EventHandler<EventArgs>(AdminView_Init);
     }
     else
     {
         new Exception("Это не наша форма!");
     }
 }
Exemplo n.º 34
0
        public MainFormPresenter(IBaseView view)
            : base(view)
        {
            (this.View as IMainView).OnChangeCamDevice += MainFormPresenter_OnChangeCamDevice;
            (this.View as IMainView).OnStartOrStopClick += MainFormPresenter_OnStartOrStopClick;
            (this.View as IMainView).OnAdminClick += new EventHandler<EventArgs>(MainFormPresenter_OnAdminClick);
            (this.View as IMainView).OnTimerTick += new EventHandler<EventArgs>(MainFormPresenter_OnTimerTick);
            (this.View as IMainView).OnBlinkTimerTick += new EventHandler<EventArgs>(MainFormPresenter_OnBlinkTimerTick);

            //     timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
            //    timer.Start();
            System.Windows.Forms.Application.Idle += new EventHandler(Application_Idle);
            //AppGlobalContext.GetInstance().CamHelper.OnNewFrame += CamHelper_OnNewFrame;
        }
Exemplo n.º 35
0
        public override void PushDialogView(MobileDialogPresentationType presentationType, string viewTitle, IBaseView sourceView, IBaseView view)
        {
            Activity activity = null;
            var fragment = sourceView as Fragment;
            if (fragment != null)
            {
                activity = fragment.Activity;
            }
            else
            {
                activity = sourceView as Activity;
            }

            if (activity != null)
            {
                var dialogFragment = (DialogFragment) view;
                dialogFragment.Show(activity.FragmentManager, viewTitle);
            }
        }
Exemplo n.º 36
0
 public override void CreateMarkerDetailsView(IBaseView sourceView, Guid markerId)
 {
     var activity = GetActivityFromView(sourceView);
     var intent = new Intent(activity, typeof(MarkerDetailsActivity));
     intent.PutExtra("sourceActivity", activity.GetType().FullName);
     intent.PutExtra("markerId", markerId.ToString());
     activity.StartActivity(intent);
 }
Exemplo n.º 37
0
 public override void CreateEqualizerPresetDetailsView(IBaseView sourceView, Guid presetId)
 {
     var activity = GetActivityFromView(sourceView);
     var intent = new Intent(activity, typeof(EqualizerPresetDetailsActivity));
     intent.PutExtra("sourceActivity", activity.GetType().FullName);
     intent.PutExtra("presetId", presetId.ToString());
     activity.StartActivity(intent);
 }
Exemplo n.º 38
0
 public override void CreateEqualizerPresetsView(IBaseView sourceView)
 {
     var activity = GetActivityFromView(sourceView);
     StartActivity(activity, typeof(EqualizerPresetsActivity));
 }
Exemplo n.º 39
0
        public virtual void CreateEqualizerPresetsView(IBaseView sourceView)
        {
            if(_equalizerPresetsView == null)
                _equalizerPresetsView = Bootstrapper.GetContainer().Resolve<IEqualizerPresetsView>();

            PushDialogView(MobileDialogPresentationType.Standard, "Equalizer Presets", null, _equalizerPresetsView);
        }
Exemplo n.º 40
0
 public BaseViewImplementer(IBaseView view = null) {
     this.View = view;
     baseView = (BaseView)view;
 }
Exemplo n.º 41
0
 private Activity GetActivityFromView(IBaseView view)
 {
     if (view is Activity)
         return (Activity)view;
     else if (view is Fragment)
         return ((Fragment) view).Activity;
     else
         return null;
 }
Exemplo n.º 42
0
 public override void PushDialogSubview(MobileDialogPresentationType presentationType, string parentViewTitle, IBaseView view)
 {
     AppDelegate.PushDialogSubview(presentationType, parentViewTitle, (UIViewController)view);
 }
Exemplo n.º 43
0
 public virtual void CreateMarkerDetailsView(IBaseView sourceView, Guid markerId)
 {
     if (_markerDetailsView == null)
         _markerDetailsView = Bootstrapper.GetContainer().Resolve<IMarkerDetailsView>(new NamedParameterOverloads() { { "markerId", markerId } });
 }
Exemplo n.º 44
0
        public virtual void CreatePlaylistView(IBaseView sourceView)
        {
            if (_playlistView == null)
                _playlistView = Bootstrapper.GetContainer().Resolve<IPlaylistView>();

            PushDialogView(MobileDialogPresentationType.Standard, "Playlist", null, _playlistView);
        }
Exemplo n.º 45
0
        public virtual void CreateEqualizerPresetDetailsView(IBaseView sourceView, Guid presetId)
        {
            if (_equalizerPresetDetailsView == null)
                _equalizerPresetDetailsView = Bootstrapper.GetContainer().Resolve<IEqualizerPresetDetailsView>(new NamedParameterOverloads() { { "presetId", presetId } });

            PushDialogSubview(MobileDialogPresentationType.Standard, "Equalizer Presets", _equalizerPresetDetailsView);
        }
Exemplo n.º 46
0
 public virtual void BindEqualizerPresetDetailsView(IBaseView sourceView, IEqualizerPresetDetailsView view, Guid presetId)
 {
     _equalizerPresetDetailsView = view;
     _equalizerPresetDetailsView.OnViewDestroy = (view2) =>
     {
         _equalizerPresetDetailsPresenter.ViewDestroyed();
         _equalizerPresetDetailsPresenter = null;
         _equalizerPresetDetailsView = null;
     };
     _equalizerPresetDetailsPresenter = Bootstrapper.GetContainer().Resolve<IEqualizerPresetDetailsPresenter>(new NamedParameterOverloads(){{"presetId", presetId}});
     _equalizerPresetDetailsPresenter.BindView(view);
 }
Exemplo n.º 47
0
 public abstract void PushTabView(MobileNavigationTabType type, IBaseView view);
Exemplo n.º 48
0
 public virtual void BindPlaylistView(IBaseView sourceView, IPlaylistView view)
 {
     _playlistView = view;
     _playlistView.OnViewDestroy = (view2) =>
     {
         _playlistPresenter.ViewDestroyed();
         _playlistPresenter = null;
         _playlistView = null;
     };
     _playlistPresenter = Bootstrapper.GetContainer().Resolve<IPlaylistPresenter>();
     _playlistPresenter.BindView(view);
 }
Exemplo n.º 49
0
 public override void CreatePlaylistView(IBaseView sourceView)
 {
     var activity = GetActivityFromView(sourceView);
     StartActivity(activity, typeof(PlaylistActivity));
 }
Exemplo n.º 50
0
 public void PushSubView(IBaseView view)
 {
 }
Exemplo n.º 51
0
 public override void PushTabView(MobileNavigationTabType type, IBaseView view)
 {
     // Not used on Android
 }
Exemplo n.º 52
0
        public void AddTab(MobileNavigationTabType type, string title, MobileLibraryBrowserType browserType, LibraryQuery query, IBaseView view)
        {
            Console.WriteLine("MainActivity - Adding tab {0}", title);

            //_tabHistory.Add(new Tuple<MobileNavigationTabType, List<Tuple<MobileLibraryBrowserType, LibraryQuery>>>(type, new List<Tuple<MobileLibraryBrowserType, LibraryQuery>>() {
            //   new Tuple<MobileLibraryBrowserType, LibraryQuery>(browserType, query)
            //}));

            _fragment = (Fragment)view;
            FragmentTransaction transaction = FragmentManager.BeginTransaction();
            transaction.Replace(Resource.Id.main_fragmentContainer, _fragment);
            transaction.Commit();
        }
Exemplo n.º 53
0
 public override void PushDialogSubview(MobileDialogPresentationType presentationType, string parentViewTitle, IBaseView view)
 {
     // Not used on Android
     //PushDialogView(presentationType, string.Empty, null, view);
 }
Exemplo n.º 54
0
 public abstract void PushDialogView(MobileDialogPresentationType presentationType, string viewTitle, IBaseView sourceView, IBaseView view);
Exemplo n.º 55
0
 public override void PushTabView(MobileNavigationTabType type, IBaseView view)
 {
     AppDelegate.PushTabView(type, (UIViewController)view);
 }
Exemplo n.º 56
0
        public void PushSubView(IBaseView view)
        {
            Console.WriteLine("PlayerActivity - PushSubView view: {0}", view.GetType().FullName);
            _fragments.Add((Fragment)view);

            if (_viewPagerAdapter != null)
                _viewPagerAdapter.NotifyDataSetChanged();
        }
Exemplo n.º 57
0
 public void AddSubview(IBaseView view) {
     throw new NotImplementedException();
 }
Exemplo n.º 58
0
 public abstract void PushDialogSubview(MobileDialogPresentationType presentationType, string parentViewTitle, IBaseView view);
Exemplo n.º 59
0
 public virtual void BindEqualizerPresetsView(IBaseView sourceView, IEqualizerPresetsView view)
 {
     _equalizerPresetsView = view;
     _equalizerPresetsView.OnViewDestroy = (view2) =>
     {
         _equalizerPresetsPresenter.ViewDestroyed();
         _equalizerPresetsPresenter = null;
         _equalizerPresetsView = null;
     };
     _equalizerPresetsPresenter = Bootstrapper.GetContainer().Resolve<IEqualizerPresetsPresenter>();
     _equalizerPresetsPresenter.BindView(view);
 }
Exemplo n.º 60
0
 public AlertFormPresenter(IBaseView view)
     : base(view)
 {
 }