コード例 #1
0
ファイル: WebProject.cs プロジェクト: Vic92548/BuckShot_Lang
        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
ファイル: WebProject.cs プロジェクト: Vic92548/BuckShot_Lang
 public string GetData(string FullKey)
 {
     return(WebDataStruct.FindDataFromFullKey(this.LocalData, FullKey).Value);
 }
コード例 #6
0
ファイル: WebProject.cs プロジェクト: Vic92548/BuckShot_Lang
        public void AddData(string FullKey, string Value)
        {
            WebDataStruct SearchedDataObj = WebDataStruct.FindDataFromFullKey(this.LocalData, FullKey);

            SearchedDataObj.Value = Value;
        }