Exemple #1
0
        /// <summary>
        /// Opens dialog to select file of extension
        /// </summary>
        /// <param name="__mode">Dialog mode</param>
        /// <param name="extension">The extension to filter files to</param>
        /// <param name="startPath">Initial file or directory to start selection from</param>
        /// <param name="comment">Aditional explanation</param>
        /// <param name="style">The style.</param>
        /// <param name="size">The size.</param>
        /// <returns>Selected path</returns>
        public static String openSelectFile(dialogSelectFileMode __mode, String extension = "*.*", String startPath = "", String comment = "", dialogStyle style = dialogStyle.redDialog, dialogSize size = dialogSize.fullScreenBox)
        {
            if (startPath == "")
            {
                startPath = appManager.Application.folder.path;
            }
            var format = new dialogFormatSettings(style, size);

            dialogSelectFile dialog = new dialogSelectFile(aceCommons.platform, startPath, __mode, extension, comment);

            inputResultCollection result = dialog.open(aceCommons.platform, format);

            FileSystemInfo defOutput;

            if (Path.HasExtension(startPath))
            {
                defOutput = new FileInfo(startPath);
            }
            else
            {
                defOutput = new DirectoryInfo(startPath);
            }

            defOutput = result.getResultObject <FileSystemInfo>(defOutput);

            return(defOutput.FullName);
        }
        public static inputResultCollection open(IPlatform platform, String __path, dialogSelectFileMode __mode, String __extension = ".*", String extraComment = "")
        {
            dialogSelectFile dialog = new dialogSelectFile(platform, __path, __mode, __extension, extraComment);

            var format = new dialogFormatSettings(dialogStyle.redDialog, dialogSize.mediumBox);

            return(dialog.open(platform, format));
        }