コード例 #1
0
        /// <summary>
        /// Checks whether columns can be restored.
        /// </summary>
        /// <param name="subject">Target ManagementList.</param>
        /// <param name="callback">RetryActionAfterLoaded callback method.</param>
        /// <returns>True iff columns restorable.</returns>
        /// <exception cref="InvalidOperationException">
        /// ManagementList.AutoGenerateColumns not supported.
        /// </exception>
        private static bool VerifyColumnsRestorable(ManagementList subject, RetryActionCallback <ManagementList> callback)
        {
            if (WpfHelp.RetryActionAfterLoaded <ManagementList>(subject, callback, subject))
            {
                return(false);
            }

            if (WpfHelp.RetryActionAfterLoaded <ManagementList>(subject.List, callback, subject))
            {
                return(false);
            }

            if (subject.List == null)
            {
                return(false);
            }

            // Columns are not savable/restorable if AutoGenerateColumns is true.
            if (subject.List.AutoGenerateColumns)
            {
                throw new InvalidOperationException("View Manager is not supported when AutoGenerateColumns is set.");
            }

            return(true);
        }
コード例 #2
0
        private static bool VerifyRulesSavableAndRestorable(ManagementList subject, RetryActionCallback <ManagementList> callback)
        {
            if (WpfHelp.RetryActionAfterLoaded <ManagementList>(subject, callback, subject))
            {
                return(false);
            }

            if (subject.AddFilterRulePicker == null)
            {
                return(false);
            }

            if (subject.FilterRulePanel == null)
            {
                return(false);
            }

            if (subject.SearchBox == null)
            {
                return(false);
            }

            return(true);
        }