Ejemplo n.º 1
0
        /// <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("");
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
 private static bool CheckIsLocked(this FileObject fileObject, bool boolIncludeCurrentProcess = false)
 {
     return(false);
     //return FileFunctions.CheckIsFileLocked(fileObject.FilePath, ref strError, boolIncludeCurrentProcess);
 }
Ejemplo n.º 6
0
 private static string GetAttributeValue(this FileObject fileObject, PropertyKey propertyKey, PropertyDescriptionFormatOptions propertyFormat, ref string strError)
 {
     return("");
     //return FileFunctions.GetFileAttributeValue(fileObject.FilePath, propertyKey, propertyFormat, ref strError);
 }