예제 #1
0
        /// <summary>
        /// Check if a site is closed
        /// </summary>
        /// <param name="web">Web to operate on</param>
        /// <returns>True if site is closed, false otherwise</returns>
        public static bool IsClosedBySitePolicy(this Web web)
        {
            var isClosed = ProjectPolicy.IsProjectClosed(web.Context, web);

            web.Context.ExecuteQueryRetry();
            return(isClosed.Value);
        }
예제 #2
0
        /// <summary>
        /// Check if a site is closed
        /// </summary>
        /// <param name="web">Web to operate on</param>
        /// <returns>True if site is closed, false otherwise</returns>
        private static async Task <bool> IsClosedBySitePolicyImplementation(this Web web)
        {
            var isClosed = ProjectPolicy.IsProjectClosed(web.Context, web);
            await web.Context.ExecuteQueryRetryAsync();

            return(isClosed.Value);
        }
예제 #3
0
        private static async Task <bool> IsClosedBySitePolicyImplementation(this Web web)
#endif
        {
            var isClosed = ProjectPolicy.IsProjectClosed(web.Context, web);

#if ONPREMISES
            web.Context.ExecuteQueryRetry();
#else
            await web.Context.ExecuteQueryRetryAsync();
#endif
            return(isClosed.Value);
        }