예제 #1
0
        public static async Task <curoLists> CreateFromParseObject(ParseObject parseObject)
        {
            return(await Task.Run <curoLists>(() =>
            {
                var mlist = new curoLists();

                mlist.Title = parseObject.ObjectId;
                if (parseObject.ContainsKey("title"))
                {
                    mlist.Title = (string)parseObject["title"];
                }


                if (parseObject.ContainsKey("description"))
                {
                    mlist.Description = (string)parseObject["description"];
                }
                if (parseObject.ContainsKey("image"))
                {
                    mlist.ImagePath = (string)parseObject["image"];


                    //         Image src = new Image();
                    //  mlist.curoImage = ImagePath;
                }


                if (parseObject.ContainsKey("unread"))


                {
                    Color currentAccentColorHex = (Color)Application.Current.Resources["PhoneAccentColor"];

                    Boolean isUnread = (bool)parseObject["unread"];
                    if (isUnread == true)
                    {
                        mlist.MessageColour = currentAccentColorHex;
                    }
                    else
                    {
                        mlist.MessageColour = currentAccentColorHex;
                    }
                    mlist.Unread = isUnread;
                }


                if (parseObject.ContainsKey("type"))
                {
                    string mtype = (string)parseObject["type"];

                    if (mtype == "N")
                    {
                        mlist.Type = "Notes";
                        mlist.ViewToUse = "Notes.Xaml";
                    }
                }
                return mlist;
            }));
        }
예제 #2
0
파일: curoLists.cs 프로젝트: cmsni/curouap
            public static async Task<curoLists> CreateFromParseObject(ParseObject parseObject)
            {
                return await Task.Run<curoLists>(() =>
                {
                    var mlist = new curoLists();

                    mlist.Title = parseObject.ObjectId;
                    if (parseObject.ContainsKey("title"))
                    {
                        mlist.Title = (string)parseObject["title"];
                    }


                    if (parseObject.ContainsKey("description"))
                    {
                        mlist.Description = (string)parseObject["description"];
                    }
                    if (parseObject.ContainsKey("image"))
                    {
                        mlist.ImagePath = (string)parseObject["image"];


               //         Image src = new Image();
                      //  mlist.curoImage = ImagePath;
                    }


                    if (parseObject.ContainsKey("unread"))


                    {

                        Color currentAccentColorHex = (Color)Application.Current.Resources["PhoneAccentColor"];

                        Boolean isUnread = (bool) parseObject["unread"];
                        if (isUnread == true)
                        {
                            mlist.MessageColour =currentAccentColorHex;
                        }
                        else
                        {
                            mlist.MessageColour = currentAccentColorHex;
                        }
                            mlist.Unread = isUnread;
                      

                    }


                    if (parseObject.ContainsKey("type"))
                    {
                        string mtype = (string)parseObject["type"];

                        if (mtype == "N")
                        {
                            mlist.Type = "Notes";
                            mlist.ViewToUse = "Notes.Xaml";
                        }
                    }
                    return mlist;
                });
            }