/// <summary> /// Retrieve a filename without file extension /// </summary> /// <param name="fileObject">Filename to retrieve name without extension from</param> /// <returns></returns> internal static string GetNameWithOutExtenstion(this FileObject fileObject) { try { // Get File Name Without Extension string strFileName = System.IO.Path.GetFileNameWithoutExtension(fileObject.FilePath); return(strFileName); } catch (Exception ex) { // To Be Implemented: Throw Custom Exception... Console.WriteLine(ex.ToString()); return(""); } }
private static Globals.ResultType Encrypt(this FileObject fileObject) { try { System.IO.File.Encrypt(fileObject.FilePath); // Refresh File Object fileObject.Refresh(); return(Globals.ResultType.Success); } catch (Exception ex) { // To Be Implemented: Throw Custom Exception... Console.WriteLine(ex.ToString()); return(Globals.ResultType.Failure); } }
private static IShellProperty GetAttribute(this FileObject fileObject, PropertyKey propertyKey, ref string strError) { try { // Get File Attribute ShellObject objFile = ShellObject.FromParsingName(fileObject.FilePath); // Get File Property IShellProperty attribute = objFile.Properties.GetProperty(propertyKey); return(attribute); } catch (Exception ex) { // To Be Implemented: Throw Custom Exception... Console.WriteLine(ex.ToString()); return(null); } }
private static Globals.ResultType SetAttributes(this FileObject fileObject, System.IO.FileAttributes fileAttributes) { try { // Set File Attributes System.IO.File.SetAttributes(fileObject.FilePath, fileAttributes); // Refresh File Object fileObject.Refresh(); return(Globals.ResultType.Success); } catch (Exception ex) { // To Be Implemented: Throw Custom Exception... Console.WriteLine(ex.ToString()); return(Globals.ResultType.Failure); } }
private static bool CheckIsLocked(this FileObject fileObject, bool boolIncludeCurrentProcess = false) { return(false); //return FileFunctions.CheckIsFileLocked(fileObject.FilePath, ref strError, boolIncludeCurrentProcess); }
private static string GetAttributeValue(this FileObject fileObject, PropertyKey propertyKey, PropertyDescriptionFormatOptions propertyFormat, ref string strError) { return(""); //return FileFunctions.GetFileAttributeValue(fileObject.FilePath, propertyKey, propertyFormat, ref strError); }