Exemplo n.º 1
0
        internal static string ToSerializedValue(this FilterFileType value)
        {
            switch (value)
            {
            case FilterFileType.AzureBlob:
                return("AzureBlob");

            case FilterFileType.AzureFile:
                return("AzureFile");
            }
            return(null);
        }
Exemplo n.º 2
0
        public static MvcHtmlString FilePicker(this HtmlHelper html, string name, FilterFileType filter, object htmlAttributes)
        {
            IDictionary <string, object> attrs = new RouteValueDictionary(htmlAttributes);

            var tag = new TagBuilder("input");

            tag.MergeAttribute("type", "file");
            tag.MergeAttribute("name", name);

            var accept = string.Empty;

            switch (filter)
            {
            case FilterFileType.AllFiles: break;

            case FilterFileType.Audio: accept = @"audio/*"; break;

            case FilterFileType.Video: accept = @"video/*"; break;

            case FilterFileType.Image: accept = @"image/*"; break;

            case FilterFileType.MIME_type: accept = @"MIME_type/*"; break;
            }

            if (filter != FilterFileType.AllFiles)
            {
                tag.MergeAttribute("accept", accept);
            }

            if (attrs.Any())
            {
                tag.MergeAttributes(attrs);
            }

            tag.MergeAttribute("data-buttonText", Resources.Empresa.Procurar);

            return(MvcHtmlString.Create(tag.ToString(TagRenderMode.SelfClosing)));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the FilterFileDetails class.
 /// </summary>
 /// <param name="filterFileType">Type of the filter file. Possible
 /// values include: 'AzureBlob', 'AzureFile'</param>
 /// <param name="filterFilePath">Path of the file that contains the
 /// details of all items to transfer.</param>
 public FilterFileDetails(FilterFileType filterFileType, string filterFilePath)
 {
     FilterFileType = filterFileType;
     FilterFilePath = filterFilePath;
     CustomInit();
 }
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="FilterFileType" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => FilterFileType.CreateFrom(sourceValue);