public static void Duplicate(AssetTypeFileExtension atfe) { // Reset ID to create new record atfe.AssetTypeFileExtensionId = null; // Set extension to extension prefixed with tilde // If we get two people editing extension at same time, // this will cause an error as the extension must be unique atfe.Extension = "~" + atfe.Extension.Substring(0, 4); // Make it invisible for now atfe.IsVisible = false; // Save it AssetTypeFileExtension.Update(atfe); }
public static void Save(AssetTypeFileExtension atfe, BinaryFile iconFile) { Validate(atfe, iconFile); if (iconFile.IsEmpty) { atfe.IconFilename = string.Empty; atfe.IconImage = ByteArray.Empty.ContentBytes; } else { atfe.IconFilename = iconFile.FileName; atfe.IconImage = ByteArray.New(iconFile.InputStream).ContentBytes; } AssetTypeFileExtension.Update(atfe); CacheManager.InvalidateCache("AssetTypeFileExtension", CacheType.All); CacheManager.InvalidateCache("AssetType", CacheType.All); }