예제 #1
0
파일: CustomUI.cs 프로젝트: Eun/WixSharp
 /// <summary>
 /// Initializes a new instance of the <see cref="T:WixSharp.CloseDialog"/> class.
 /// </summary>
 /// <param name="returnValue">The return value.</param>
 /// <param name="condition">The condition.</param>
 public CloseDialog(string returnValue, Condition condition)
 {
     this.Value = returnValue;
     this.Name = ControlAction.EndDialog.ToString();
     this.Condition = condition.ToString();
 }
예제 #2
0
파일: CustomUI.cs 프로젝트: Eun/WixSharp
 /// <summary>
 /// Initializes a new instance of the <see cref="SpawnDialog"/> class.
 /// </summary>
 /// <param name="dialogName">Name of the dialog.</param>
 /// <param name="condition">The condition.</param>
 public SpawnDialog(string dialogName, Condition condition)
 {
     this.Name = ControlAction.SpawnDialog;
     this.Condition = condition.ToString();
     this.Value = dialogName;
 }
예제 #3
0
        /// <summary>
        /// <para>Performs Search method:
        /// Search General
        /// using the query paramaters provided it will construct a query string for you - can use null if the parameter is not required for your request.
        /// </para>
        /// DOES NOT REQUIRE AUTHENTICATION.
        /// </summary>
        /// <param name="category">Specifies the category in which you want to perform the search.</param>
        /// <param name="searchString">One or more keywords to use in a search query.</param>
        /// <param name="userRegion">Restricts search results to items from sellers located in the specified region.</param>
        /// <param name="sortOrder">Sort the returned record-set by a single specified sort order.</param>
        /// <param name="buy">Return only listings with BuyNow price.</param>
        /// <param name="pay">Return only listings with PayNow.</param>
        /// <param name="condition">Filter listings by condition.</param>
        /// <param name="dateFrom">Return only listings started from this date.</param>
        /// <param name="page">Page number.</param>
        /// <param name="rows">	Number of rows per page.</param>
        /// <param name="memberListing">Returns only listing from specified member ID.</param>
        /// <returns>SearchResults.</returns>
        public SearchResults SearchGeneral(
            string category,
            string searchString,
            int? userRegion,
            SortOrder sortOrder,
            bool? buy,
            bool? pay,
            Condition condition,
            DateTime dateFrom,
            int? page,
            int? rows,
            int? memberListing)
        {
            _addAnd = false;
            var url = String.Format(Constants.Culture, "{0}/General{1}", Constants.SEARCH, Constants.XML);
            var conditions = "?";

            // create the parameters for the query string
            conditions += SearchMethods.ConstructQueryHelper(Constants.CATEGORY, category, _addAnd);
            conditions += SearchMethods.ConstructQueryHelper(Constants.SEARCH_STRING, searchString, _addAnd);
            conditions += SearchMethods.ConstructQueryHelper(Constants.USER_REGION, string.Empty + userRegion, _addAnd);
            conditions += SearchMethods.ConstructQueryHelper(Constants.SORT_ORDER, sortOrder.ToString(), _addAnd);
            conditions += SearchMethods.ConstructQueryHelper(Constants.BUY, string.Empty + buy, _addAnd);
            conditions += SearchMethods.ConstructQueryHelper(Constants.PAY, string.Empty + pay, _addAnd);
            conditions += SearchMethods.ConstructQueryHelper(Constants.CONDITION, condition.ToString(), _addAnd);
            conditions += SearchMethods.ConstructQueryHelper(Constants.DATE_FROM, Client.DateToStringConverter(dateFrom),
                                                             _addAnd);
            conditions += SearchMethods.ConstructQueryHelper(Constants.PAGE, string.Empty + page, _addAnd);
            conditions += SearchMethods.ConstructQueryHelper(Constants.ROWS, string.Empty + rows, _addAnd);
            conditions += SearchMethods.ConstructQueryHelper(Constants.MEMBER_LISTING, string.Empty + memberListing,
                                                             _addAnd);

            // add the paramaters if there are any
            if (conditions.Equals("?"))
            {
                url += conditions;
            }

            // perform the request
            return this.SearchGeneral(url);
        }