DocumentStyles global Document Style
		/// <summary>
		/// Instances this instance.
		/// </summary>
		/// <returns></returns>
		public static DefaultDocumentStyles Instance(DocumentStyles documentStyles, IDocument document)
		{
			if (_instance == null)
			{
				_instance = new DefaultDocumentStyles();
				_instance._styleDocument = documentStyles;
				_instance._document = document;
			}
			return _instance;
		}
Exemple #2
0
        /// <summary>
        /// Create a blank new document.
        /// </summary>
        public TextDocument New()
        {
            _xmldoc = XDocument.Parse(TextDocumentHelper.GetBlankDocument());
            Styles  = new StyleCollection();

            DocumentConfigurations2 = new DocumentConfiguration2();

            DocumentManifest = new DocumentManifest();
            DocumentManifest.New();

            DocumentMetadata = new DocumentMetadata(this);
            DocumentMetadata.New();

            DocumentPictures = new DocumentPictureCollection();

            DocumentSetting = new DocumentSetting();
            DocumentSetting.New();

            DocumentStyles = new DocumentStyles();
            DocumentStyles.New(this);
            ReadCommonStyles();

            Forms = new ODFFormCollection();
            _formCollection.Clearing += FormsCollection_Clear;
            _formCollection.Removed  += FormsCollection_Removed;

            Fields.Clear();
            Content.Clear();


            VariableDeclarations = new VariableDeclCollection();

            DocumentThumbnails = new DocumentPictureCollection();

            MasterPageFactory.RenameMasterStyles(
                DocumentStyles.Styles,
                XmlDoc);
            // Read the moved and renamed styles
            LocalStyleProcessor lsp = new LocalStyleProcessor(this, false);

            lsp.ReReadKnownAutomaticStyles();
            new MasterPageFactory().FillFromXMLDocument(this);
            return(this);
        }