Exemple #1
0
        void LoadSize()
        {
            try
            {
                // 获得splitContainer_main的状态
                if (Program.MainForm != null)
                {
                    Program.MainForm.LoadSplitterPos(
                        this.splitContainer_main,
                        "userform_state",
                        "splitContainer_main_ratio");
                }
            }
            catch
            {
            }

            string strWidths = Program.MainForm.AppInfo.GetString(
                "user_form",
                "amerced_list_column_width",
                "");

            if (String.IsNullOrEmpty(strWidths) == false)
            {
                ListViewUtil.SetColumnHeaderWidth(this.listView_users,
                                                  strWidths,
                                                  true);
            }
        }
Exemple #2
0
        private void InputItemBarcodeDialog_Load(object sender, EventArgs e)
        {
            if (this.AppInfo != null)
            {
                string strWidths = this.AppInfo.GetString(
                    "input_item_barcode_dialog",
                    "list_column_width",
                    "");
                if (String.IsNullOrEmpty(strWidths) == false)
                {
                    ListViewUtil.SetColumnHeaderWidth(this.listView_barcodes,
                                                      strWidths,
                                                      true);
                }
            }

            this.m_nOriginDisplayColumnWidth = this.columnHeader_volumeDisplay.Width;

            if (this.SeriesMode == false)
            {
                this.columnHeader_volumeDisplay.Width = 0;
            }

            FillBookItemList();

            {
                _floatingMessage         = new FloatingMessageForm(this);
                _floatingMessage.Font    = new System.Drawing.Font(this.Font.FontFamily, this.Font.Size * 2, FontStyle.Bold);
                _floatingMessage.Opacity = 0.7;
                _floatingMessage.Show(this);
            }
        }
Exemple #3
0
        private void DupForm_Load(object sender, EventArgs e)
        {
            if (Program.MainForm != null)
            {
                MainForm.SetControlFont(this, Program.MainForm.DefaultFont);
            }

#if NO
            this.Channel.Url = Program.MainForm.LibraryServerUrl;

            this.Channel.BeforeLogin -= new BeforeLoginEventHandle(Channel_BeforeLogin);
            this.Channel.BeforeLogin += new BeforeLoginEventHandle(Channel_BeforeLogin);

            stop = new DigitalPlatform.Stop();
            stop.Register(MainForm.stopManager, true);  // 和容器关联
#endif

            this.checkBox_includeLowCols.Checked = Program.MainForm.AppInfo.GetBoolean(
                "dup_form",
                "include_low_cols",
                true);
            this.checkBox_returnAllRecords.Checked = Program.MainForm.AppInfo.GetBoolean(
                "dup_form",
                "return_all_records",
                true);
            this.checkBox_returnSearchDetail.Checked = Program.MainForm.AppInfo.GetBoolean(
                "dup_form",
                "return_search_detail",
                false);

            if (String.IsNullOrEmpty(this.comboBox_projectName.Text) == true)
            {
                this.comboBox_projectName.Text = Program.MainForm.AppInfo.GetString(
                    "dup_form",
                    "projectname",
                    "");
            }

            string strWidths = Program.MainForm.AppInfo.GetString(
                "dup_form",
                "browse_list_column_width",
                "");
            if (String.IsNullOrEmpty(strWidths) == false)
            {
                ListViewUtil.SetColumnHeaderWidth(this.listView_browse,
                                                  strWidths,
                                                  true);
            }

            this.Channel = null;

            // 自动启动查重
            if (this.AutoBeginSearch == true)
            {
                API.PostMessage(this.Handle, WM_INITIAL, 0, 0);
            }
        }
Exemple #4
0
        // 恢复 ListView 的状态
        // 目前是栏宽度
        static void SetListViewState(ListView listview, string strText)
        {
            string strState = "";

            if (IsType(strText, listview, out strState) == false)
            {
                return;
            }
            ListViewUtil.SetColumnHeaderWidth(listview,
                                              strState,
                                              true);
        }
Exemple #5
0
        private void InvoiceSearchForm_Load(object sender, EventArgs e)
        {
            this.FillFromList();

            string strDefaulFrom = "";

            if (this.DbType == "invoice")
            {
                strDefaulFrom = "发票号";
            }
            else if (this.DbType == "amerce")
            {
                strDefaulFrom = "??";
            }
            else
            {
                throw new Exception("未知的DbType '" + this.DbType + "'");
            }

            this.comboBox_from.Text = Program.MainForm.AppInfo.GetString(
                this.DbType + "_search_form",
                "from",
                strDefaulFrom);

            this.comboBox_matchStyle.Text = Program.MainForm.AppInfo.GetString(
                this.DbType + "_search_form",
                "match_style",
                "精确一致");

            string strWidths = Program.MainForm.AppInfo.GetString(
                this.DbType + "_search_form",
                "record_list_column_width",
                "");

            if (String.IsNullOrEmpty(strWidths) == false)
            {
                ListViewUtil.SetColumnHeaderWidth(this.listView_records,
                                                  strWidths,
                                                  true);
            }

            comboBox_matchStyle_TextChanged(null, null);

            this.SetWindowTitle();
        }
Exemple #6
0
        void SetUiState(string strStates)
        {
            Hashtable table = StringUtil.ParseParameters(strStates, ';', '=');

            string strColumnWidthList = (string)table["l_c_w"];

            if (string.IsNullOrEmpty(strColumnWidthList) == false)
            {
                ListViewUtil.SetColumnHeaderWidth(this.listView_list,
                                                  strColumnWidthList,
                                                  true);
            }

            strColumnWidthList = (string)table["v_c_w"];
            if (string.IsNullOrEmpty(strColumnWidthList) == false)
            {
                ListViewUtil.SetColumnHeaderWidth(this.listView_levels,
                                                  strColumnWidthList,
                                                  true);
            }

            string strSplitter = (string)table["s_c"];

            if (string.IsNullOrEmpty(strSplitter) == false)
            {
                float f = 0.5F;
                float.TryParse(strSplitter, out f);
                GuiUtil.SetSplitterState(this.splitContainer1, f);
            }

            string strLeft = (string)table["l"];

            if (string.IsNullOrEmpty(strLeft) == false)
            {
                if (strLeft == "yes")
                {
                    this.toolStripButton_wild.Checked = true;
                }
                else
                {
                    this.toolStripButton_wild.Checked = false;
                }
            }
        }
Exemple #7
0
        void ManageServers(bool bFirstRun)
        {
            ServersDlg dlg = new ServersDlg();

            MainForm.SetControlFont(dlg, this.DefaultFont);

            string strWidths = this.AppInfo.GetString(
                "serversdlg",
                "list_column_width",
                "");

            if (String.IsNullOrEmpty(strWidths) == false)
            {
                ListViewUtil.SetColumnHeaderWidth(dlg.ListView,
                                                  strWidths,
                                                  true);
            }

            ServerCollection newServers = Servers.Dup();

            if (bFirstRun == true)
            {
                dlg.Text = "首次运行: 请指定服务器参数";
            }
            dlg.Servers = newServers;
            this.AppInfo.LinkFormState(dlg, "serversdlg_state");
            dlg.ShowDialog(this);
            this.AppInfo.UnlinkFormState(dlg);

            strWidths = ListViewUtil.GetColumnWidthListString(dlg.ListView);
            this.AppInfo.SetString(
                "serversdlg",
                "list_column_width",
                strWidths);

            if (dlg.DialogResult != DialogResult.OK)
            {
                return;
            }

            // this.Servers = newServers;
            this.Servers.Import(newServers);
        }
Exemple #8
0
        private void DupForm_Load(object sender, EventArgs e)
        {
            this.Channels              = new LibraryChannelCollection();
            this.Channels.BeforeLogin += new BeforeLoginEventHandle(Channels_BeforeLogin);
            this.Channels.AfterLogin  += new AfterLoginEventHandle(Channels_AfterLogin);

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

            this.checkBox_includeLowCols.Checked = this.MainForm.AppInfo.GetBoolean(
                "dup_form",
                "include_low_cols",
                true);
            this.checkBox_returnAllRecords.Checked = this.MainForm.AppInfo.GetBoolean(
                "dup_form",
                "return_all_records",
                true);
            if (String.IsNullOrEmpty(this.comboBox_projectName.Text) == true)
            {
                this.comboBox_projectName.Text = this.MainForm.AppInfo.GetString(
                    "dup_form",
                    "projectname",
                    "");
            }

            string strWidths = this.MainForm.AppInfo.GetString(
                "dup_form",
                "browse_list_column_width",
                "");

            if (String.IsNullOrEmpty(strWidths) == false)
            {
                ListViewUtil.SetColumnHeaderWidth(this.listView_browse,
                                                  strWidths,
                                                  true);
            }

            // 自动启动查重
            if (this.AutoBeginSearch == true)
            {
                API.PostMessage(this.Handle, WM_INITIAL, 0, 0);
            }
        }
Exemple #9
0
        private void menuItem_serversCfg_Click(object sender, System.EventArgs e)
        {
            ServersDlg dlg = new ServersDlg();

            MainForm.SetControlFont(dlg, this.DefaultFont);

            ServerCollection newServers = Servers.Dup();

            string strWidths = this.AppInfo.GetString(
                "serversdlg",
                "list_column_width",
                "");

            if (String.IsNullOrEmpty(strWidths) == false)
            {
                ListViewUtil.SetColumnHeaderWidth(dlg.ListView,
                                                  strWidths,
                                                  true);
            }

            dlg.Servers = newServers;

            this.AppInfo.LinkFormState(dlg, "serversdlg_state");
            dlg.ShowDialog(this);
            this.AppInfo.UnlinkFormState(dlg);

            strWidths = ListViewUtil.GetColumnWidthListString(dlg.ListView);
            this.AppInfo.SetString(
                "serversdlg",
                "list_column_width",
                strWidths);

            if (dlg.DialogResult != DialogResult.OK)
            {
                return;
            }

            // this.Servers = newServers;
            this.Servers.Import(newServers);

            // this.treeView_res.Servers = this.Servers;
            treeView_res.Fill(null);
        }
Exemple #10
0
        private void SelectDictionaryItemDialog_Load(object sender, EventArgs e)
        {
#if NO
            // 第一次检索装载
            {
                this.toolStripLabel_currentKey.Text = this.Key;

                string        strError = "";
                List <string> results  = new List <string>();
                int           nRet     = Search(this.DbName,
                                                this.Key,
                                                "exact",
                                                1000,
                                                ref results,
                                                out strError);
                if (nRet == -1)
                {
                    MessageBox.Show(this, strError);
                }

                FillListView(results);
            }
#endif
            _stopManager.Initial(this.toolStripButton_stop,
                                 (object)this.label_message,
                                 (object)null);

            _stop = new DigitalPlatform.Stop();
            _stop.Register(this._stopManager, true);    // 和容器关联


#if NO
            if (string.IsNullOrEmpty(ColumnWidthList) == false)
            {
                ListViewUtil.SetColumnHeaderWidth(this.listView_list,
                                                  ColumnWidthList,
                                                  true);
            }
#endif
            this.SetUiState(this.UiStates);

            this.BeginInvoke(new Delegate_FillLevels(this.FillLevels));
        }
Exemple #11
0
        private void ValueListDlg_Load(object sender, EventArgs e)
        {
            if (this.AppInfo != null)
            {
                string strWidths = this.AppInfo.GetString(
                    "marceditor_valuelistdialog",
                    "list_column_width",
                    "");
                if (String.IsNullOrEmpty(strWidths) == false)
                {
                    ListViewUtil.SetColumnHeaderWidth(this.listView_valueList,
                                                      strWidths,
                                                      true);
                }
            }

            if (String.IsNullOrEmpty(this.m_strInitialValue) == false)
            {
                this.SelectItem(this.m_strInitialValue);
            }
        }
Exemple #12
0
        private void ChannelForm_Load(object sender, EventArgs e)
        {
            if (Program.MainForm != null)
            {
                MainForm.SetControlFont(this, Program.MainForm.DefaultFont);
            }

            string strWidths = Program.MainForm.AppInfo.GetString(
                "channel_form",
                "browse_list_column_width",
                "");

            if (String.IsNullOrEmpty(strWidths) == false)
            {
                ListViewUtil.SetColumnHeaderWidth(this.listView_channel,
                                                  strWidths,
                                                  true);
            }

            this._history.StateChanged -= new StateChangedEventHandler(_history_StateChanged);
            this._history.StateChanged += new StateChangedEventHandler(_history_StateChanged);

            RefreshBackForwardButtons();
        }