Esempio n. 1
0
        /// <summary>
        /// 初始化程序
        /// </summary>
        public void Awake()
        {
            var application = new Core.Application(this);

            application.OnFindType((type) => Type.GetType(type));
            application.Bootstrap(Bootstrap.BootStrap).Init();
        }
Esempio n. 2
0
        public static List <RecentProjectModel> getRecentProjects()
        {
            List <ProgrameData.ProjectViewData> recent_projects_fetched = CoreApp.getSingleton().getRecentProjects();
            List <RecentProjectModel>           recent_projects         = new List <RecentProjectModel>();

            foreach (ProgrameData.ProjectViewData recent_project in recent_projects_fetched)
            {
                string             display_name         = string.Format("{0} ({1})", recent_project.name, recent_project.client_name);
                string             path                 = recent_project.path;
                RecentProjectModel recent_project_model = new RecentProjectModel()
                {
                    DisplayName = display_name, Path = path
                };
                recent_projects.Add(recent_project_model);
            }
            return(recent_projects);
        }
Esempio n. 3
0
        public ActionResult Application(ApplicationViewModel ap, HttpPostedFileBase MyFile)
        {
            if (MyFile == null)
            {
                ViewBag.Success = 0;
                return(View(ap));
            }
            if (MyFile.ContentLength > 4194304)
            {
                ViewBag.Success = 100;
                return(View(ap));
            }
            //得到的名字是文件在本地机器的绝对路径
            var strLocalFullPathName = MyFile.FileName;
            //提取出单独的文件名,不需要路径
            var strFileName = Path.GetFileName(ap.CoinName + " -" + strLocalFullPathName);
            //定义服务器的文件夹,用来保存文件
            var strServerFilePath = Server.MapPath("~/docs/");

            //将接收到文件保存在服务器指定上
            MyFile.SaveAs(Path.Combine(strServerFilePath, strFileName));
            if (ModelState.IsValid)
            {
                Application app = new Core.Application();
                app.ApplicantName = ap.ApplicantName;
                app.CoinName      = ap.CoinName;
                app.CompanyName   = ap.CompanyName;
                app.CreateTime    = DateTime.Now;
                app.Email         = ap.Email;
                app.PhoneNum      = ap.PhoneNum;
                app.ReviewTime    = DateTime.Now;
                app.Status        = 0;
                app.FileAddress   = strFileName;
                Response _res = applicationManager.Add(app);
                if (_res.Code == 1)
                {
                    ViewBag.Success = 1;
                }
            }


            return(View(ap));
        }
Esempio n. 4
0
 public CashlinxDesktopLoader(string execFullPath)
 {
     if (string.IsNullOrEmpty(execFullPath))
     {
         return;
     }
     //try
     //{
     this.desktopApp       = Application.Launch(execFullPath);
     this.newDesktopWindow = this.desktopApp.GetWindow("Cashlinx Desktop", InitializeOption.NoCache);
     this.initialized      = true;
     this.factory          = new DictionaryMappedItemFactory();
     //}
     //catch(Exception eX)
     //{
     //this.initialized = false;
     //throw new ApplicationException("CashlinxDesktopLoader ctor threw exception:" + eX.Message, eX);
     //    this.initialized = true;
     //}
 }
        public void createNewProjectWithClient()
        {
            _client_model_i.api.model.id.value = DateTime.Now.Ticks; // TODO: consider change the pk
            _client_model_i.api.update();
            NewProjectViewModel new_project_view_model = NewClient.ProjectManager.NewProject.NewProjectViewModel;

            new_project_view_model.ProjectModelI.SelectedClient = _client_model_i.ClientModel;

            AlertViewViewModel.Button button = new AlertViewViewModel.Button {
                name = "Okay"
            };
            try {
                CoreApp.getSingleton().createNewProject(new_project_view_model.ProjectModelI.ProjectModelApi, new_project_view_model.FolderBrowseCommand.FolderPath);
                CoreApp.getSingleton().setDefaultProjectPath(new_project_view_model.FolderBrowseCommand.FolderPath);
                NewClient.ProjectManager.closeWindow();
            }
            catch (Exception err) {
                Core.Reference.logger.logError(err);
                AlertView alertView = new AlertView("Unknown error", "Unknown error has occured while creating a project. Please try again.", AlertViewType.ERROR, button);
                alertView.ShowDialog();
            }
        }
Esempio n. 6
0
        private void On_CbProcesses_SelectedIndexChanged(object sender, EventArgs e)
        {
            Application curApp = Application.Attach(((Process)cbProcesses.SelectedItem).Id);

            cbWindows.DataSource = new List <Window>(curApp.GetWindows());
        }
Esempio n. 7
0
 public DebugForm(Core.Application app)
 {
     InitializeComponent();
     Application = app;
 }
Esempio n. 8
0
 public DBBrowserForm(Core.Application app)
 {
     InitializeComponent();
     Application = app;
 }
 public CrawlProgressForm(Core.Application app, Action stoppedCallback = null) : this()
 {
     App             = app;
     StoppedCallback = stoppedCallback;
 }
Esempio n. 10
0
 public FolderBrowseCommand()
 {
     FolderPath = CoreApp.getSingleton().programe_data_file.data.default_proj_dir;
 }
Esempio n. 11
0
 public MenuHandler(BrowserForm ownerForm, Core.Application app)
 {
     OwnerForm   = ownerForm;
     Application = app;
 }