コード例 #1
0
        public bool Contains(string key)
        {
            Validation.ArgumentNotNullOrEmpty(key, "key");

            var args = new ContainsKeyDataArgs();
            args.Key = key;
            args.SiteId = this.siteId;

            args.Level = (int) ConfigLevel.CurrentSPWebApplication;

            var result = SPUtility.ExecuteRegisteredProxyOperation(
                                    ContainsKeyDataArgs.OperationAssemblyName,
                                     ContainsKeyDataArgs.OperationTypeName,
                                     args);


            if (result != null && result.GetType().IsSubclassOf(typeof(System.Exception)))
            {
                var ex = new ConfigurationException(string.Format(CultureInfo.CurrentCulture,
                    Resources.UnexpectedExceptionFromSandbox, ConfigLevel.CurrentSPWebApplication.ToString()), (Exception)result);
                throw ex;
            }

            return (bool)result;
        }
コード例 #2
0
        public bool Contains(string key)
        {
            Validation.ArgumentNotNullOrEmpty(key, "key");

            var args = new ContainsKeyDataArgs();
            args.Key = key;
            args.Level = (int)ConfigLevel.CurrentSPFarm;

            var result = SPUtility.ExecuteRegisteredProxyOperation(
                                    ContainsKeyDataArgs.OperationAssemblyName,
                                     ContainsKeyDataArgs.OperationTypeName,
                                     args);

            if (result != null && result.GetType().IsSubclassOf(typeof(System.Exception)))
            {
                var exception = (Exception) result;
                ExceptionHelper.ThrowSandboxConfigurationException(exception, ConfigLevel.CurrentSPFarm);
            }

            return (bool)result;
        }