コード例 #1
0
ファイル: FileFactory.cs プロジェクト: pdougla002/iFactr-UI
        /// <summary>
        /// Creates an IFile instance.
        /// </summary>
        /// <returns></returns>
        internal static IFile Create()
        {
#if !SILVERLIGHT
            IFile file = new BasicFile();
#else
            IFile file = (MXDevice.Encryption.Required ? new SLFileEncrypted() : new SLFile());
#endif
            return(file);
        }
コード例 #2
0
ファイル: ConsoleDevice.cs プロジェクト: pdougla002/iFactr-UI
        public override void Initialize()
        {
            DirectorySeparatorChar = Path.DirectorySeparatorChar;
            File            = new Storage.BasicFile();
            ApplicationPath = File.DirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar;
            DataPath        = System.Configuration.ConfigurationManager.AppSettings.AllKeys.Contains("dataPath") ?
                              System.Configuration.ConfigurationManager.AppSettings.Get("dataPath") :
                              "%LOCALAPPDATA%\\ITRMobility";
            DataPath = Environment.ExpandEnvironmentVariables(DataPath);

            Thread = new MonoCross.Utilities.Threading.TaskThread
            {
                UiSynchronizationContext = System.Threading.SynchronizationContext.Current
            };

            Encryption = new Encryption.AesEncryption();
            Log        = new Logging.BasicLogger(Path.Combine(SessionDataPath, "Log"));
            Resources  = new Resources.WindowsResources();
            Reflector  = new BasicReflector();
            Platform   = MobilePlatform.Windows;
        }
コード例 #3
0
ファイル: FileFactory.cs プロジェクト: pdougla002/iFactr-UI
        // 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);
        }
コード例 #4
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();
                    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;
        }