Beispiel #1
0
        public static GreyFoxSetting GetSetting(GreyFoxSetting parent, string key)
        {
            GreyFoxSettingManager    settingManager;
            GreyFoxSettingCollection settingCollection;

            settingManager = new GreyFoxSettingManager();

            if (parent == null)
            {
                settingCollection = settingManager.GetCollection("Name='" +
                                                                 key + "'", string.Empty, null);
            }
            else
            {
                settingCollection = settingManager.GetCollection("ParentID=" +
                                                                 parent.ID.ToString() +
                                                                 " AND Name='" +
                                                                 key + "'", string.Empty, null);
            }

            if (settingCollection.Count == 1)
            {
                return(settingCollection[0]);
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
        public static GreyFoxSettingCollection GetSettings(string parentKey)
        {
            GreyFoxSettingManager settingManager =
                new GreyFoxSettingManager();
            GreyFoxSettingCollection settingCollection =
                settingManager.GetCollection("GreyFoxSetting.Name='" +
                                             parentKey + "'", "GreyFoxSetting.Name", GreyFoxSettingFlags.Parent);

            return(settingCollection);
        }