Esempio n. 1
0
        public string GetFile(string title, string startingFolder,
                              FileDialogFilterCollection filters = null)
        {
            this.title          = title;
            this.startingFolder = startingFolder;
            this.filters        = filters;

            // these are the pre-set values
            // selectingFolder = false;
            // multiselect = false;
            // showPlacesList = true;
            // allowNonFileSysItems = false;
            // allowPropertyEditing = false;

            if (!SelectFileOrFolder())
            {
                hasSelection = false;
                return(null);
            }

            return(cfd.FileName);
        }
 /// <inheritdoc />
 public override void CreateCommandContentForElement(ICommandPresentationContext context)
 {
     base.CreateCommandContentForElement(context);
     // This entrypoint can be used to add commands for any selectable item in the UI.
     // In this case, we own the ViewModel, so could do it in that class, but are showing
     // here as an example and to keep these commands separate.
     if (context.IsSingleSelect <PulseWidthModulationControlViewModel>())
     {
         using (context.AddConfigurationPaneContent())
         {
             // These are for the individual expandable sections...can make your own or use ours.
             using (context.AddGroup(ConfigurationPaneCommands.BehaviorGroupCommand))
             {
                 // Use a command with a UIType, or use/customize the factory yourself
                 context.Add(CheckBoxCommand);
                 ////context.Add(CheckBoxCommand, CheckBoxFactory.ForConfigurationPane);
                 ////context.Add(CheckBoxCommand, ToggleButtonFactory.ForConfigurationPane);
                 context.Add(TextBoxCommand);
                 var filters = new FileDialogFilterCollection();
                 filters.Add(new FileDialogFilter()
                 {
                     Extensions = new[] { "jpg", "png" }, Label = "Image Files"
                 });
                 context.Add(PathCommand, new PathSelectorFactory()
                 {
                     Filters = filters
                 });
                 ////context.Add(TextBoxCommand, TextBoxFactory.ForConfigurationPane);
                 ////context.Add(TextBoxCommand, StaticTextFactory.ForConfigurationPane);
                 context.Add(NumericCommand, new NumericTextBoxFactory(NITypes.Double));
                 context.Add(ColorCommand, new ColorBoxFactory {
                     ColorOnly = false, ShowMoreColors = true
                 });
                 context.AddContentFontEditor(null, true);
             }
         }
     }
 }
Esempio n. 3
0
 internal FileDialog()
 {
     filters = new FileDialogFilterCollection (AddRemoveItem);
     backendHost = new BackendHost<FileDialog,IFileDialogBackend> ();
     backendHost.Parent = this;
 }
Esempio n. 4
0
        public DefaultFileSelectorBackend()
        {
            filters = new FileDialogFilterCollection (null);

            var box = new HBox ();
            entry = new TextEntry ();
            entry.Changed += (sender, e) => NotifyFileChange ();
            box.PackStart (entry, true);

            var btn = new Button ("...");
            box.PackStart (btn);
            btn.Clicked += BtnClicked;
            Content = box;
        }
Esempio n. 5
0
		public SaveFileDialog ()
		{
			filters = new FileDialogFilterCollection (AddRemoveItem);
		}
Esempio n. 6
0
 internal FileDialog()
 {
     filters = new FileDialogFilterCollection (AddRemoveItem);
 }