Exemple #1
0
        public async Task <string> AddUserVertex(UserVertex User)
        {
            UserVertex v = new UserVertex()
            {
                AboutMe                = User.AboutMe ?? "",
                Allergies              = User.Allergies ?? "",
                Answer                 = User.Answer ?? "",
                BackgroundUrl          = User.BackgroundUrl ?? "",
                City                   = User.City ?? "",
                CreateDate             = DateTime.UtcNow,
                Cusines                = User.Cusines ?? "",
                Diets                  = User.Diets ?? "",
                Email                  = User.Email ?? "",
                Facebook               = User.Facebook ?? "",
                FullName               = User.FullName ?? "",
                id                     = User.UserName.ToLower(),
                Instagram              = User.Instagram ?? "",
                IsFacebookLinkVisible  = false,
                IsInstagramVisible     = false,
                IsPinterestLinkVisible = false,
                IsTwitterLinkVisible   = false,
                LastActivityDate       = DateTime.UtcNow,
                LastUpdateDate         = DateTime.UtcNow,
                PhotoPath              = User.PhotoPath ?? "",
                Pintrest               = User.Pintrest ?? "",
                PostalCode             = User.PostalCode ?? "",
                Question               = User.Question ?? "",
                State                  = User.State ?? "",
                Twitter                = User.Twitter ?? "",
                UserName               = User.UserName
            };
            await client.Add(v).SubmitAsync();

            return(v.id);
        }
Exemple #2
0
 public UserModel()
 {
     Profile      = new UserVertex();
     Updates      = new List <SocialUpdateModel>();
     RatedRecipes = new List <RecipeVertex>();
 }
        static void LoadScreenAlignedQuad()
        {
            float w = 1f / (float)device.Viewport.Width;
            float h = 1f / (float)device.Viewport.Height;
            UserVertex[] QuadVertices = new UserVertex[] {
            new UserVertex() { Position = new Vector3(-1f -w, -1f +h, 0f), TexturePosition = new Vector2(0f, 1f)},
            new UserVertex() { Position = new Vector3(1f -w, -1f +h, 0f), TexturePosition = new Vector2(1f, 1f)},
            new UserVertex() { Position = new Vector3(1f -w, 1f +h, 0f), TexturePosition = new Vector2(1f, 0f)},
            new UserVertex() { Position = new Vector3(-1f -w, 1f +h, 0f), TexturePosition = new Vector2(0f, 0f)},
            };
            QuadVertexBuffer = new VertexBuffer(device, 4 * sizeof(float) * 5, Usage.None, VertexFormat.Position | VertexFormat.Texture1, Pool.Managed);
            QuadVertexBuffer.Lock(0, 0, LockFlags.None).WriteRange(QuadVertices);
            QuadVertexBuffer.Unlock();
            QuadIndexBuffer = new IndexBuffer(device, sizeof(short) * 6, Usage.None, Pool.Managed, true);

            short[] Indices = new short[] {
                3,1,0,
                2,1,3
            };
            QuadIndexBuffer.Lock(0, 0, LockFlags.None).WriteRange(Indices);
            QuadIndexBuffer.Unlock();
        }
 static void FixScreenAlignedQuad()
 {
     float w = (1f / (float)device.Viewport.Width);
     float h = (1f / (float)device.Viewport.Height);
     UserVertex[] QuadVertices = new UserVertex[] {
     new UserVertex() { Position = new Vector3(-1f -w, -1f +h, 0f), TexturePosition = new Vector2(0f, 1f)},
     new UserVertex() { Position = new Vector3(1f -w, -1f +h, 0f), TexturePosition = new Vector2(1f, 1f)},
     new UserVertex() { Position = new Vector3(1f -w, 1f +h, 0f), TexturePosition = new Vector2(1f, 0f)},
     new UserVertex() { Position = new Vector3(-1f -w, 1f +h, 0f), TexturePosition = new Vector2(0f, 0f)},
     };
     DataStream VertexStream = QuadVertexBuffer.Lock(0, 0, LockFlags.None);
     VertexStream.Seek(0, System.IO.SeekOrigin.Begin);
     VertexStream.WriteRange(QuadVertices);
     QuadVertexBuffer.Unlock();
 }