コード例 #1
0
        /// <summary>
        /// Read the journal data from the journal.
        /// All journal data is stored in commandData.Data.
        /// </summary>
        private DocumentationSetting ReadJournalData(DocumentationSetting setting)
        {
            var journalData = commandData.JournalData;

            setting.SetSettings(journalData);
            return(setting);
        }
コード例 #2
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);
            }
        }
コード例 #3
0
        /// <summary>
        /// Write the support data into the journal
        /// </summary>
        private void WriteJournalData(DocumentationSetting setting)
        {
            var dataMap = commandData.JournalData;

            dataMap.Clear();
            var journalData = setting.GetJournalData();

            foreach (var key in journalData.Keys)
            {
                dataMap.Add(key, journalData[key]);
            }
        }