Exemplo n.º 1
0
        //TODO make testable constructor

        public CruiseWizardPresenter(CruiseWizardView View, WindowPresenter windowPresenter, IApplicationController applicationController, DAL database)
        {
            this.View             = View;
            WindowPresenter       = windowPresenter;
            ApplicationController = applicationController;
            View.Presenter        = this;
            _database             = database;

            LoadSetupData();  //load tree defaults, product codes, etc.

            LoadCruiseData(); //read data from existing file

            //See if the file contains a template file record
            var templatePath = _database.ReadGlobalValue("CSM", "TemplatePath");

            if (!String.IsNullOrEmpty(templatePath))
            {
                _fileHasTemplate = true;
                _templateFile    = new FileInfo(templatePath);
                View.SetTemplatePathTextBox(templatePath, false);
            }

            if (CuttingUnits.Count == 0)
            {
                CuttingUnits.Add(GetNewCuttingUnit());
            }
        }
        public ImportFromCruiseView(string fileName, WindowPresenter windowPresenter, TemplateEditViewPresenter viewPresenter)
            : this()
        {
            this.WindowPresenter       = windowPresenter;
            this.ApplicationController = viewPresenter.ApplicationController;

            this.CopyFromDB = new DAL(fileName);
        }
        public EditTemplateView(WindowPresenter windowPresenter, TemplateEditViewPresenter viewPresenter)
        {
            this.WindowPresenter = windowPresenter;
            this.ViewPresenter   = viewPresenter;
            ViewPresenter.View   = this;

            //this.UserCommands = new ViewCommand[]{
            //    this.ViewPresenter.ApplicationController.MakeViewCommand("Close File", this.ViewPresenter.WindowPresenter.ShowCruiseLandingLayout),
            //    this.ViewPresenter.ApplicationController.MakeViewCommand("Import From File", this.ViewPresenter.WindowPresenter.ShowImportTemplate)
            //};

            InitializeComponent();
        }
        public DataEditorView(WindowPresenter windowPresenter, IApplicationController applicationController) : this()
        {
            WindowPresenter = windowPresenter;
            ApplicationController = applicationController;

            Text = "Field Data - " + System.IO.Path.GetFileName(applicationController.Database.Path);

            _BS_TreeSpecies.DataSource = applicationController.Database.From<TreeDefaultValueDO>().Read().ToList();

            _BS_TreeSampleGroups.DataSource = applicationController.Database.From<SampleGroupDO>().Read().ToList();
            //ResetViewFilters();
            PopulateData();
            
        }
        public EditDesignView(WindowPresenter windowPresenter, DesignEditorPresentor viewPresenter)
        {
            this.ViewPresenter      = viewPresenter;
            this.ViewPresenter.View = this;

            this.ExceptionHandler = viewPresenter.ApplicationController.ExceptionHandler;
            this.WindowPresenter  = windowPresenter;
            InitializeComponent();
            //win-forms designer keeps removing the these settings so I'm setting them outside InitializeComponent
            secondaryProductDataGridViewTextBoxColumn.DisplayMember = nameof(Core.SetupModels.ProductCode.FriendlyValue);
            secondaryProductDataGridViewTextBoxColumn.ValueMember   = nameof(Core.SetupModels.ProductCode.Code);

            this.SalePurposeComboBox.DataSource = Strings.SALE_PURPOSE;
        }
Exemplo n.º 6
0
        /// <summary>
        /// 単一アプリケーション オブジェクトを初期化します。これは、実行される作成したコードの
        ///最初の行であるため、main() または WinMain() と論理的に等価です。
        /// </summary>
        public App()
        {
            // 事前起動有効化
            CoreApplication.EnablePrelaunch(true);

            // Debug.WriteLine("App.ctor()");
            this.InitializeComponent();
            this.EnteredBackground  += App_EnteredBackground;
            this.LeavingBackground  += App_LeavingBackground;
            this.Resuming           += App_Resuming;
            this.Suspending         += App_Suspending;
            this.UnhandledException += App_UnhandledException;

            WindowPresenter = new WindowPresenter();
        }
Exemplo n.º 7
0
    IObservable <WindowPresenter> BackWindow()
    {
        var newWindow = beforeWindowStack.Pop();

        newWindow.gameObject.SetActive(true);
        var subject = new AsyncSubject <WindowPresenter> ();

        CurrentWindow.OnCloseOut();
        newWindow.OnBeforeCloseIn()
        .SelectMany(_ => newWindow.OnCloseIn())
        .Subscribe(_ => {
        }, () => {
            Destroy(CurrentWindow.gameObject);
            CurrentWindow = newWindow;
            subject.OnNext(newWindow);
            subject.OnCompleted();
        });

        return(subject);
    }
Exemplo n.º 8
0
    public IObservable <T> OpenWindow <T> (string name, Action <T> action = null)
        where T : WindowPresenter
    {
        var openSubject = new AsyncSubject <T> ();
        // 遷移準備
        var previewWindow = CurrentWindow;

        if (previewWindow != null)
        {
            previewWindow.OnOpenOut();

            beforeWindowStack.Push(previewWindow);
            previewWindow.gameObject.SetActive(false);
        }

        // 生成処理
        GameObject obj    = Instantiate(ResourcesManager.Instance.GetWindow(name), windowContainer) as GameObject;
        T          window = obj.GetComponent <T> ();

        CurrentWindow = window;

        window.Initialize()
        .Do(_ => {
            if (action != null)
            {
                action(window);
            }
        })
        .SelectMany(_ => window.OnBeforeOpen())
        .SelectMany(_ => window.OnOpen())
        .Subscribe(_ => {
        }, () => {
            openSubject.OnNext(window);
            openSubject.OnCompleted();
        });

        return(openSubject);
    }
Exemplo n.º 9
0
 protected void InitializeView(WindowPresenter windowPresenter)
 {
     this.WindowPresenter = windowPresenter;
 }
Exemplo n.º 10
0
 private void Greeting(object obj)
 {
     WindowPresenter.Show(GreetingIndex, null, ref Name);
 }
Exemplo n.º 11
0
 private void TopPlayersView(object obj)
 {
     WindowPresenter.Show(TopPlayersIndex, TopPlayersCollection, ref Name);
 }