/// <summary>Runs the dialog.</summary>
        /// <param name="hWndOwner">The h WND owner.</param>
        /// <returns></returns>
        /// <exception cref="System.InvalidOperationException">The Initialize method must be called before the dialog can be shown.</exception>
        protected override bool RunDialog(IntPtr hWndOwner)
        {
            if (iSecInfo == null && !string.IsNullOrEmpty(ObjectName) && ResourceType != ResourceType.Unknown)
            {
                Initialize(ObjectName, ServerName, ResourceType);
            }

            if (iSecInfo == null)
            {
                throw new InvalidOperationException("The Initialize method must be called before the dialog can be shown.");
            }

            var ret = iSecInfo.ShowDialog(hWndOwner, (SI_PAGE_TYPE)PageType);

            if (ret != null)
            {
                Result = ret;
            }
            return(ret != null);
        }
Exemple #2
0
        /// <summary>Runs the dialog.</summary>
        /// <param name="hWndOwner">The h WND owner.</param>
        /// <returns></returns>
        /// <exception cref="System.InvalidOperationException">
        /// The Initialize method must be called before the dialog can be shown.
        /// </exception>
        protected override bool RunDialog(IntPtr hWndOwner)
        {
            if (iSecInfo == null && !string.IsNullOrEmpty(ObjectName) && ResourceType != System.Security.AccessControl.ResourceType.Unknown)
            {
                Initialize(ObjectName, ServerName, ResourceType);
            }

            if (iSecInfo == null)
            {
                throw new InvalidOperationException("The Initialize method must be called before the dialog can be shown.");
            }

            var ret = iSecInfo.ShowDialog(hWndOwner, PageType);

            if (ret != null)
            {
#if DEBUG
                MessageBox.Show(ret.GetSddlForm(System.Security.AccessControl.AccessControlSections.All));
#endif
                Result = ret;
            }
            return(ret != null);
        }