Пример #1
0
        public void Exit()
        {
            Touched         = false;
            ExitInformation = true;

            Animation.Play("DownSlide");

            if (!ApplicationButton.GoogleVirtualReality)
            {
                ApplicationUI.SetActive(true);
            }

            StartCoroutine("DownSlide");

            float TimeCount = 0.0f;

            while (TimeCount <= 5.0f)
            {
                TimeCount += Time.deltaTime;
            }

            ExperimentObject.SetActive(false);

            Time.timeScale = ApplicationButton.TimeDefaultBackup;
        }
Пример #2
0
        public static void Run (ApplicationController controller, ApplicationUI ui)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(GeneralUnhandledExceptionHandler);

            HttpEncoder.Current = HttpEncoder.Default;
            Controller = controller;
            UI = ui;
            
            if (PriorProcess() != null)
            {
                throw new AbortedOperationException("Another instance of the app is already running.");
            }

            Controller.Initialize ();
            UI.Run ();
                 
            #if !__MonoCS__
            // Suppress assertion messages in debug mode
            GC.Collect (GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers ();
            #endif
        }
Пример #3
0
        static void Main(string[] args)
        {
            ApplicationUI ui = new ApplicationUI();

            ui.Run();
        }
Пример #4
0
        /// <summary>
        /// Runs the application
        /// </summary> 
        public void run()
        {
            ApplicationUI applicationUI;
            IExperimentTreePanelUI experimentTreePanelUI;
            ISimulationAnalyserPanelUI simulationAnalyserPanelUI;
            ISimulationEditorPanelUI simulationEditorPanelUI;
            ISpatialConfigurationPanelUI spatialConfigurationPanelUI;
            ICellDefinitionsPanelUI cellDefinitionsPanelUI;
            ITimeSeriesEditorPanelUI timeSeriesEditorPanelUI;
            IAnalyzer3DViewPanelUI analyzer3DViewPanelUI;

            // make controllers
            // construct controller using panel from experiment tree panel ui
            // add (reference to) controller to panel
            // add (reference to) this to controller

            //set application settings
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //create the application UI
            //creates all children panels
            applicationUI = new ApplicationUI();

            //obtain panels from the applicationUI
            experimentTreePanelUI = applicationUI.getExperimentTreePanelUI();
            simulationAnalyserPanelUI = experimentTreePanelUI.getSimulationAnalyserPanelUI();
            simulationEditorPanelUI = experimentTreePanelUI.getSimulationEditorPanelUI();
            spatialConfigurationPanelUI = experimentTreePanelUI.getSpatialConfigurationPanelUI();
            cellDefinitionsPanelUI = experimentTreePanelUI.getCellDefinitionsPanelUI();
            timeSeriesEditorPanelUI = experimentTreePanelUI.getTimeSeriesEditorPanelUI();
            analyzer3DViewPanelUI = experimentTreePanelUI.getSimulationAnalyserPanelUI().getAnalyzer3DViewPanelUI();

            //construct controllers
            experimentTreePanelController = new ExperimentTreePanelController(experimentTreePanelUI);
            simulationAnalyserPanelController = new SimulationAnalyserPanelController(simulationAnalyserPanelUI);
            simulationEditorPanelController = new SimulationEditorPanelController(simulationEditorPanelUI);
            spatialConfigurationPanelController = new SpatialConfigurationPanelController(spatialConfigurationPanelUI);
            cellDefinitionsPanelController = new CellDefinitionsPanelController(cellDefinitionsPanelUI);
            timeSeriesEditorPanelController = new TimeSeriesEditorPanelController(timeSeriesEditorPanelUI);
            analyzer3DViewPanelController = new Analyzer3DViewPanelController(analyzer3DViewPanelUI);

            //set this application controller as the parent of the other controllers
            experimentTreePanelController.setController(this);
            simulationAnalyserPanelController.setController(this);
            simulationEditorPanelController.setController(this);
            spatialConfigurationPanelController.setController(this);
            cellDefinitionsPanelController.setController(this);
            timeSeriesEditorPanelController.setController(this);
            analyzer3DViewPanelController.setController(this);

            //set the controllers for the panel UIs
            applicationUI.setController(this);
            experimentTreePanelUI.setController(experimentTreePanelController);
            simulationAnalyserPanelUI.setController(simulationAnalyserPanelController);
            simulationEditorPanelUI.setController(simulationEditorPanelController);
            spatialConfigurationPanelUI.setController(spatialConfigurationPanelController);
            cellDefinitionsPanelUI.setController(cellDefinitionsPanelController);
            timeSeriesEditorPanelUI.setController(timeSeriesEditorPanelController);
            analyzer3DViewPanelUI.setController(analyzer3DViewPanelController);

            //create a list of open experiments
            openExperiments = new List<Experiment>();//generateHardcodedExperiment();

            //show the list of open experiments
            experimentTreePanelUI.setOpenExperiments(getExperiments());

            //set the currently selected experiment
            //experimentTreePanelUI.setSelectedExperiment(1);

            //set the currently selected simulation
            //experimentTreePanelUI.setSelectedSimulation("sim 2");

            //show simulation view
            experimentTreePanelUI.showSimulationView();

            //create timers
            timer1 = new System.Windows.Forms.Timer();
            timer1.Enabled = true;
            timer1.Interval = 25;
            timer1.Tick += new System.EventHandler(this.timer1_Tick);

            //run the application UI
            Application.Run(applicationUI);
        }
Пример #5
0
        public override string ToString()
        {
            stamps = new List <SingleStamp>();
            IApplicationAction         appaction     = IOCFactory.GetInstance <IApplicationAction>();
            IApplication               application   = IOCFactory.GetInstance <IApplication>();
            ApplicationUI              app           = application.GetpplicationByID(this.applicationId);
            List <ApplicationActionUI> appcationList = appaction.GetApplicationActionByAppID(this.applicationId, action);

            if (appcationList != null && appcationList.Count > 0)
            {
                foreach (var item in appcationList)
                {
                    var actionuser = item.ActionUserName;
                    if (item.Action == (int)ApprovalAction.Create && !string.IsNullOrEmpty(item.AgentToUserName) && item.AgentToUserName != item.ActionUserName)
                    {
                        actionuser = item.AgentToUserName.Trim();
                    }
                    stamps.Add(new SingleStamp()
                    {
                        ImgPath = imgPathBase + GetAppActionPicture((ApprovalAction)item.Action), Line1 = actionuser, Line2 = item.ActionTime.ToString("yyyy-MM-dd"), ToolTips = EnumDataSource <ApprovalAction> .GetDisplayValue(item.Action, "zh-cn")
                    });
                }
                if (action != ApprovalAction.Approve)
                {
                    IAttendance              leave         = IOCFactory.GetInstance <IAttendance>();
                    IApplication             iapplication  = IOCFactory.GetInstance <IApplication>();
                    List <TaskUserExtendUI>  taskListuser  = iapplication.GetApplicationToDoTaskWithUser(this.applicationId);
                    List <TaskGroupExtendUI> taskListgroup = iapplication.GetApplicationToDoTaskWithGroup(this.applicationId);
                    if (app.Status == (int)ApplicationStatus.Pending)
                    {
                        string todouser = string.Empty;
                        if (taskListuser != null && taskListuser.Count > 0)
                        {
                            int length = taskListuser.Count;
                            for (int i = 0; i < length; i++)
                            {
                                todouser = todouser + taskListuser[i].vwEmpBasicInfo.ChineseName + ";";
                            }
                        }
                        if (taskListgroup != null && taskListgroup.Count > 0)
                        {
                            int length = taskListgroup.Count;
                            for (int i = 0; i < length; i++)
                            {
                                todouser = todouser + taskListgroup[i].AuthorizationGroup.NAME + ";";
                            }
                        }
                        todouser = todouser.Trim(';');
                        stamps.Add(new SingleStamp()
                        {
                            ImgPath = imgPathBase + imgPending, Line1 = todouser, Line2 = "", ToolTips = "待处理"
                        });
                    }
                }

                //string CNTitle = "<p>" + Resources.NameResource.Process + "&nbsp;(" + Resources.NameResource.Current + ":";
                //int count = appcationList.Count - 1;
                //string Status = appcationList[count].ActionUserName + " " + EnumDataSource<ApprovalAction>.GetDisplayValue(appcationList[count].Action, "zh-cn");
                //string TotalContent = CNTitle + Status + ")</p>";
                //return TotalContent + base.ToString();

                return(base.ToString());
            }
            else
            {
                return(string.Empty);
            }
        }