当前位置: 首页>>代码示例>>C#>>正文


C# DataGridViewComboBoxCell.Dispose方法代码示例

本文整理汇总了C#中System.Windows.Forms.DataGridViewComboBoxCell.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewComboBoxCell.Dispose方法的具体用法?C# DataGridViewComboBoxCell.Dispose怎么用?C# DataGridViewComboBoxCell.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.DataGridViewComboBoxCell的用法示例。


在下文中一共展示了DataGridViewComboBoxCell.Dispose方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Settings_Tax_Grid

        private void Settings_Tax_Grid(object profile)
        {
            if (ConfigManager.Instance.CommonConfiguration.TAX_Compatibility == null)
                ConfigManager.Instance.CommonConfiguration.TAX_Compatibility = new Hashtable();

            if (ConfigManager.Instance.CommonConfiguration.TAX_DefinedRates == null)
                ConfigManager.Instance.CommonConfiguration.TAX_DefinedRates = new Hashtable();

            // check for default
            if (!ConfigManager.Instance.CommonConfiguration.TAX_Compatibility.ContainsKey(profile))
            {
                ConfigManager.Instance.CommonConfiguration.TAX_Compatibility[profile] = ConfigManager.Instance.CommonConfiguration.TAX_Compatibility_Template;
                ConfigManager.Instance.CommonConfiguration.TAX_DefinedRates[profile] = new Hashtable();
            }

            // get profile config
            Hashtable compatibleGrid = (Hashtable)ConfigManager.Instance.CommonConfiguration.TAX_Compatibility[profile];
            Hashtable definedGrid = (Hashtable)ConfigManager.Instance.CommonConfiguration.TAX_DefinedRates[profile];

            // load defined tax rates
            dataGridView_tax_userdefined.Rows.Clear();
            List<string> definedParameters = new List<string>();
            if (definedGrid != null)
            {
                SortedDictionary<string, string> sortedDefinedGrid = new SortedDictionary<string, string>();
                foreach (DictionaryEntry de in definedGrid)
                    sortedDefinedGrid[(string)de.Key] = de.Value.ToString();

                foreach (KeyValuePair<string, string> de in sortedDefinedGrid)
                {
                    definedParameters.Clear();
                    definedParameters.Add(de.Key.ToString());
                    definedParameters.AddRange(de.Value.ToString().Split(';'));
                    //definedParameters = de.Value.ToString().Split(';');
                    dataGridView_tax_userdefined.Rows.Add(definedParameters.ToArray());
                }
            }

            // load compatible grid
            dataGridView_tax_compatibility.Rows.Clear();
            SortedDictionary<char, char> sortedCompatibleGrid = new SortedDictionary<char, char>();
            if (compatibleGrid != null)
            {
                DataGridViewRow dwRow = null;
                DataGridViewComboBoxCell cbCell = null;
                DataGridViewTextBoxCell tbCell = null;

                foreach (DictionaryEntry de in compatibleGrid)
                    sortedCompatibleGrid[(char)de.Key] = (char)de.Value;

                foreach (KeyValuePair<char, char> de in sortedCompatibleGrid)
                {
                    cbCell = new DataGridViewComboBoxCell();
                    cbCell.ValueType = typeof(char);
                    cbCell.MaxDropDownItems = 8;
                    cbCell.Value = de.Value;

                    tbCell = new DataGridViewTextBoxCell();
                    tbCell.ValueType = typeof(char);
                    tbCell.Value = de.Key;

                    dwRow = new DataGridViewRow();
                    dwRow.Cells.Add(cbCell);
                    dwRow.Cells.Add(tbCell);

                    dataGridView_tax_compatibility.Rows.Add(dwRow);

                    cbCell.Dispose();
                    tbCell.Dispose();
                    dwRow.Dispose();
                }
                dataGridView_tax_compatibility.ReadOnly = false;
                dataGridView_tax_compatibility.Columns["mkt"].ReadOnly = true;
                dataGridView_tax_compatibility.Columns["mkt"].SortMode = DataGridViewColumnSortMode.Automatic;
                dataGridView_tax_compatibility.Sort(dataGridView_tax_compatibility.Columns["mkt"], ListSortDirection.Ascending);
            }

            UpdateTaxValues();

            try
            {
                if (compatibleGrid != null)
                {
                    int rowIndex = 0;
                    foreach (KeyValuePair<char, char> de in sortedCompatibleGrid)
                        dataGridView_tax_compatibility["pd", rowIndex++].Value = de.Value;
                }
            }
            catch { }

            //LoadAppTaxRates
            /*
            dataGridView_tax_userdefined.Rows.Clear();
            if (ConfigManager.Instance.CommonConfiguration.TAX_AppTaxChar != null)
                for (i = 0; i < ConfigManager.Instance.CommonConfiguration.TAX_AppTaxChar.Length; i++)
                {
                    dataGridView_tax_userdefined.Rows.Add(
                        ConfigManager.Instance.CommonConfiguration.TAX_AppTaxChar[i],
                        ConfigManager.Instance.CommonConfiguration.TAX_AppTaxRates[i],
                        ConfigManager.Instance.CommonConfiguration.TAX_AppTaxDisc[i]);
//.........这里部分代码省略.........
开发者ID:AndrewEastwood,项目名称:desktop,代码行数:101,代码来源:uiWndSettings.cs

示例2: Settings_Load

        private void Settings_Load(object sender, EventArgs e)
        {
            //#TAX
            //LoadAppTaxRates
            dataGridView2.Rows.Clear();
            if (AppConfig.TAX_AppTaxChar != null)
                for (i = 0; i < AppConfig.TAX_AppTaxChar.Length; i++)
                {
                    dataGridView2.Rows.Add(
                        AppConfig.TAX_AppTaxChar[i],
                        AppConfig.TAX_AppTaxRates[i],
                        AppConfig.TAX_AppTaxDisc[i]);
                }
            //LoadComparableTaxTable
            DataGridViewRow dwRow = null;
            DataGridViewComboBoxCell cbCell = null;
            DataGridViewTextBoxCell tbCell = null;
            for (i = 0; i < AppConfig.TAX_MarketColumn.Length; i++)
            {
                cbCell = new DataGridViewComboBoxCell();
                cbCell.ValueType = typeof(char);
                cbCell.MaxDropDownItems = 8;
                cbCell.Value = ' ';

                tbCell = new DataGridViewTextBoxCell();
                tbCell.ValueType = typeof(char);
                tbCell.Value = AppConfig.TAX_MarketColumn[i];

                dwRow = new DataGridViewRow();
                dwRow.Cells.Add(cbCell);
                dwRow.Cells.Add(tbCell);

                dataGridView1.Rows.Add(dwRow);

                cbCell.Dispose();
                tbCell.Dispose();
                dwRow.Dispose();
            }
            dataGridView1.ReadOnly = false;
            dataGridView1.Columns[1].ReadOnly = true;
            UpdateTaxValues();
            //RestoreComparableValues
            try
            {
                if (AppConfig.TAX_AppColumn != null)
                    for (i = 0; i < AppConfig.TAX_AppColumn.Length; i++)
                        dataGridView1["pd", i].Value = AppConfig.TAX_AppColumn[i];
            }
            catch { }

            //#COMMON
            //PayDesk
            sys_gen_kasaNom.Value = AppConfig.APP_PayDesk;
            //RefreshRate
            numericUpDown5.Value = AppConfig.APP_RefreshRate / 1000;
            //SubUnit
            sys_gen_pidrozd.Value = AppConfig.APP_SubUnit;
            //DefaultCountOfArticle
            textBox3.Text = AppConfig.APP_StartTotal.ToString();
            //SubUnitName
            textBox5.Text = AppConfig.APP_SubUnitName;
            //Customer's ID
            textBox1.Text = AppConfig.APP_ClientID;
            //WeightType
            comboBox1.SelectedIndex = AppConfig.APP_WeightType;
            //DefaultSearchType
            comboBox2.SelectedIndex = AppConfig.APP_SearchType;
            //Search Types Access
            // --> realized in Event (comboBox2_SelctedIndexChanged)

            //#PATH
            //Folder of Exchange
            phExTbBox.Text = AppConfig.Path_Exchnage;
            //Folder of Cheques
            phCheqTbBox.Text = AppConfig.Path_Cheques;
            //Folder of Bills
            phBillTbBox.Text = AppConfig.Path_Bills;
            //Folder of Articles
            phArtTBox.Text = AppConfig.Path_Articles;

            //#ADDITIONAL
            //Timeout request of refresh
            numericUpDown6.Value = AppConfig.APP_RefreshTimeout;
            //ChequeName
            maskedTextBox1.Text = AppConfig.APP_ChequeName;
            //Invent auto save
            numericUpDown3.Value = AppConfig.APP_InvAutoSave;
            //Language
            comboBox5.SelectedItem = AppConfig.APP_Language;
            //Total digits after point of money
            numericUpDown2.Value = AppConfig.APP_MoneyDecimals;
            //Total digits after point of dose
            numericUpDown4.Value = AppConfig.APP_DoseDecimals;
            //Clear temp on exit
            checkBox6.Checked = AppConfig.APP_ClearTEMPonExit;
            //Show info on indicator
            checkBox7.Checked = AppConfig.APP_ShowInfoOnIndicator;
            //Use for enabling/disabling propmt message before closing illegal order
            checkBox8.Checked = AppConfig.APP_IllegalMsgPrompt;
            //Invent window
//.........这里部分代码省略.........
开发者ID:AndrewEastwood,项目名称:desktop,代码行数:101,代码来源:Settings.cs

示例3: Settings_Load

        private void Settings_Load(object sender, EventArgs e)
        {
            //#TAX
            //LoadAppTaxRates
            dataGridView2.Rows.Clear();
            if (AppConfig.TAX_AppTaxChar != null)
                for (i = 0; i < AppConfig.TAX_AppTaxChar.Length; i++)
                {
                    dataGridView2.Rows.Add(
                        AppConfig.TAX_AppTaxChar[i],
                        AppConfig.TAX_AppTaxRates[i],
                        AppConfig.TAX_AppTaxDisc[i]);
                }
            //LoadComparableTaxTable
            DataGridViewRow dwRow = null;
            DataGridViewComboBoxCell cbCell = null;
            DataGridViewTextBoxCell tbCell = null;
            for (i = 0; i < AppConfig.TAX_MarketColumn.Length; i++)
            {
                cbCell = new DataGridViewComboBoxCell();
                cbCell.ValueType = typeof(char);
                cbCell.MaxDropDownItems = 8;
                cbCell.Value = ' ';

                tbCell = new DataGridViewTextBoxCell();
                tbCell.ValueType = typeof(char);
                tbCell.Value = AppConfig.TAX_MarketColumn[i];

                dwRow = new DataGridViewRow();
                dwRow.Cells.Add(cbCell);
                dwRow.Cells.Add(tbCell);

                dataGridView1.Rows.Add(dwRow);

                cbCell.Dispose();
                tbCell.Dispose();
                dwRow.Dispose();
            }
            dataGridView1.ReadOnly = false;
            dataGridView1.Columns[1].ReadOnly = true;
            UpdateTaxValues();
            //RestoreComparableValues
            try
            {
                if (AppConfig.TAX_AppColumn != null)
                    for (i = 0; i < AppConfig.TAX_AppColumn.Length; i++)
                        dataGridView1["pd", i].Value = AppConfig.TAX_AppColumn[i];
            }
            catch { }

            //#COMMON
            //PayDesk
            sys_gen_kasaNom.Value = AppConfig.APP_PayDesk;
            //RefreshRate
            numericUpDown5.Value = AppConfig.APP_RefreshRate / 1000;
            //SubUnit
            sys_gen_pidrozd.Value = AppConfig.APP_SubUnit;
            //DefaultCountOfArticle
            textBox3.Text = AppConfig.APP_StartTotal.ToString();
            //SubUnitName
            textBox5.Text = AppConfig.APP_SubUnitName;
            //Customer's ID
            textBox1.Text = AppConfig.APP_ClientID;
            //WeightType
            comboBox1.SelectedIndex = AppConfig.APP_WeightType;
            //DefaultSearchType
            comboBox2.SelectedIndex = AppConfig.APP_SearchType;
            //Search Types Access
            // --> realized in Event (comboBox2_SelctedIndexChanged)

            //#PATH
            //Folder of Exchange
            phExTbBox.Text = AppConfig.Path_Exchnage;
            //Folder of Cheques
            phCheqTbBox.Text = AppConfig.Path_Cheques;
            //Folder of Bills
            phBillTbBox.Text = AppConfig.Path_Bills;
            //Folder of Articles
            phArtTBox.Text = AppConfig.Path_Articles;

            //#ADDITIONAL
            //Timeout request of refresh
            numericUpDown6.Value = AppConfig.APP_RefreshTimeout;
            //ChequeName
            maskedTextBox1.Text = AppConfig.APP_ChequeName;
            //Invent auto save
            numericUpDown3.Value = AppConfig.APP_InvAutoSave;
            //Language
            comboBox5.SelectedItem = AppConfig.APP_Language;
            //Total digits after point of money
            numericUpDown2.Value = AppConfig.APP_MoneyDecimals;
            //Total digits after point of dose
            numericUpDown4.Value = AppConfig.APP_DoseDecimals;
            //Clear temp on exit
            checkBox6.Checked = AppConfig.APP_ClearTEMPonExit;
            //Show info on indicator
            checkBox7.Checked = AppConfig.APP_ShowInfoOnIndicator;
            //Invent window
            checkBox4.Checked = AppConfig.APP_ShowInventWindow;
            //One copy
//.........这里部分代码省略.........
开发者ID:AndrewEastwood,项目名称:desktop,代码行数:101,代码来源:uiWndSettings.cs


注:本文中的System.Windows.Forms.DataGridViewComboBoxCell.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。