Ejemplo n.º 1
0
        // If we ever want to make an implementation of IFile that we want in core,
        // like BasicFile for example then include it here...
        /// <summary>
        /// Creates an IFile instance of the specified file type.
        /// </summary>
        /// <param name="fileType">Type of the file.</param>
        /// <returns></returns>
        internal static IFile Create(FileType fileType)
        {
            IFile file = null;

            switch (fileType)
            {
#if !SILVERLIGHT
            case FileType.BasicFile:
                file = new BasicFile();
                break;
#else
            case FileType.SLFile:
                file = new SLFile();
                //file = ( MXDevice.Encryption.Required ? new SLFileEncrypted() : new SLFile() );
                break;
#endif
            default:
                // returns the default - BasicFile implementation
                break;
            }

            return(file);
        }
        // If we ever want to make an implementation of IFile that we want in core,
        // like BasicFile for example then include it here...
        /// <summary>
        /// Creates an IFile instance of the specified file type.
        /// </summary>
        /// <param name="fileType">Type of the file.</param>
        /// <returns></returns>
        internal static IFile Create(FileType fileType)
        {
            IFile file = null;

            switch (fileType)
            {
            #if !SILVERLIGHT
                case FileType.BasicFile:
                    file = new BasicFile();
                    file = (MXDevice.Encryption.Required ? new BasicFileEncrypted() : new BasicFile());
                    break;
            #else
                case FileType.SLFile:
                    file = new SLFile();
                    //file = ( MXDevice.Encryption.Required ? new SLFileEncrypted() : new SLFile() );
                    break;
            #endif
                default:
                    // returns the default - BasicFile implementation
                    break;
            }

            return file;
        }