/// <summary>
        /// Opens the RtfDocument and initialises the data cache. If the data cache is
        /// set to CACHE_DISK, but the cache cannot be initialised then the memory cache
        /// is used.
        /// </summary>
        public void Open()
        {
            try
            {
                switch (_documentSettings.GetDataCacheStyle())
                {
                case RtfDataCache.CACHE_MEMORY_EFFICIENT:
                    _data = new RtfEfficientMemoryCache();
                    break;

                case RtfDataCache.CACHE_MEMORY:
                    _data = new RtfMemoryCache();
                    break;

                case RtfDataCache.CACHE_DISK:
                    _data = new RtfDiskCache();
                    break;

                default:
                    throw new ArgumentException("unknown");
                }
            }
            catch (IOException)
            {
                _data = new RtfMemoryCache();
            }
        }
Esempio n. 2
0
 /**
  * The default constructor for a RtfDocument
  */
 public RtfDocument() : base(null)
 {
     this.data           = new RtfMemoryCache();
     this.mapper         = new RtfMapper(this);
     this.documentHeader = new RtfDocumentHeader(this);
     this.documentHeader.Init();
     this.previousRandomInts = new ArrayList();
     this.documentSettings   = new RtfDocumentSettings(this);
 }
Esempio n. 3
0
        /**
         * Opens the RtfDocument and initialises the data cache. If the data cache is
         * set to CACHE_DISK, but the cache cannot be initialised then the memory cache
         * is used.
         */
        public void Open()
        {
            try {
                switch (this.documentSettings.GetDataCacheStyle())
                {
                case RtfDataCache.CACHE_MEMORY: this.data = new RtfMemoryCache(); break;

                case RtfDataCache.CACHE_DISK: this.data = new RtfDiskCache(); break;
                }
            } catch (IOException) {
                this.data = new RtfMemoryCache();
            }
        }
Esempio n. 4
0
        /**
         * Opens the RtfDocument and initialises the data cache. If the data cache is
         * set to CACHE_DISK, but the cache cannot be initialised then the memory cache
         * is used.
         */
        public void Open()
        {
            try {
                switch (this.documentSettings.GetDataCacheStyle())
                {
                case RtfDataCache.CACHE_MEMORY_EFFICIENT:
                    this.data = new RtfEfficientMemoryCache();
                    break;

                case RtfDataCache.CACHE_MEMORY:
                    this.data = new RtfMemoryCache();
                    break;

                case RtfDataCache.CACHE_DISK:
                    this.data = new RtfDiskCache();
                    break;

                default:
                    throw new ArgumentException(MessageLocalization.GetComposedMessage("unknown"));
                }
            } catch (IOException) {
                this.data = new RtfMemoryCache();
            }
        }
Esempio n. 5
0
 /**
 * Opens the RtfDocument and initialises the data cache. If the data cache is
 * set to CACHE_DISK, but the cache cannot be initialised then the memory cache
 * is used.
 */
 public void Open()
 {
     try {
         switch (this.documentSettings.GetDataCacheStyle()) {
             case RtfDataCache.CACHE_MEMORY_EFFICIENT:
                 this.data = new RtfEfficientMemoryCache();
                 break;
             case RtfDataCache.CACHE_MEMORY:
                 this.data = new RtfMemoryCache();
                 break;
             case RtfDataCache.CACHE_DISK:
                 this.data = new RtfDiskCache();
                 break;
             default:
                 throw new ArgumentException("unknown");
         }
     } catch (IOException) {
         this.data = new RtfMemoryCache();
     }
 }
Esempio n. 6
0
 /**
 * The default constructor for a RtfDocument
 */
 public RtfDocument()
     : base(null)
 {
     this.data = new RtfMemoryCache();
     this.mapper = new RtfMapper(this);
     this.documentHeader = new RtfDocumentHeader(this);
     this.documentHeader.Init();
     this.previousRandomInts = new ArrayList();
     this.documentSettings = new RtfDocumentSettings(this);
 }
Esempio n. 7
0
 /**
 * Opens the RtfDocument and initialises the data cache. If the data cache is
 * set to CACHE_DISK, but the cache cannot be initialised then the memory cache
 * is used.
 */
 public void Open()
 {
     try {
         switch(this.documentSettings.GetDataCacheStyle()) {
             case RtfDataCache.CACHE_MEMORY : this.data = new RtfMemoryCache();break;
             case RtfDataCache.CACHE_DISK   : this.data = new RtfDiskCache();break;
         }
     } catch(IOException) {
         this.data = new RtfMemoryCache();
     }
 }