예제 #1
0
        public void AddDataCat(string FullKey, string CatName)
        {
            WebDataStruct ParentCat = WebDataStruct.FindCategoryFromFullKey(this.LocalData, FullKey);
            WebDataStruct NewCat    = new WebDataStruct();

            NewCat.CatName = CatName;
            ParentCat.ChildsCategories.Add(NewCat);
        }
예제 #2
0
        public static WebDataStruct FindCategoryFromFullKey(WebDataStruct ParentData, string FullKey)
        {
            string[]      Args        = FullKey.Split('.');
            WebDataStruct CurrentData = ParentData;

            for (int i = 0; i < Args.Length - 2; i++)
            {
                CurrentData = WebDataStruct.FindCategory(CurrentData, Args[i]);
            }
            return(CurrentData);
        }
예제 #3
0
 public static WebDataStruct FindCategory(WebDataStruct ParentData, string SearchedCatName)
 {
     foreach (WebDataStruct LocalData in ParentData.ChildsCategories)
     {
         if (LocalData.CatName == SearchedCatName)
         {
             return(LocalData);
         }
     }
     throw new Exception("Category not found from FindCategory");
 }
예제 #4
0
        public static WebDataStruct FindDataFromFullKey(WebDataStruct ParentData, string FullKey)
        {
            string[]      KeyArgs  = FullKey.Split('.');
            WebDataStruct LocalCat = WebDataStruct.FindCategoryFromFullKey(ParentData, FullKey);

            foreach (WebDataStruct LocalData in LocalCat.ChildsData)
            {
                if (LocalData.Key == KeyArgs[KeyArgs.Length - 1])
                {
                    return(LocalData);
                }
            }
            throw new Exception("Data not found from FindDataFromFullKey");
        }
예제 #5
0
 public string GetData(string FullKey)
 {
     return(WebDataStruct.FindDataFromFullKey(this.LocalData, FullKey).Value);
 }
예제 #6
0
        public void AddData(string FullKey, string Value)
        {
            WebDataStruct SearchedDataObj = WebDataStruct.FindDataFromFullKey(this.LocalData, FullKey);

            SearchedDataObj.Value = Value;
        }