コード例 #1
0
    public override TransitPicture GetRandomPictureWithThumbnail()
    {
        SnCore.Services.TransitPicture p = SessionManager.GetInstance <SnCore.Services.TransitPicture, string>(
            "AccountStory", SessionManager.ObjectService.GetRandomPictureByType);

        if (p == null)
        {
            return(null);
        }

        TransitPicture result = new TransitPicture();

        result.Id       = p.Id;
        result.Bitmap   = p.Thumbnail;
        result.Created  = p.Created;
        result.Modified = p.Modified;
        result.Name     = p.Name;
        return(result);
    }
コード例 #2
0
ファイル: SystemPicturePage.cs プロジェクト: qwdf1615/sncore
    public override TransitPicture GetPictureWithThumbnail(int id)
    {
        SnCore.Services.TransitPicture p = SessionManager.GetInstance <SnCore.Services.TransitPicture, int>(
            id, SessionManager.ObjectService.GetPictureById);

        if (p == null)
        {
            return(null);
        }

        TransitPicture result = new TransitPicture();

        result.Id       = p.Id;
        result.Bitmap   = p.Thumbnail;
        result.Created  = p.Created;
        result.Modified = p.Modified;
        result.Name     = p.Name;
        return(result);
    }
コード例 #3
0
ファイル: SystemPicturePage.cs プロジェクト: qwdf1615/sncore
    public override TransitPicture GetPictureWithBitmap(int id, DateTime ifModifiedSince)
    {
        SnCore.Services.TransitPicture p = SessionManager.GetInstance <SnCore.Services.TransitPicture, int, DateTime>(
            id, ifModifiedSince, SessionManager.ObjectService.GetPictureIfModifiedSinceById);

        if (p == null)
        {
            return(null);
        }

        TransitPicture result = new TransitPicture();

        result.Id       = p.Id;
        result.Bitmap   = p.Bitmap;
        result.Created  = p.Created;
        result.Modified = p.Modified;
        result.Name     = p.Name;
        return(result);
    }
コード例 #4
0
    public override PicturePage.TransitPicture GetRandomPictureWithThumbnail()
    {
        SnCore.Services.TransitPicture p = SessionManager.GetInstance <SnCore.Services.TransitPicture, string>(
            "AccountWebsite", SessionManager.ObjectService.GetRandomPictureByType);

        if (p == null || p.Bitmap == null)
        {
            p = new SnCore.Services.TransitPicture();
            const string s_Unavailable = "Thumbnail\nQueued";
            // flip the bitmaps horizontally
            p.Bitmap    = ThumbnailBitmap.GetBitmapDataFromText(s_Unavailable, 10, ThumbnailBitmap.s_FullSize.Height, ThumbnailBitmap.s_FullSize.Width);
            p.Thumbnail = ThumbnailBitmap.GetBitmapDataFromText(s_Unavailable, 10, ThumbnailBitmap.s_ThumbnailSize.Height, ThumbnailBitmap.s_ThumbnailSize.Width);
            p.Created   = p.Modified = DateTime.UtcNow;
        }

        TransitPicture result = new TransitPicture();

        result.Id       = p.Id;
        result.Bitmap   = p.Thumbnail;
        result.Created  = p.Created;
        result.Modified = p.Modified;
        result.Name     = p.Name;
        return(result);
    }
コード例 #5
0
    public override PicturePage.TransitPicture GetRandomPictureWithThumbnail()
    {
        SnCore.Services.TransitPicture p = SessionManager.GetInstance<SnCore.Services.TransitPicture, string>(
            "PlaceWebsite", SessionManager.ObjectService.GetRandomPictureByType);

        if (p == null || p.Bitmap == null)
        {
            p = new SnCore.Services.TransitPicture();
            const string s_Unavailable = "Thumbnail\nQueued";
            // flip the bitmaps horizontally
            p.Bitmap = ThumbnailBitmap.GetBitmapDataFromText(s_Unavailable, 10, ThumbnailBitmap.s_FullSize.Height, ThumbnailBitmap.s_FullSize.Width);
            p.Thumbnail = ThumbnailBitmap.GetBitmapDataFromText(s_Unavailable, 10, ThumbnailBitmap.s_ThumbnailSize.Height, ThumbnailBitmap.s_ThumbnailSize.Width);
            p.Created = p.Modified = DateTime.UtcNow;
        }

        TransitPicture result = new TransitPicture();
        result.Id = p.Id;
        result.Bitmap = p.Thumbnail;
        result.Created = p.Created;
        result.Modified = p.Modified;
        result.Name = p.Name;
        return result;
    }