/// <summary>
 /// Constructs a new instance. Use this overload to select any resource type. If only
 /// folder selection is desired, set <see cref="SelectFoldersOnly"/> to true before
 /// showing the dialog
 /// </summary>
 /// <remarks>
 /// Use this overload if you need to present a resource picker with resource types not currently known or supported
 /// by the Maestro API
 /// </remarks>
 /// <param name="conn">The server connection</param>
 /// <param name="mode">The mode that the resource picker will be used in</param>
 /// <param name="allowedResourceTypes">The array of allowed resource types</param>
 public ResourcePicker(IServerConnection conn, ResourcePickerMode mode, string[] allowedResourceTypes)
     : this()
 {
     _conn     = conn;
     _resTypes = allowedResourceTypes;
     cmbResourceFilter.DataSource = _resTypes;
     repoView.Init(conn.ResourceService, true, false);
     repoView.ItemSelected += OnFolderSelected;
     this.UseFilter         = true;
     this.Mode              = mode;
     SetStartingPoint(LastSelectedFolder.FolderId);
 }
        /// <summary>
        /// Constructs a new instance. Use this overload to select only resources of a specific type.
        /// You cannot select folders in this mode. Attempting to set <see cref="SelectFoldersOnly"/> to
        /// true will throw an <see cref="InvalidOperationException"/>
        /// </summary>
        /// <remarks>
        /// Use this overload if you need to present a resource picker with resource types not currently known or supported
        /// by the Maestro API
        /// </remarks>
        /// <param name="conn">The server connection</param>
        /// <param name="resTypeFilter">The resource type to filter on</param>
        /// <param name="mode">The mode that the resource picker will be used in</param>
        /// <param name="allowedResourceTypes">The array of allowed resource types</param>
        public ResourcePicker(IServerConnection conn, string resTypeFilter, ResourcePickerMode mode, string[] allowedResourceTypes)
            : this(conn, mode, allowedResourceTypes)
        {
            if (mode == ResourcePickerMode.OpenFolder)
            {
                throw new InvalidOperationException(string.Format(Strings.ModeNotAllowed, mode));
            }

            this.Filter    = resTypeFilter;
            this.UseFilter = true;

            _resourceMode             = true;
            cmbResourceFilter.Enabled = false;
        }
 /// <summary>
 /// Constructs a new instance. Use this overload to select any resource type. If only
 /// folder selection is desired, set <see cref="SelectFoldersOnly"/> to true before
 /// showing the dialog
 /// </summary>
 /// <remarks>
 /// The list of allowed resource types will be inferred from the capabilities of the given connection instance
 /// </remarks>
 /// <param name="conn">The server connection</param>
 /// <param name="mode">The mode that the resource picker will be used in</param>
 public ResourcePicker(IServerConnection conn, ResourcePickerMode mode)
     : this(conn, mode, conn.Capabilities.SupportedResourceTypes)
 {
 }
 /// <summary>
 /// Constructs a new instance. Use this overload to select any resource type. If only
 /// folder selection is desired, set <see cref="SelectFoldersOnly"/> to true before
 /// showing the dialog
 /// </summary>
 /// <remarks>
 /// The list of allowed resource types will be inferred from the capabilities of the given connection instance
 /// </remarks>
 /// <param name="conn">The server connection</param>
 /// <param name="resTypeFilter">The resource type to filter on</param>
 /// <param name="mode">The mode that the resource picker will be used in</param>
 public ResourcePicker(IServerConnection conn, string resTypeFilter, ResourcePickerMode mode)
     : this(conn, resTypeFilter, mode, conn.Capabilities.SupportedResourceTypes)
 {
 }
Exemplo n.º 5
0
 /// <summary>
 /// Constructs a new instance. Use this overload to select any resource type. If only
 /// folder selection is desired, set <see cref="SelectFoldersOnly"/> to true before
 /// showing the dialog
 /// </summary>
 /// <param name="resSvc">The res SVC.</param>
 /// <param name="mode">The mode.</param>
 public ResourcePicker(IResourceService resSvc, ResourcePickerMode mode)
     : this()
 {
     _resSvc = resSvc;
     repoView.Init(resSvc, true, false);
     repoView.ItemSelected += OnFolderSelected;
     this.UseFilter = true;
     this.Mode = mode;
     SetStartingPoint(LastSelectedFolder.FolderId);
 }
Exemplo n.º 6
0
        /// <summary>
        /// Constructs a new instance. Use this overload to select only resources of a specific type.
        /// You cannot select folders in this mode. Attempting to set <see cref="SelectFoldersOnly"/> to
        /// true will throw an <see cref="InvalidOperationException"/>
        /// </summary>
        /// <param name="resSvc">The res SVC.</param>
        /// <param name="resFilter">The res filter.</param>
        /// <param name="mode">The mode.</param>
        public ResourcePicker(IResourceService resSvc, ResourceTypes resFilter, ResourcePickerMode mode)
            : this(resSvc, mode)
        {
            if (mode == ResourcePickerMode.OpenFolder)
                throw new InvalidOperationException(string.Format(Strings.ModeNotAllowed, mode));

            this.Filter = resFilter;
            this.UseFilter = true;

            _resourceMode = true;
            cmbResourceFilter.Enabled = false;
        }