Пример #1
0
        public static RowShareUser LoadUser(string userName, string password)
        {
            var json   = RowShareCommunication.GetData("user", userName, password);
            var rsUser = JsonUtilities.Deserialize <RowShareUser>(json, Utility.DefaultOptions);

            return(rsUser);
        }
Пример #2
0
        public static Collection <Row> GetRowsByListId(string id)
        {
            string url  = string.Format(CultureInfo.CurrentCulture, "row/loadForParent/{0}", id);
            string json = RowShareCommunication.GetData(url);

            return(JsonUtilities.Deserialize <Collection <Row> >(json, Utility.DefaultOptions));
        }
Пример #3
0
        public static Row GetRowById(string id)
        {
            string url  = string.Format(CultureInfo.CurrentCulture, "/row/load/{0}", id);
            string json = RowShareCommunication.GetData(url);

            return(JsonUtilities.Deserialize <Row>(json, Utility.DefaultOptions));
        }
Пример #4
0
        public static Column GetColumnById(string id)
        {
            string url  = string.Format(CultureInfo.CurrentCulture, "/column/load/", id);
            string json = RowShareCommunication.GetData(url);

            return(JsonUtilities.Deserialize <Column>(json));
        }
Пример #5
0
        public static Collection <Column> GetColumnsByListId(string id)
        {
            string url  = string.Format(CultureInfo.CurrentCulture, "/column/loadForParent/{0}", id);
            string json = RowShareCommunication.GetData(url);

            return(JsonUtilities.Deserialize <Collection <Column> >(json));
        }
Пример #6
0
        public static List GetListById(string id)
        {
            string url  = string.Format(CultureInfo.CurrentCulture, "list/load/{0}", id);
            string json = RowShareCommunication.GetData(url);

            return(JsonUtilities.Deserialize <List>(json));
        }
Пример #7
0
        public static Folder GetFolderById(string id)
        {
            if (id == null)
            {
                return(null);
            }

            string url  = string.Format(CultureInfo.CurrentCulture, "folder/load/{0}", id.ToString().Replace("-", ""));
            string json = RowShareCommunication.GetData(url);

            return(JsonUtilities.Deserialize <Folder>(json, Utility.DefaultOptions));
        }
Пример #8
0
        public Collection <List> LoadFavoriteLists()
        {
            var json     = RowShareCommunication.GetData("userlistlink/loadall");
            var favList  = JsonUtilities.Deserialize <Collection <FavoriteList> >(json, Utility.DefaultOptions);
            var toReturn = new Collection <List>();

            foreach (var fav in favList)
            {
                if (fav.IsFavorite)
                {
                    toReturn.Add(fav.List);
                }
            }
            return(toReturn);
        }
Пример #9
0
        public void LoadContent(bool recursively = false)
        {
            string url  = string.Format(CultureInfo.CurrentCulture, "list/loadforparent/{0}", Id.ToString().Replace("-", ""));
            string json = RowShareCommunication.GetData(url);

            ContainingLists = JsonUtilities.Deserialize <Collection <List> >(json, Utility.DefaultOptions);

            url  = string.Format(CultureInfo.CurrentCulture, "folder/loadforparent/{0}", Id.ToString().Replace("-", ""));
            json = RowShareCommunication.GetData(url);
            ContainingFolders = JsonUtilities.Deserialize <Collection <Folder> >(json, Utility.DefaultOptions);
            if (recursively)
            {
                foreach (var folder in ContainingFolders)
                {
                    folder.LoadContent(recursively);
                }
            }
        }