internal static FileDialogFilterBuilder GetProjectsFilter()
    {
      FileDialogFilterBuilder builder;

      builder = new FileDialogFilterBuilder();
      builder.Add("C# Projects", "*.csproj");
      builder.Add("Visual Basic Projects", "*.vbproj");
      builder.Add("C++ Projects", "*.vcproj;*.vcxproj");
      builder.Add("F# Projects", "*.fsproj");
      builder.AddAllFiles();

      return builder;
    }
        private static string CreateFilter(bool isLoad)
        {
            var filterBuilder = new FileDialogFilterBuilder();

            filterBuilder.Add("Project Files", string.Format("*{0}", defaultExtension));

            if (isLoad)
            {
                filterBuilder.Add("Legacy Project Files", "*.gifprj");
                filterBuilder.Add("XML Project Files", "*.xml");
                filterBuilder.AddAllFiles();
            }

            return(filterBuilder.ToString());
        }
        private void OnRenderToDisk()
        {
            var filterBuilder = new FileDialogFilterBuilder();

            filterBuilder.Add("GIF Image", "*.gif");

            var saveDialog = new SaveFileDialog
            {
                AddExtension       = true,
                AutoUpgradeEnabled = true,
                CheckPathExists    = true,
                DefaultExt         = ".gif",
                Filter             = filterBuilder.ToString(),
                OverwritePrompt    = true
            };

            if (!string.IsNullOrEmpty(outputFileName))
            {
                saveDialog.FileName = outputFileName;
            }

            var result = saveDialog.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                return;
            }

            outputFileName         = saveDialog.FileName;
            animator.TaskFinished += OnRenderToDiskFinished;
            RenderImpl();
        }
Esempio n. 4
0
        internal static FileDialogFilterBuilder GetProjectsFilter(ExtensionSettingsProjectCollection projectTypes)
        {
            FileDialogFilterBuilder builder;

            builder = new FileDialogFilterBuilder();

            foreach (string projectType in projectTypes)
            {
                int    endOfNamePosition;
                string projectName;
                string projectFilter;

                endOfNamePosition = projectType.IndexOf('|');
                if (endOfNamePosition == -1)
                {
                    projectName   = projectType;
                    projectFilter = projectType;
                }
                else
                {
                    projectName   = projectType.Substring(0, endOfNamePosition);
                    projectFilter = projectType.Substring(endOfNamePosition + 1);
                }

                builder.Add(projectName, projectFilter);
            }

            builder.AddAllFiles();

            return(builder);
        }