Exemplo n.º 1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="PlainTextImporter"/> class.
		/// </summary>
		public PlainTextImporter()
		{
			this.m_dirInfo = new DirInfo(string.Empty, string.Empty);
			this._importError					= new ArrayList();
			
			this._supportedExtensions			= new ArrayList();
			this._supportedExtensions.Add(new DocumentSupportInfo(".txt", DocumentTypes.TextDocument));

			this._author						= "Lars Behrmann, [email protected]";
			this._infoUrl						= "http://AODL.OpenDocument4all.com";
			this._description					= "This the standard importer for plain text files of the OpenDocument library AODL.";
		}
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OpenDocumentImporter"/> class.
        /// </summary>
        public OpenDocumentImporter()
        {
            string dir = Path.Combine(Environment.CurrentDirectory, folderGuid.ToString());

            m_dirInfo = new DirInfo(dir, Path.Combine(dir, "PicturesRead"));

            this._importError = new ArrayList();

            this._supportedExtensions = new ArrayList();
            this._supportedExtensions.Add(new DocumentSupportInfo(".ott", DocumentTypes.TextDocument));
            this._supportedExtensions.Add(new DocumentSupportInfo(".odt", DocumentTypes.TextDocument));
            this._supportedExtensions.Add(new DocumentSupportInfo(".ods", DocumentTypes.SpreadsheetDocument));

            this._author      = "Lars Behrmann, [email protected]";
            this._infoUrl     = "http://AODL.OpenDocument4all.com";
            this._description = "This the standard importer of the OpenDocument library AODL.";
        }
		/// <summary>
		/// Load the given file.
		/// </summary>
		/// <param name="file"></param>
		public void Load(string file)
		{
			this._isLoadedFile				= true;
			this.LoadBlankContent();

			this.NamespaceManager			= TextDocumentHelper.NameSpace(this._xmldoc.NameTable);

			ImportHandler importHandler		= new ImportHandler();
			m_importer				= importHandler.GetFirstImporter(DocumentTypes.SpreadsheetDocument, file);

			m_dirInfo = m_importer.DirInfo;
			if (m_importer != null)
			{
				if (m_importer.NeedNewOpenDocument)
					this.New();
				m_importer.Import(this,file);

				if (m_importer.ImportError != null)
					if (m_importer.ImportError.Count > 0)
					foreach(object ob in m_importer.ImportError)
					if (ob is AODLWarning)
				{
					if (((AODLWarning)ob).Message != null)
						Console.WriteLine("Err: {0}", ((AODLWarning)ob).Message);
					if (((AODLWarning)ob).Node != null)
					{
						XmlTextWriter writer	= new XmlTextWriter(Console.Out);
						writer.Formatting		= Formatting.Indented;
						((AODLWarning)ob).Node.WriteContentTo(writer);
					}
				}
			}
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="OpenDocumentImporter"/> class.
		/// </summary>
		public OpenDocumentImporter()
		{
			string dir = Path.Combine(Environment.CurrentDirectory, folderGuid.ToString());
			m_dirInfo = new DirInfo(dir, Path.Combine(dir, "PicturesRead"));
			
			this._importError					= new ArrayList();
			
			this._supportedExtensions			= new ArrayList();
            this._supportedExtensions.Add(new DocumentSupportInfo(".ott", DocumentTypes.TextDocument));
			this._supportedExtensions.Add(new DocumentSupportInfo(".odt", DocumentTypes.TextDocument));
			this._supportedExtensions.Add(new DocumentSupportInfo(".ods", DocumentTypes.SpreadsheetDocument));

			this._author						= "Lars Behrmann, [email protected]";
			this._infoUrl						= "http://AODL.OpenDocument4all.com";
			this._description					= "This the standard importer of the OpenDocument library AODL.";
		}
Exemplo n.º 5
0
		/// <summary>
		/// Loads the document by using the specified importer.
		/// </summary>
		/// <param name="file">The the file.</param>
		public void Load(string file)
		{
			this._isLoadedFile				= true;

			this.Styles = new StyleCollection();
			this._fields = new FieldsCollection();
			this.Content = new ContentCollection();
			

			this._xmldoc					= new XmlDocument();
			this._xmldoc.LoadXml(TextDocumentHelper.GetBlankDocument());
			this.NamespaceManager			= TextDocumentHelper.NameSpace(this._xmldoc.NameTable);

			ImportHandler importHandler		= new ImportHandler();
			m_importer				= importHandler.GetFirstImporter(DocumentTypes.TextDocument, file);
			m_dirInfo = m_importer.DirInfo;
			if (m_importer != null)
			{
				if (m_importer.NeedNewOpenDocument)
					this.New();
				m_importer.Import(this,file);

				if (m_importer.ImportError != null)
					if (m_importer.ImportError.Count > 0)
					foreach(object ob in m_importer.ImportError)
					if (ob is AODLWarning)
				{
					if (((AODLWarning)ob).Message != null)
						Console.WriteLine("Err: {0}", ((AODLWarning)ob).Message);
					if (((AODLWarning)ob).Node != null)
					{
						XmlTextWriter writer	= new XmlTextWriter(Console.Out);
						writer.Formatting		= Formatting.Indented;
						((AODLWarning)ob).Node.WriteContentTo(writer);
					}
				}
			}
			this._formCollection.Clearing += FormsCollection_Clear;
			this._formCollection.Removed += FormsCollection_Removed;
		}
		public MasterPageFactory(DirInfo dirInfo)
		{
			this.m_dirInfo = dirInfo;
		}