Update ...

This commit is contained in:
2026-10-22 23:30:09 +03:30
parent e9dd3b78f2
commit d0234fef2c
4 changed files with 10 additions and 153 deletions
-140
View File
@@ -1,140 +0,0 @@
using xExceptions.Attributes;
namespace xStorageService.Constants {
public enum FileExtensions {
//
// Document
[StringValue (".txt")]
TEXT = 100,
[StringValue (".pdf")]
PDF = 101,
[StringValue (".ppt")]
PPT = 102,
[StringValue (".pptx")]
PPTX = 103,
[StringValue (".odp")]
ODP = 104,
[StringValue (".pps")]
PPS = 105,
[StringValue (".ods")]
ODS = 106,
[StringValue (".xlr")]
XLR = 107,
[StringValue (".xls")]
XLS = 108,
[StringValue (".xlsx")]
XLSX = 109,
[StringValue (".xml")]
XML = 110,
[StringValue (".doc")]
DOC = 111,
[StringValue (".docx")]
DOCX = 112,
[StringValue (".odt")]
ODT = 113,
[StringValue (".rtf")]
RTF = 114,
[StringValue (".tex")]
TEX = 115,
[StringValue (".wpd")]
WPD = 116,
[StringValue (".md")]
MD = 117,
//
// Archive
[StringValue (".zip")]
ZIP = 200,
//
// Internal Supports
[StringValue (".ttf")]
TTF = 300,
[StringValue (".js")]
JAVASCRIPT = 301,
[StringValue (".css")]
CSS = 302,
[StringValue (".htm")]
HTM = 303,
[StringValue (".html")]
HTML = 304,
[StringValue (".sdw")]
SAHER_DASHBOARD_WIDGET = 305,
[StringValue (".sdwmanifest")]
SAHER_DASHBOARD_WIDGET_MANIFEST = 306,
//
// Video
[StringValue (".mp4")]
MP4 = 400,
[StringValue (".avi")]
AVI = 401,
[StringValue (".mpg")]
MPG = 402,
[StringValue (".mpeg")]
MPEG = 403,
[StringValue (".wmv")]
WMV = 404,
//
// Audio
[StringValue (".mp3")]
MP3 = 500,
[StringValue (".ogg")]
OGG = 501,
[StringValue (".wav")]
WAV = 502,
[StringValue (".wma")]
WMA = 503,
//
// Image
[StringValue (".png")]
PNG = 600,
[StringValue (".jpeg")]
JPEG = 601,
[StringValue (".jpg")]
JPG = 602,
// [StringValue (".ico")]
// ICON = 603,
[StringValue (".gif")]
GIF = 604,
[StringValue (".bmp")]
BITMAP = 605,
}
}
+3 -4
View File
@@ -4,7 +4,6 @@ using System.Linq;
using xCommons.Constants; using xCommons.Constants;
using xCommons.Extensions; using xCommons.Extensions;
using xExceptions.Constants; using xExceptions.Constants;
using xStorageService.Constants;
namespace xStorageService.Helpers { namespace xStorageService.Helpers {
public partial class XStorageHelper { public partial class XStorageHelper {
@@ -63,7 +62,7 @@ namespace xStorageService.Helpers {
/// <returns>an string array</returns> /// <returns>an string array</returns>
public string[] GetAllowedExtensionsForWidgetUpload () { public string[] GetAllowedExtensionsForWidgetUpload () {
return new [] { return new [] {
FileExtensions.SAHER_DASHBOARD_WIDGET.GetStringValue () XFileExtensions.SAHER_DASHBOARD_WIDGET.GetStringValue ()
}; };
} }
@@ -120,8 +119,8 @@ namespace xStorageService.Helpers {
public int GetExtensionType (string fileExtension) { public int GetExtensionType (string fileExtension) {
// //
foreach (var extItem in Enum foreach (var extItem in Enum
.GetValues (typeof (FileExtensions)) .GetValues (typeof (XFileExtensions))
.Cast<FileExtensions> ()) { .Cast<XFileExtensions> ()) {
if (extItem.GetStringValue () if (extItem.GetStringValue ()
.Contains (fileExtension.ToLower ())) { .Contains (fileExtension.ToLower ())) {
return (int) extItem; return (int) extItem;
+2 -3
View File
@@ -6,7 +6,6 @@ using System.Threading.Tasks;
using xStorageService.Models; using xStorageService.Models;
using xStorageService.Helpers; using xStorageService.Helpers;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using xStorageService.Constants;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.FileProviders;
@@ -63,9 +62,9 @@ namespace xStorageService.Interfaces
string GetFileExtension(string fileName); string GetFileExtension(string fileName);
string GetFileNameWithoutExtension(string fileName); string GetFileNameWithoutExtension(string fileName);
FileExtensions GetFileExtensionType(string fileName); XFileExtensions GetFileExtensionType(string fileName);
XFileType GetFileType(string fileName); XFileType GetFileType(string fileName);
XFileType GetFileType(FileExtensions fileExtension); XFileType GetFileType(XFileExtensions fileExtension);
string GetThumbnailFileFullPath(string thumFileName); string GetThumbnailFileFullPath(string thumFileName);
string GetRelatedThumbnailFullPath(string fileName); string GetRelatedThumbnailFullPath(string fileName);
string GetFileTypeFolderPath(XFileType type); string GetFileTypeFolderPath(XFileType type);
+3 -4
View File
@@ -10,7 +10,6 @@ using System.Threading.Tasks;
using xStorageService.Models; using xStorageService.Models;
using xStorageService.Helpers; using xStorageService.Helpers;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using xStorageService.Constants;
using System.Collections.Generic; using System.Collections.Generic;
using xStorageService.Interfaces; using xStorageService.Interfaces;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
@@ -522,7 +521,7 @@ namespace xStorageService.Providers
/// </summary> /// </summary>
/// <param name="fileName"></param> /// <param name="fileName"></param>
/// <returns></returns> /// <returns></returns>
public FileExtensions GetFileExtensionType(string fileName) public XFileExtensions GetFileExtensionType(string fileName)
{ {
// //
var fileExt = GetFileExtension(fileName); var fileExt = GetFileExtension(fileName);
@@ -539,7 +538,7 @@ namespace xStorageService.Providers
} }
// //
return (FileExtensions)result; return (XFileExtensions)result;
} }
/// <summary> /// <summary>
@@ -559,7 +558,7 @@ namespace xStorageService.Providers
/// </summary> /// </summary>
/// <param name="fileExtension"></param> /// <param name="fileExtension"></param>
/// <returns></returns> /// <returns></returns>
public XFileType GetFileType(FileExtensions fileExtension) public XFileType GetFileType(XFileExtensions fileExtension)
{ {
return StorageHelper.GetType((int)fileExtension); return StorageHelper.GetType((int)fileExtension);
} }