Exemplo n.º 1
0
        /// <summary>
        /// This is the main deal method in this sample.
        /// It invoke methods to read and write journal data and create a wall using these data
        /// </summary>
        public void CreateDocumentation(Document document, DocumentationSetting setting)
        {
            var manager = new DocumentationManager();

            if (CanReadData)
            {
                setting.SetSettings(commandData.JournalData);
                setting = ReadJournalData(setting);
                if (setting.DocumentFormat == DocumentFormat.Json)
                {
                    manager.CreateJsonFamilyDoc(document, setting);
                }
                else if (setting.DocumentFormat == DocumentFormat.Web)
                {
                    manager.CreateWebFamilyDoc(document, setting);
                }

                if (setting.DocumentFormat != DocumentFormat.None)
                {
                    JournalHelper.KillCurrentProcess();
                }
            }
            else
            {
                if (setting.DocumentFormat == DocumentFormat.Json)
                {
                    manager.CreateJsonFamilyDoc(document, setting);
                }
                WriteJournalData(setting);
            }
        }