Implement WriteToDocument method in Formatter.
This commit is contained in:
		@@ -88,6 +88,20 @@ namespace zaaReloaded2.Formatter
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        #region Public methods
 | 
					        #region Public methods
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// Writes some text to the current document.
 | 
				
			||||||
 | 
					        /// Does nothing if there is no current document.
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        /// <param name="text">Text to write to the current document.
 | 
				
			||||||
 | 
					        /// </param>
 | 
				
			||||||
 | 
					        public void WriteToDocument(string text)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (Document != null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Document.Range().InsertAfter(text);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Formats the laboratory and writes it to a Word document.
 | 
					        /// Formats the laboratory and writes it to a Word document.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -70,7 +70,7 @@ namespace zaaReloaded2.Formatter
 | 
				
			|||||||
        /// Formats and writes the LabItem details to a word <paramref name="document"/>.
 | 
					        /// Formats and writes the LabItem details to a word <paramref name="document"/>.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="document">Word document to write to.</param>
 | 
					        /// <param name="document">Word document to write to.</param>
 | 
				
			||||||
        public void WriteToDocument(Document document)
 | 
					        public void WriteToDocument(Formatter formatter)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            string reference;
 | 
					            string reference;
 | 
				
			||||||
            if (
 | 
					            if (
 | 
				
			||||||
@@ -134,7 +134,7 @@ namespace zaaReloaded2.Formatter
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Insert the formatted text into the document.
 | 
					            // Insert the formatted text into the document.
 | 
				
			||||||
            document.Range().InsertAfter(
 | 
					            formatter.WriteToDocument(
 | 
				
			||||||
                String.Format(
 | 
					                String.Format(
 | 
				
			||||||
                    "{0} {1}{2}{3}",
 | 
					                    "{0} {1}{2}{3}",
 | 
				
			||||||
                    LabItem.QualifiedName,
 | 
					                    LabItem.QualifiedName,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user