예제 #1
0
        /// <summary>
        /// SavedSearch constructor
        /// </summary>
        /// <param name="name"></param>
        public SavedSearch(NameValueCollection nvc)
        {
            this.Name                   = HttpContext.Current.Server.HtmlEncode(nvc["nm"]);
            this.Destination            = HttpContext.Current.Server.HtmlEncode(nvc["ds"]);
            this.DestinationDisplayName = HttpContext.Current.Server.HtmlEncode(nvc["dsn"]);
            this.MonthSearch            = SearchResultController.FormatMonthSearch(HttpContext.Current.Server.HtmlEncode(nvc["ms"]));
            this.monthsearchduration    = HttpContext.Current.Server.HtmlEncode(nvc["du"]);

            this.ReservationType = HttpContext.Current.Server.HtmlEncode(nvc["rt"]);

            if (string.IsNullOrEmpty(this.Name))
            {
                throw new Exception("SaveSearch must have a name");
            }
        }
예제 #2
0
    /**
     * Creates an instance of the specified searchResultPrefab GameObject, and sets
     * desired properties on it.
     *
     * <param name="result">SearchResult.</param>
     */
    private GameObject createSearchResultPrefab(SearchResult result)
    {
        GameObject             resultPrefab = Instantiate(searchResultPrefab);
        SearchResultController controller   = resultPrefab.GetComponent <SearchResultController>();

        controller.title.text = result.title;
        controller.setIdentifier(result.identifier);
        controller.setSongDetailPanelReference(songDetailPanelContent);
        controller.setSongFileListContentReference(songFileListContent);
        controller.setSongDetail(new SongDetail(result.title, result.description, result.date));

        if (result.subject != null && result.subject.Length > 0)
        {
            controller.subjects.text = generateSubjectString(result);
        }

        return(resultPrefab);
    }