コード例 #1
0
        public dialogSelectFile(IPlatform platform, String path, dialogSelectFileMode mode, String extension, String extraComment)
            : base(platform)
        {
            dialogFormatSettings format = new dialogFormatSettings(dialogStyle.blueDialog, dialogSize.fullScreenBox);

            format.apply(this, platform);

            selector             = new smartFilePathSelector(path, mode, extension, this.height, this.width, 0, 3);
            selector.doShowTitle = false;

            switch (mode)
            {
            case dialogSelectFileMode.selectFileToOpen:
                layoutTitleMessage = "Select file to open";
                break;

            case dialogSelectFileMode.selectFileToSave:
                layoutTitleMessage = "Select file to save";
                break;

            case dialogSelectFileMode.selectPath:
                layoutTitleMessage = "Select directory path";
                break;
            }

            layoutStatusMessage = extraComment;

            addLayer(selector, layerBlending.transparent, 100);

            init(platform);
        }
コード例 #2
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);
        }
コード例 #3
0
        public smartScreenFileSelector(T __app, string __title, String __path, dialogSelectFileMode __mode, String __extension)
            : base(__app, __title)
        {
            filePathSection = new smartFilePathSelector(__path, __mode, __extension, application.platform.height,
                                                        application.platform.width, 0, 0);

            init(__app.platform);
        }
コード例 #4
0
        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));
        }
コード例 #5
0
 public smartFilePathSelector(String __path, dialogSelectFileMode __mode, String __ext, int _height, int __width, int __leftRightMargin = 0, int __leftRightPadding = 0) : base(new aceMenu(), _height, __width, __leftRightMargin, __leftRightPadding)
 {
     path          = __path;
     selectMode    = __mode;
     extension     = __ext;
     margin.top    = 1;
     margin.bottom = 2;
     pageManager   = new textPageManager <aceMenuItem>();
     refresh();
 }
コード例 #6
0
ファイル: fileSystemList.cs プロジェクト: gorangrubic/imbACE
        public fileSystemList(String path, dialogSelectFileMode mode, String extension = "")
        {
            if (String.IsNullOrEmpty(path))
            {
                var pt = Directory.GetCurrentDirectory();
                path = Environment.CurrentDirectory;
            }

            rootDirectory = new DirectoryInfo(path);

            if (rootDirectory.Exists)
            {
                selfPopulate(mode, extension);
            }
        }
コード例 #7
0
ファイル: fileSystemList.cs プロジェクト: gorangrubic/imbACE
        protected void selfPopulate(dialogSelectFileMode mode, String extension)
        {
            pattern = "*".add(extension, ".");

            directories.Clear();
            files.Clear();
            if (rootDirectory != null)
            {
                directories.Add(rootDirectory);
            }
            if (rootDirectory.Parent != null)
            {
                directories.Add(rootDirectory.Parent);
            }


            switch (mode)
            {
            case dialogSelectFileMode.selectPath:
                foreach (var d in rootDirectory.EnumerateDirectories("*", SearchOption.TopDirectoryOnly))
                {
                    directories.Add(d);
                }
                break;

            case dialogSelectFileMode.selectFileToOpen:
            case dialogSelectFileMode.selectFileToSave:
                foreach (var d in rootDirectory.EnumerateDirectories("*", SearchOption.TopDirectoryOnly))
                {
                    directories.Add(d);
                }
                foreach (var d in rootDirectory.EnumerateFiles(pattern, SearchOption.TopDirectoryOnly))
                {
                    files.Add(d);
                }
                break;
            }
        }