/// <summary>
        /// Copy constructor -- this constructor is invoked to make a new copy of the (static) Default GetInterviewOptions
        /// (as originally read from web.config).
        /// </summary>
        /// <param name="source">The source settings to copy.</param>
        private InterviewSettings(InterviewSettings source)
        {
            // Copy the four required settings.
            PostInterviewUrl    = source.PostInterviewUrl;
            InterviewRuntimeUrl = source.InterviewRuntimeUrl;
            StyleSheetUrl       = source.StyleSheetUrl;
            InterviewFilesUrl   = source.InterviewFilesUrl;

            // Copy the rest of the (optional) interview settings.
            DocumentPreviewUrl       = source.DocumentPreviewUrl;
            SaveAnswersUrl           = source.SaveAnswersUrl;
            AnswerFileDataServiceUrl = source.AnswerFileDataServiceUrl;
            if (source.CustomDataSources != null)
            {
                CustomDataSources = new Dictionary <string, string>(source.CustomDataSources, StringComparer.OrdinalIgnoreCase);
            }

            AddHdMainDiv           = source.AddHdMainDiv;
            RoundTripUnusedAnswers = source.RoundTripUnusedAnswers;

            Format                 = source.Format;
            ThemeName              = source.ThemeName;
            Title                  = source.Title;
            Locale                 = source.Locale;
            NextFollowsOutline     = source.NextFollowsOutline;
            ShowAllResourceButtons = source.ShowAllResourceButtons;
            DisableDocumentPreview = source.DisableDocumentPreview;
            DisableSaveAnswers     = source.DisableSaveAnswers;
            DisableAnswerSummary   = source.DisableAnswerSummary;
            AnswerSummary          = new AnswerSummaryOptions(source.AnswerSummary);

            DefaultUnansweredFormat  = source.DefaultUnansweredFormat;
            HonorCmpUnansweredFormat = source.HonorCmpUnansweredFormat;
            DefaultDateFormat        = source.DefaultDateFormat;
        }
예제 #2
0
        /// <summary>
        /// Copy constructor -- this constructor is invoked to make a new copy of the (static) Default GetInterviewOptions
        /// (as originally read from web.config).
        /// </summary>
        /// <param name="source">The source settings to copy.</param>
        private InterviewSettings(InterviewSettings source)
        {
            // Copy the four required settings.
            PostInterviewUrl = source.PostInterviewUrl;
            InterviewRuntimeUrl = source.InterviewRuntimeUrl;
            StyleSheetUrl = source.StyleSheetUrl;
            InterviewFilesUrl = source.InterviewFilesUrl;

            // Copy the rest of the (optional) interview settings.
            DocumentPreviewUrl = source.DocumentPreviewUrl;
            SaveAnswersUrl = source.SaveAnswersUrl;
            AnswerFileDataServiceUrl = source.AnswerFileDataServiceUrl;
            if (source.CustomDataSources != null)
                CustomDataSources = new Dictionary<string, string>(source.CustomDataSources, StringComparer.OrdinalIgnoreCase);

            AddHdMainDiv = source.AddHdMainDiv;
            RoundTripUnusedAnswers = source.RoundTripUnusedAnswers;

            Format = source.Format;
            ThemeName = source.ThemeName;
            Title = source.Title;
            Locale = source.Locale;
            NextFollowsOutline = source.NextFollowsOutline;
            ShowAllResourceButtons = source.ShowAllResourceButtons;
            DisableDocumentPreview = source.DisableDocumentPreview;
            DisableSaveAnswers = source.DisableSaveAnswers;
            DisableAnswerSummary = source.DisableAnswerSummary;
            AnswerSummary = new AnswerSummaryOptions(source.AnswerSummary);

            DefaultUnansweredFormat = source.DefaultUnansweredFormat;
            HonorCmpUnansweredFormat = source.HonorCmpUnansweredFormat;
            DefaultDateFormat = source.DefaultDateFormat;
        }
예제 #3
0
 static InterviewSettings()
 {
     s_default = null;
 }
예제 #4
0
        /// <summary>
        /// Returns the current interview with the given settings
        /// </summary>
        /// <param name="settings">Settings to use with the interview.</param>
        /// <param name="markedVariables">A list of variable names whose prompts should be "marked" in the interview.</param>
        /// <include file="../Shared/Help.xml" path="Help/string/param[@name='logRef']"/>
        /// <returns>An <c>InterviewResult</c> containing the HTML fragment and other supporting files for the interview.</returns>
        public InterviewResult GetCurrentInterview(InterviewSettings settings, IEnumerable<string> markedVariables, string logRef = "")
        {
            WorkItem currentWorkItem = CurrentWorkItem;
            TextReader answers = new StringReader(AnswerCollection.XmlAnswers);

            settings.Title = settings.Title ?? CurrentWorkItem.Template.Title;

            return _service.GetInterview(currentWorkItem.Template, answers, settings, markedVariables, logRef);
        }
예제 #5
0
 /// <summary>
 /// Creates a WorkSession object that a host application can use to step through the process of presenting
 /// all the interviews and assembling all the documents that may result from the given template.
 /// 
 /// Allows the default interview settings to be specified instead of being read from config file
 /// </summary>
 /// <param name="service">An object implementing the IServices interface, encapsulating the instance of
 /// HotDocs Server with which the host app is communicating.</param>
 /// <param name="template">The template upon which this WorkSession is based. The initial interview and/or
 /// document work items in the WorkSession will be based on this template (including its Switches property).</param>
 /// <param name="answers">A collection of XML answers to use as a starting point for the work session.
 /// The initial interview (if any) will be pre-populated with these answers, and the subsequent generation
 /// of documents will have access to these answers as well.</param>
 /// <param name="defaultInterviewSettings">The default interview settings to be used throughout the session</param>
 public WorkSession(IServices service, Template template, TextReader answers, InterviewSettings defaultInterviewSettings)
 {
     _service = service;
     AnswerCollection = new AnswerCollection();
     if (answers != null)
         AnswerCollection.ReadXml(answers);
     DefaultAssemblySettings = new AssembleDocumentSettings();
         if (defaultInterviewSettings != null)
             DefaultInterviewSettings = defaultInterviewSettings;
         else
             DefaultInterviewSettings = new InterviewSettings();
         // add the work items
     _workItems = new List<WorkItem>();
     if (template.HasInterview)
         _workItems.Add(new InterviewWorkItem(template));
     if (template.GeneratesDocument)
         _workItems.Add(new DocumentWorkItem(template));
 }