Exemplo n.º 1
0
        static void Main()
        {
#if NO
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
#endif
            if (IsDevelopMode() == false)
                PrepareCatchException();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            _mainForm = new MainForm();
            Application.Run(_mainForm);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化 OperHistory 对象
        /// 初始化过程中,要编译出纳打印方案脚本代码,使它处于就绪状态
        /// </summary>
        /// <param name="main_form">框架窗口</param>
        /// <param name="webbrowser">用于显示操作历史信息的 IE 浏览器控件</param>
        /// <param name="strError">出错信息</param>
        /// <returns>-1: 出错,错误信息在 strError中;0: 成功</returns>
        public int Initial(MainForm main_form,
            WebBrowser webbrowser,
            out string strError)
        {
            //int nRet = 0;
            strError = "";

            this.MainForm = main_form;

            this.WebBrowser = webbrowser;

            // string strCssUrl = this.MainForm.LibraryServerDir + "/history.css";
            string strCssUrl = PathUtil.MergePath(this.MainForm.DataDir, "/history.css");

            string strLink = "<link href='" + strCssUrl + "' type='text/css' rel='stylesheet' />";

            string strJs = "";

            Global.WriteHtml(this.WebBrowser,
                "<html><head>" + strLink + strJs + "</head><body>");
            return 0;
        }
Exemplo n.º 3
0
        private void ZSearchForm_Load(object sender, EventArgs e)
        {
            if (this.MainForm != null)
            {
                GuiUtil.SetControlFont(this, this.MainForm.DefaultFont);
            }

            this.ZConnections.IZSearchForm = this;

            this.BinDir = Environment.CurrentDirectory;

            /*
            Stop = new DigitalPlatform.Stop();
            Stop.Register(MainForm.stopManager);	// 和容器关联
             * */

            string strWidths = this.MainForm.AppInfo.GetString(
"zsearchform",
"record_list_column_width",
"");
            if (String.IsNullOrEmpty(strWidths) == false)
            {
                ListViewUtil.SetColumnHeaderWidth(this.listView_browse,
                    strWidths,
                    true);
            }
            string[] fromlist = this.MainForm.GetFromList();

            for (int i = 0; i < 4; i++)
            {
                this.queryControl1.AddLine(fromlist);
            }

            int nRet = 0;
            string strError = "";
            nRet = this.zTargetControl1.Load(Path.Combine(MainForm.UserDir, "zserver.xml"),
                out strError);
            if (nRet == -1)
                MessageBox.Show(this, strError);

            this.zTargetControl1.Marc8Encoding = this.MainForm.Marc8Encoding;

            this.zTargetControl1.MainForm = this.MainForm;  // 2007/12/16

            //// this.ZChannel.CommIdle += new CommIdleEventHandle(ZChannel_CommIdle);
            this.zTargetControl1.AllowCheckbox = false;


            // 恢复上次留下的检索式
            string strContentsXml = MainForm.AppInfo.GetString(
                "zsearchform",
                "query_contents",
                "");
            /*
            if (String.IsNullOrEmpty(strContentXml) == false)
                this.queryControl1.SetContent(strContentXml);
             * */
            this.ZConnections.SetAllQueryXml(strContentsXml,
                this.zTargetControl1);

            // 选定上次选定的树节点
            string strLastTargetPath = MainForm.AppInfo.GetString(
                "zsearchform",
                "last_targetpath",
                "");
            if (String.IsNullOrEmpty(strLastTargetPath) == false)
            {
                TreeViewUtil.SelectTreeNode(this.zTargetControl1,
                    strLastTargetPath,
                    '\\');
            }

            API.PostMessage(this.Handle, WM_LOADSIZE, 0, 0);
        }