示例#1
0
        public static PolicyLevel LoadPolicyLevelFromString(string str, PolicyLevelType type)
        {
            if (null == str)
            {
                throw new ArgumentNullException("str");
            }

            PolicyLevel pl = null;

            try {
                pl = new PolicyLevel(type.ToString(), type);
                pl.LoadFromString(str);
            }
            catch (Exception e) {
                throw new ArgumentException(Locale.GetText("Invalid policy XML"), e);
            }
            return(pl);
        }
示例#2
0
        public static PolicyLevel LoadPolicyLevelFromFile(string path, PolicyLevelType type)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }

            PolicyLevel pl = null;

            try {
                pl = new PolicyLevel(type.ToString(), type);
                pl.LoadFromFile(path);
            }
            catch (Exception e) {
                throw new ArgumentException(Locale.GetText("Invalid policy XML"), e);
            }
            return(pl);
        }
示例#3
0
		public static PolicyLevel LoadPolicyLevelFromString (string str, PolicyLevelType type)
		{
			if (null == str)
				throw new ArgumentNullException ("str");

			PolicyLevel pl = null;
			try {
				pl = new PolicyLevel (type.ToString (), type);
				pl.LoadFromString (str);
			}
			catch (Exception e) {
				throw new ArgumentException (Locale.GetText ("Invalid policy XML"), e);
			}
			return pl;
		}
示例#4
0
		public static PolicyLevel LoadPolicyLevelFromFile (string path, PolicyLevelType type)
		{
			if (path == null)
				throw new ArgumentNullException ("path");

			PolicyLevel pl = null;
			try {
				pl = new PolicyLevel (type.ToString (), type);
				pl.LoadFromFile (path);
			}
			catch (Exception e) {
				throw new ArgumentException (Locale.GetText ("Invalid policy XML"), e);
			}
			return pl;
		}