Пример #1
0
        /// <summary>
        /// Creates an instance of the dialog pointed to backup data in the specified directory.
        /// </summary>
        /// <param name="backupDirectory">The backup directory.</param>
        /// <param name="backupFileName">Name of the backup file to identify valid backup subdirectories.</param>
        /// <param name="fileExtensions">If <paramref name="showItemsCount"/> is <c>true</c>, these file extensions are used to identify the number of backed up items in the backup directory.</param>
        /// <param name="showItemsCount">If <c>true</c>, include item count in selection dialog.</param>
        /// <returns>A new instance of the dialog.</returns>
        public static SelectBackupDialog Create(string backupDirectory, string backupFileName, IEnumerable <string> fileExtensions, bool showItemsCount)
        {
            var controller = new SelectBackupDialogController();

            controller.Initialize(backupDirectory, backupFileName, fileExtensions, showItemsCount);
            var window = controller.Window;

            return(window);
        }
Пример #2
0
        /// <inheritdoc/>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (Controller != null))
            {
                Controller.Dispose();
                Controller = null;
            }

            // MonoMac has some problems w/ lifetime. This was an attempt to prevent leaking dialogs.
            // However, there are cases that result in over-release that are not easily identified.
            // So, leak it is! :(
            // base.Dispose(disposing);
        }