Пример #1
0
        public MDIForm(LogInForm loginForm)
        {
            mSelf = this;

            mLoginForm = loginForm;
            InitializeComponent();

            this.Text += " - " + HTTPAgent.Username;
        }
Пример #2
0
        private void ExecuteTask()
        {
            if (mTaskStack.Count == 0)
            {
                if (HTTPAgent.IsAdmin)
                {
                    AdminForm adminForm = new AdminForm(mLogInForm);
                    adminForm.Show();
                }
                else
                {
                    MDIForm mdiForm = new MDIForm(mLogInForm);
                    mdiForm.Show();
                }

                Close();
            }
            else
            {
                Task curTask = mTaskStack.Pop();
                switch (curTask.mType)
                {
                    case TaskType.getRegion:
                        UpdateProgress("Get Region ...");
                        HTTPAgent.instance().getGlobalRegion(this);
                        break;

                    case TaskType.getTasks:
                        UpdateProgress("Get Tasks ...");
                        HTTPAgent.instance().getTasks(this);
                        break;

                    case TaskType.getUsers:
                        UpdateProgress("Get Users ...");
                        HTTPAgent.instance().getUsers(this);
                        break;

                    case TaskType.getSites:
                        UpdateProgress("Get Site ...");
                        HTTPAgent.instance().getSites(this);
                        break;

                    case TaskType.getFileList:
                        switch(curTask.mFileType)
                        {
                            case HTTPAgent.FileType.channelSetting:
                                UpdateProgress("Get Channel Setting file list ...");
                                break;

                            case HTTPAgent.FileType.colorSetting:
                                UpdateProgress("Get Color Setting file list ...");
                                break;

                            case HTTPAgent.FileType.equipmentParameter:
                                UpdateProgress("Get Equipment Parameter file list ...");
                                break;

                            case HTTPAgent.FileType.linkconfiguration:
                                UpdateProgress("Get Link Configuration file list ...");
                                break;

                            case HTTPAgent.FileType.emi:
                                UpdateProgress("Get EMI file list ...");
                                break;
                        }
                        HTTPAgent.instance().getFileList(this, curTask.mFileType);
                        break;

                    case TaskType.getFile:
                        {
                            UpdateProgress("Get file '" + curTask.mFileTitle + "' ...");
                            HTTPAgent.instance().downloadFile(this, curTask.mFileType, curTask.mFileId, curTask.mFileTitle, HTTPAgent.DownloadType.obj, null);
                        }
                        break;
                }
            }
        }