Exemplo n.º 1
0
 public void Initialize()
 {
     _regionViewRegistry.RegisterViewWithRegion(
         UnityNameTool.ConvertRegionName(Constant.MENU_PANE),
         () => _container.Resolve <IView>(UnityNameTool.ConvertViewName(Constant.MENU_PANE)));
     _regionViewRegistry.RegisterViewWithRegion(
         UnityNameTool.ConvertRegionName(Constant.INFO_PANE),
         () => _container.Resolve <IView>(UnityNameTool.ConvertViewName(Constant.INFO_PANE)));
     _regionViewRegistry.RegisterViewWithRegion(
         UnityNameTool.ConvertRegionName(Constant.DISPLAY_PANE),
         () => _container.Resolve <IView>(UnityNameTool.ConvertViewName(Constant.DISPLAY_PANE)));
     _regionViewRegistry.RegisterViewWithRegion(
         UnityNameTool.ConvertRegionName(Constant.MESSAGE_PANE),
         () => _container.Resolve <IView>(UnityNameTool.ConvertViewName(Constant.MESSAGE_PANE)));
     _regionViewRegistry.RegisterViewWithRegion(
         UnityNameTool.ConvertRegionName(Constant.IMAGE_CONTROL),
         () => _container.Resolve <IView>(UnityNameTool.ConvertViewName(Constant.IMAGE_CONTROL)));
     _regionViewRegistry.RegisterViewWithRegion(
         UnityNameTool.ConvertRegionName(Constant.GRAB_PANE),
         () => _container.Resolve <IView>(UnityNameTool.ConvertViewName(Constant.GRAB_PANE)));
     _regionViewRegistry.RegisterViewWithRegion(
         UnityNameTool.ConvertRegionName(Constant.DRAWING_PANE),
         () => _container.Resolve <IView>(UnityNameTool.ConvertViewName(Constant.DRAWING_PANE)));
     _regionViewRegistry.RegisterViewWithRegion(
         UnityNameTool.ConvertRegionName(Constant.SPECLIST_PANE),
         () => _container.Resolve <IView>(UnityNameTool.ConvertViewName(Constant.SPECLIST_PANE)));
 }
Exemplo n.º 2
0
        public bool?OpenResultWindow(IInspectedResult inspectedResult)
        {
            var resultWindowviewModel =
                _container.Resolve <IResultWindowViewModel>(UnityNameTool.ConvertViewModelName(Constant.RESULT_WINDOW));

            resultWindowviewModel.InspectedResult = inspectedResult;

            bool?result = OpenWindowEvent(this, UnityNameTool.ConvertViewName(Constant.RESULT_WINDOW), resultWindowviewModel);

            return(result);
        }
Exemplo n.º 3
0
        private void ShapeControllerList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            Controls.Clear();

            foreach (EditableShapeController controller in _selectedController.ShapeControllerList)
            {
                UserControl newControl = _container.Resolve <UserControl>(UnityNameTool.ConvertViewName(controller.Name));
                newControl.DataContext = controller;

                Controls.Add(newControl);
            }
        }
Exemplo n.º 4
0
        public bool?OpenLoginWindow()
        {
            var loginWindowviewModel =
                _container.Resolve <LoginWindowViewModel>(UnityNameTool.ConvertViewModelName(Constant.LOGIN_WINDOW));

            loginWindowviewModel.AccountInfoMap = AccountInfoMap;

            bool?result = OpenWindowEvent(this, UnityNameTool.ConvertViewName(Constant.LOGIN_WINDOW), loginWindowviewModel);

            if (result == true)
            {
                CurrentAccount = loginWindowviewModel.ConfirmedAccount;
            }

            return(result);
        }
Exemplo n.º 5
0
        private bool BuildContainer(IUnityContainer container)
        {
            bool isResult = false;

            try
            {
                // 메인뷰.
                container.RegisterType <IView, MainWindow>(UnityNameTool.ConvertViewName(Constant.MAIN_WINDOW));
                container.RegisterType <IMainWindowViewModel, MainWindowViewModel>(UnityNameTool.ConvertViewModelName(Constant.MAIN_WINDOW));

                // 메뉴뷰.
                container.RegisterType <IView, MenuView>(UnityNameTool.ConvertViewName(Constant.MENU_PANE));
                container.RegisterType <IMenuViewModel, MenuViewModel>(UnityNameTool.ConvertViewModelName(Constant.MENU_PANE));

                // 메인뷰.
                container.RegisterType <IView, DisplayView>(UnityNameTool.ConvertViewName(Constant.DISPLAY_PANE));
                container.RegisterType <IDisplayViewModel, DisplayViewModel>(UnityNameTool.ConvertViewModelName(Constant.DISPLAY_PANE));

                // 로그뷰.
                container.RegisterType <IView, MessageView>(UnityNameTool.ConvertViewName(Constant.MESSAGE_PANE));
                container.RegisterType <IMessageViewModel, MessageViewModel>(UnityNameTool.ConvertViewModelName(Constant.MESSAGE_PANE));

                // 정보뷰.
                container.RegisterType <IView, InfoView>(UnityNameTool.ConvertViewName(Constant.INFO_PANE));
                container.RegisterType <IInfoViewModel, InfoViewModel>(UnityNameTool.ConvertViewModelName(Constant.INFO_PANE));

                // 그랩뷰.
                container.RegisterType <IView, GrabView>(UnityNameTool.ConvertViewName(Constant.GRAB_PANE));
                container.RegisterType <IGrabViewModel, GrabViewModel>(UnityNameTool.ConvertViewModelName(Constant.GRAB_PANE));

                // 드로잉뷰.
                container.RegisterType <IView, DrawingView>(UnityNameTool.ConvertViewName(Constant.DRAWING_PANE));
                container.RegisterType <IDrawingViewModel, DrawingViewModel>(UnityNameTool.ConvertViewModelName(Constant.DRAWING_PANE));

                // 스펙뷰.
                container.RegisterType <IView, SpecListView>(UnityNameTool.ConvertViewName(Constant.SPECLIST_PANE));
                container.RegisterType <ISpecListViewModel, SpecListViewModel>(UnityNameTool.ConvertViewModelName(Constant.SPECLIST_PANE));

                // 로그인 윈도우.
                container.RegisterType <IWindow, LoginWindow>(UnityNameTool.ConvertViewName(Constant.LOGIN_WINDOW));
                container.RegisterType <ILoginWindowViewModel, LoginWindowViewModel>(UnityNameTool.ConvertViewModelName(Constant.LOGIN_WINDOW));

                // 결과 윈도우.
                container.RegisterType <IWindow, ResultWindow>(UnityNameTool.ConvertViewName(Constant.RESULT_WINDOW));
                container.RegisterType <IResultWindowViewModel, ResultWindowViewModel>(UnityNameTool.ConvertViewModelName(Constant.RESULT_WINDOW));

                container.RegisterType <IView, ImageView>(UnityNameTool.ConvertViewName(Constant.IMAGE_CONTROL));

                // 모양.
                container.RegisterType <UserControl, RoundingRectView>(Constant.ROUNDING_RECT_SHAPE);
                container.RegisterType <EditableShape, EditableRoundingRect>(Constant.ROUNDING_RECT_SHAPE);

                // 그랩 정보..
                container.RegisterType <UserControl, GrabInfoView>();
                container.RegisterType <BindableBase, GrabInfoViewModel>();
                container.RegisterType <IGrabImage, GrabImage>();

                // 그래버.
                container.RegisterType <IGrabber, FileGrabber>("File");

                // 파라미터.
                container.RegisterType <IParameter, Parameter>();

                // 검사 결과.
                container.RegisterType <IResultObject, ResultObject>();
                container.RegisterType <IInspectedResult, InspectedResult>();

                // 드로잉.
                container.RegisterType <IDrawing, AlignDrawing>("Align");
                container.RegisterType <IDrawing, BondDrawing>("Bond");

                // 메세지.
                container.RegisterType <IMessageInfo, MessageInfo>();

                string name = "Align";
                container.RegisterType <IAlgorithm, AlignAlgorithm>(name);
                container.RegisterType <ISpec, AlignSpec>(name);
                container.RegisterType <UserControl, AlignSpecView>(name);

                name = "Bond";
                container.RegisterType <IAlgorithm, BondAlgorithm>(name);
                container.RegisterType <ISpec, BondSpec>(name);
                container.RegisterType <UserControl, BondSpecView>(name);

                isResult = true;
            }
            catch (Exception ex)
            {
                // exception.
            }

            return(isResult);
        }