コード例 #1
0
        public IEnumerable <Featured> GetFeatured()
        {
            List <Featured> cars = new List <Featured>();

            using (var cn = new SqlConnection(Settings.GetConnectionString()))
            {
                SqlCommand cmd = new SqlCommand("Featured", cn);
                cmd.CommandType = CommandType.StoredProcedure;

                cn.Open();
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        Featured car = new Featured();
                        car.CarId       = (int)dr["CarId"];
                        car.MakeModelId = (int)dr["MakeModelId"];
                        car.MakeName    = dr["Make"].ToString();
                        car.ModelName   = dr["Model"].ToString();
                        car.SalePrice   = (decimal)dr["SalePrice"];
                        car.CarYear     = (int)dr["CarYear"];

                        if (dr["PicturePNG"] != DBNull.Value)
                        {
                            car.PicturePNG = dr["PicturePNG"].ToString();
                        }

                        cars.Add(car);
                    }
                }
            }
            return(cars);
        }
コード例 #2
0
        /// <summary>
        /// <para type="description">ProcessRecord method</para>
        /// </summary>
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            try
            {
                WriteObject(Task.Run(async() => await Featured.GetAsync(Region, Language)).Result);
            }
            catch (PipelineStoppedException)
            {
                // Nothing to do here, the try block is simply to handle exceptions when the user aborts the command
                return;
            }
            catch (AggregateException ex)
            {
                foreach (var error in ex.InnerExceptions)
                {
                    WriteError(new ErrorRecord(error, "UnknownError", ErrorCategory.NotSpecified, null));
                }
                return;
            }
            catch (Exception ex)
            {
                WriteError(new ErrorRecord(ex, "UnknownError", ErrorCategory.NotSpecified, null));
                return;
            }
        }
コード例 #3
0
        static async Task Examples()
        {
            // Get details for SteamApp with ID 443790
            SteamApp steamApp1 = await AppDetails.GetAsync(460810);

            // Get details for SteamApp with ID 443790 for region US
            SteamApp steamApp2 = await AppDetails.GetAsync(322330, "US");

            // Get details for SteamApp with ID 443790 for region US with strings localized in german
            SteamApp steamApp3 = await AppDetails.GetAsync(322330, "US", "german");

            // Get details for Package with ID 68179 for region
            PackageInfo package1 = await PackageDetails.GetAsync(68179);

            // Get details for Package with ID 68179 for region JP
            PackageInfo package2 = await PackageDetails.GetAsync(68179, "JP");

            // Get a list of featured games
            FeaturedApps featured = await Featured.GetAsync();

            // Get a list of featured games for region DE
            FeaturedApps featured2 = await Featured.GetAsync("DE");

            // Get a list of featured games for region DE localized in english
            FeaturedApps featured3 = await Featured.GetAsync("DE", "english");

            // Get a list of featured games grouped by category
            List <FeaturedCategory> featuredCategories = (await FeaturedCategories.GetAsync()).ToList();

            // Get a list of featured games grouped by category for region US
            List <FeaturedCategory> featuredCategories2 = (await FeaturedCategories.GetAsync("DE")).ToList();
        }
コード例 #4
0
        private void initObjectModels()
        {
            // initializing footer objects
            terms         = new Terms(browser);
            privacy       = new Privacy(browser);
            security      = new Security(browser);
            status        = new Status(browser);
            help          = new Help(browser);
            footerLogo    = new pageObjectModels.footer.Logo(browser);
            contactGitHub = new ContactGitHub(browser);
            api           = new API(browser);
            training      = new Training(browser);
            shop          = new Shop(browser);
            footerBlog    = new pageObjectModels.footer.Blog(browser);
            about         = new About(browser);

            // initializing explore objects
            integrations = new Integrations(browser);
            showcases    = new Showcases(browser);
            trending     = new Trending(browser);

            // initializing header objects
            headerLogo = new pageObjectModels.header.Logo(browser);
            personal   = new Personal(browser);
            openSource = new OpenSource(browser);
            business   = new Business(browser);
            explore    = new Explore(browser);
            pricing    = new Pricing(browser);
            headerBlog = new pageObjectModels.header.Blog(browser);
            support    = new Support(browser);
            searchBar  = new pageObjectModels.header.SearchBar(browser);
            signIn     = new SignIn(browser);
            signUp     = new SignUp(browser);

            // initializing main objects
            signUpUsername  = new SignUpUsername(browser);
            signUpEmail     = new SignUpEmail(browser);
            signUpPassword  = new SignUpPassword(browser);
            signUpSubmit    = new SignUpSubmit(browser);
            signUpForGitHub = new SignUpForGitHubButton(browser);

            // initializing pricing objects
            joinGitHubForFree    = new JoinGitHubForFree(browser);
            upgradeAccount       = new UpgradeAccount(browser);
            createOrganization   = new CreateOrganization(browser);
            startEnterpriseTrial = new StartEnterpriseTrial(browser);

            // initializing blog objects
            featured      = new Featured(browser);
            allPosts      = new AllPosts(browser);
            newFeatures   = new NewFeatures(browser);
            engineering   = new Engineering(browser);
            enterprise    = new Enterprise(browser);
            conferences   = new Conferences(browser);
            meetups       = new Meetups(browser);
            newHires      = new NewHires(browser);
            watercooler   = new Watercooler(browser);
            blogSearchBar = new pageObjectModels.blog.SearchBar(browser);
        }
コード例 #5
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = SmallIcon != null?SmallIcon.GetHashCode() : 0;

                hashCode = hashCode * 397 ^ (Icon != null ? Icon.GetHashCode() : 0);
                hashCode = hashCode * 397 ^ (Featured != null ? Featured.GetHashCode() : 0);
                hashCode = hashCode * 397 ^ (Other != null ? Other.GetHashCode() : 0);
                return(hashCode);
            }
        }
コード例 #6
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = SmallIcon != null?SmallIcon.GetHashCode() : 0;

                hashCode = hashCode * 397 ^ (Icon != null ? Icon.GetHashCode() : 0);
                hashCode = hashCode * 397 ^ (Featured != null ? Featured.GetHashCode() : 0);
                hashCode = hashCode * 397 ^ (Background != null ? Background.GetHashCode() : 0);
                hashCode = hashCode * 397 ^ (CoverArt != null ? CoverArt.GetHashCode() : 0);
                hashCode = hashCode * 397 ^ (Decal != null ? Decal.GetHashCode() : 0);
                return(hashCode);
            }
        }
コード例 #7
0
 public string ToLine()
 {
     return(string.Join("\t",
                        Filename,
                        Url,
                        ID.ToString(),
                        Title,
                        Description,
                        Author,
                        Featured.ToString(),
                        Uses.ToString(),
                        Favorites.ToString(),
                        Code.ToString()));
 }
コード例 #8
0
        public virtual Dictionary <string, string> AsDictionary()
        {
            var result = new Dictionary <string, string>(16)
            {
                { PageSize.Key, PageSize.ToString() },
                { PageNumber.Key, PageNumber.ToString() },
                { Query.Key, Query.ToString() },
                { SelectedFacetValues.Key, SelectedFacetValues.ToString() },
                { ExcludedFacetValues.Key, ExcludedFacetValues.ToString() },
                { SelectedFacetValuesSearchOperator.Key, SelectedFacetValuesSearchOperator.ToString() },
                { ExcludedItemIds.Key, ExcludedItemIds.ToString() },
                { SelectedTemplateIds.Key, SelectedTemplateIds.ToString() },
                { Path.Key, Path.ToString() },
                { Featured.Key, Featured.ToString() },
                { SortBy.Key, SortBy.ToString() }
            };

            return(result);
        }
コード例 #9
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Attributes != null?Attributes.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (CatalogVisibility != null ? CatalogVisibility.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Categories != null ? Categories.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ExternalUrl != null ? ExternalUrl.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Featured.GetHashCode();
                hashCode = (hashCode * 397) ^ Id;
                hashCode = (hashCode * 397) ^ (Images != null ? Images.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ InStock.GetHashCode();
                hashCode = (hashCode * 397) ^ ManageStock.GetHashCode();
                hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ OnSale.GetHashCode();
                hashCode = (hashCode * 397) ^ ParentId;
                hashCode = (hashCode * 397) ^ (Permalink != null ? Permalink.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Price != null ? Price.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (PriceHtml != null ? PriceHtml.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Purchasable.GetHashCode();
                hashCode = (hashCode * 397) ^ (RegularPrice != null ? RegularPrice.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (RelatedIds != null ? RelatedIds.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (SalePrice != null ? SalePrice.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ShortDescription != null ? ShortDescription.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Sku != null ? Sku.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Slug != null ? Slug.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (StockQuantity != null ? StockQuantity.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Tags != null ? Tags.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (TaxClass != null ? TaxClass.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (TaxStatus != null ? TaxStatus.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ TotalSales;
                hashCode = (hashCode * 397) ^ (Type != null ? Type.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Virtual.GetHashCode();
                return(hashCode);
            }
        }
コード例 #10
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (ProfileMedium != null)
         {
             hashCode = hashCode * 59 + ProfileMedium.GetHashCode();
         }
         if (CoverPhoto != null)
         {
             hashCode = hashCode * 59 + CoverPhoto.GetHashCode();
         }
         if (CoverPhotoSmall != null)
         {
             hashCode = hashCode * 59 + CoverPhotoSmall.GetHashCode();
         }
         if (SportType != null)
         {
             hashCode = hashCode * 59 + SportType.GetHashCode();
         }
         if (ActivityTypes != null)
         {
             hashCode = hashCode * 59 + ActivityTypes.GetHashCode();
         }
         if (City != null)
         {
             hashCode = hashCode * 59 + City.GetHashCode();
         }
         if (State != null)
         {
             hashCode = hashCode * 59 + State.GetHashCode();
         }
         if (Country != null)
         {
             hashCode = hashCode * 59 + Country.GetHashCode();
         }
         if (_Private != null)
         {
             hashCode = hashCode * 59 + _Private.GetHashCode();
         }
         if (MemberCount != null)
         {
             hashCode = hashCode * 59 + MemberCount.GetHashCode();
         }
         if (Featured != null)
         {
             hashCode = hashCode * 59 + Featured.GetHashCode();
         }
         if (Verified != null)
         {
             hashCode = hashCode * 59 + Verified.GetHashCode();
         }
         if (Url != null)
         {
             hashCode = hashCode * 59 + Url.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #11
0
        /// <summary>
        /// Returns true if SummaryClub instances are equal
        /// </summary>
        /// <param name="other">Instance of SummaryClub to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SummaryClub other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ProfileMedium == other.ProfileMedium ||
                     ProfileMedium != null &&
                     ProfileMedium.Equals(other.ProfileMedium)
                     ) &&
                 (
                     CoverPhoto == other.CoverPhoto ||
                     CoverPhoto != null &&
                     CoverPhoto.Equals(other.CoverPhoto)
                 ) &&
                 (
                     CoverPhotoSmall == other.CoverPhotoSmall ||
                     CoverPhotoSmall != null &&
                     CoverPhotoSmall.Equals(other.CoverPhotoSmall)
                 ) &&
                 (
                     SportType == other.SportType ||
                     SportType != null &&
                     SportType.Equals(other.SportType)
                 ) &&
                 (
                     ActivityTypes == other.ActivityTypes ||
                     ActivityTypes != null &&
                     ActivityTypes.SequenceEqual(other.ActivityTypes)
                 ) &&
                 (
                     City == other.City ||
                     City != null &&
                     City.Equals(other.City)
                 ) &&
                 (
                     State == other.State ||
                     State != null &&
                     State.Equals(other.State)
                 ) &&
                 (
                     Country == other.Country ||
                     Country != null &&
                     Country.Equals(other.Country)
                 ) &&
                 (
                     _Private == other._Private ||
                     _Private != null &&
                     _Private.Equals(other._Private)
                 ) &&
                 (
                     MemberCount == other.MemberCount ||
                     MemberCount != null &&
                     MemberCount.Equals(other.MemberCount)
                 ) &&
                 (
                     Featured == other.Featured ||
                     Featured != null &&
                     Featured.Equals(other.Featured)
                 ) &&
                 (
                     Verified == other.Verified ||
                     Verified != null &&
                     Verified.Equals(other.Verified)
                 ) &&
                 (
                     Url == other.Url ||
                     Url != null &&
                     Url.Equals(other.Url)
                 ));
        }
コード例 #12
0
        // GET: SpectatorFeatured
        public ActionResult Index()
        {
            Featured qwe = JsonConvert.DeserializeObject <Featured>(new WebApiCall().CallSpectatorFeatured());

            return(View(qwe));
        }
コード例 #13
0
 public DataSet getAlltheater(int siteid, int contid)
 {
     Featured feat = new Featured();
     return feat.getAllFeature(siteid, contid);
 }
コード例 #14
0
    void SortAvailableDownloads()
    {
        System.IO.StreamReader streamReader = new System.IO.StreamReader ( startupManager.supportPath + "Downloads.xml" );
        string xml = streamReader.ReadToEnd();
        streamReader.Close();

        SongCollection songCollection = xml.DeserializeXml<SongCollection>();
        allSongsList = songCollection.songs.ToList ();
        allSongsList.Sort (( a, b ) => a.name.CompareTo ( b.name ));

        allRecentlyAddedList = songCollection.songs.ToList ();;
        allRecentlyAddedList.Reverse ();

        Album tempAlbum;
        Artist tempArtist;
        Genre tempGenre;

        foreach ( Song song in songCollection.songs )
        {

            tempAlbum = new Album ();
            tempAlbum.name = song.album;
            tempAlbum.songs.Add ( song );

            if ( !albums.ContainsKey ( tempAlbum.name ))
            {

                albums[tempAlbum.name] = tempAlbum;
            } else {

                albums[song.album].songs.Add ( song );
            }

            tempArtist = new Artist ();
            tempArtist.name = song.artist;
            tempArtist.songs.Add ( song );

            if ( !artists.ContainsKey ( tempArtist.name ))
            {

                artists[tempArtist.name] = tempArtist;
            } else {

                artists[song.artist].songs.Add ( song );
            }

            tempGenre = new Genre ();
            tempGenre.name = song.genre;
            tempGenre.songs.Add ( song );

            if ( !genres.ContainsKey ( tempGenre.name ))
            {

                genres[tempGenre.name] = tempGenre;
            } else {

                genres[song.genre].songs.Add ( song );
            }

            if ( song.featured == "true" )
            {

                Featured tempFeatured = new Featured ();
                tempFeatured.song = song;
                tempFeatured.artwork = missingArtwork;

                featuredList.Add ( tempFeatured );
            }
        }

        paneManager.loading = false;
        if ( paneManager.currentPane == PaneManager.pane.onlineMusicBrowser )
        {

            startupManager.preferences.enableOMB = true;
        }

        downloadFeaturedArtwork = true;
    }