Esempio n. 1
0
        // 构造参数表
        IDictionary <string, string> BuildParameterTable()
        {
            IDictionary <string, string> table = new ParameterTable();

            // TODO: 是否需要检查 当前 SearchIndex 值为空
            table.Add("SearchIndex", this.GetSearchIndex());

            // ParameterTable temp = null;
            this.amazonSearchParametersControl1.BuildParameterTable(ref table);

            /*
             * foreach (string s in temp.Keys)
             * {
             *  table.Add(s, temp[s]);
             * }
             * */

            return(table);
        }
        // 构造参数表
        public void BuildParameterTable(ref IDictionary <string, string> table)
        {
            if (table == null)
            {
                table = new ParameterTable();
            }

            foreach (Item item in this.Items)
            {
                string strName  = item.Name;
                string strValue = item.Value;
                if (string.IsNullOrEmpty(strValue) == false)
                {
                    if (item.ItemType == ItemType.ComboBox)
                    {
                        string strLeft  = "";
                        string strRight = "";
                        AmazonQueryControl.ParseLeftRight(strValue,
                                                          out strLeft,
                                                          out strRight);
                        if (string.IsNullOrEmpty(strRight) == false)
                        {
                            table[strName] = strRight;
                        }
                        else
                        {
                            // TODO: 警告?
                        }
                    }
                    else if (item.ItemType == ItemType.TextBox)
                    {
                        table[strName] = strValue;
                    }
                    else
                    {
                        table[strName] = strValue;
                    }
                }
            }
        }