/// <summary>
        /// Build the server files for the specified template.
        /// </summary>
        /// <param name="template">The template for which support files will be built.</param>
        /// <param name="flags">Indicates what types of support files to build.</param>
        public void BuildSupportFiles(Template template, HDSupportFilesBuildFlags flags)
        {
            if (template == null)
            {
                throw new ArgumentNullException("template", @"Local.Services.BuildSupportFiles: the ""template"" parameter passed in was null");
            }
            using (HotDocs.Server.Application app = new HotDocs.Server.Application())
            {
                hdsi.HDServerBuildFlags hdBuildFlags = 0;
                if ((flags & HDSupportFilesBuildFlags.BuildJavaScriptFiles) != 0)
                {
                    hdBuildFlags |= hdsi.HDServerBuildFlags.BuildJavaScriptFiles;
                }
                if ((flags & HDSupportFilesBuildFlags.BuildSilverlightFiles) != 0)
                {
                    hdBuildFlags |= hdsi.HDServerBuildFlags.BuildSilverlightFiles;
                }
                if ((flags & HDSupportFilesBuildFlags.ForceRebuildAll) != 0)
                {
                    hdBuildFlags |= hdsi.HDServerBuildFlags.ForceRebuildAll;
                }
                if ((flags & HDSupportFilesBuildFlags.IncludeAssembleTemplates) != 0)
                {
                    hdBuildFlags |= hdsi.HDServerBuildFlags.IncludeAssembleTemplates;
                }

                app.BuildSupportFiles(template.GetFullPath(), template.Key, hdBuildFlags);
            }
        }
Пример #2
0
        /// <summary>
        /// Construct a new instance of <c>Local.Services</c>.
        /// </summary>
        /// <param name="tempPath">A path to a folder for storing temporary files.</param>
        public Services(string tempPath)
        {
            //Parameter validation.
            if (string.IsNullOrEmpty(tempPath))
                throw new Exception("Non-empty path expected.");
            if (!Directory.Exists(tempPath))
                throw new Exception("The folder \"" + tempPath + "\" does not exist.");

            _app = new HotDocs.Server.Application();
            _tempPath = tempPath;
        }
 /// <summary>
 /// Remove the server files for the specified template.
 /// </summary>
 /// <param name="template">The template for which support files will be removed.</param>
 public void RemoveSupportFiles(Template template)
 {
     if (template == null)
     {
         throw new ArgumentNullException("template", @"Local.Services.RemoveSupportFiles: the ""template"" parameter passed in was null");
     }
     using (HotDocs.Server.Application app = new HotDocs.Server.Application())
     {
         app.RemoveSupportFiles(template.GetFullPath(), template.Key);
     }
 }
        /// <summary>
        /// Construct a new instance of <c>Local.Services</c>.
        /// </summary>
        /// <param name="tempPath">A path to a folder for storing temporary files.</param>
        public Services(string tempPath)
        {
            //Parameter validation.
            if (string.IsNullOrEmpty(tempPath))
            {
                throw new Exception("Non-empty path expected.");
            }
            if (!Directory.Exists(tempPath))
            {
                throw new Exception("The folder \"" + tempPath + "\" does not exist.");
            }

            _app      = new HotDocs.Server.Application();
            _tempPath = tempPath;
        }
Пример #5
0
 /// <summary>
 /// Remove the server files for the specified template.
 /// </summary>
 /// <param name="template">The template for which support files will be removed.</param>
 public void RemoveSupportFiles(Template template)
 {
     if (template == null)
         throw new ArgumentNullException("template", @"Local.Services.RemoveSupportFiles: the ""template"" parameter passed in was null");
     using (HotDocs.Server.Application app = new HotDocs.Server.Application())
     {
         app.RemoveSupportFiles(template.GetFullPath(), template.Key);
     }
 }
Пример #6
0
        /// <summary>
        /// Build the server files for the specified template.
        /// </summary>
        /// <param name="template">The template for which support files will be built.</param>
        /// <param name="flags">Indicates what types of support files to build.</param>
        public void BuildSupportFiles(Template template, HDSupportFilesBuildFlags flags)
        {
            if (template == null)
                throw new ArgumentNullException("template", @"Local.Services.BuildSupportFiles: the ""template"" parameter passed in was null");
            using (HotDocs.Server.Application app = new HotDocs.Server.Application())
            {
                hdsi.HDSupportFilesBuildFlags hdBuildFlags = 0;
                if ((flags & HDSupportFilesBuildFlags.BuildJavaScriptFiles) != 0)
                    hdBuildFlags |= hdsi.HDSupportFilesBuildFlags.BuildJavaScriptFiles;
                if ((flags & HDSupportFilesBuildFlags.BuildSilverlightFiles) != 0)
                    hdBuildFlags |= hdsi.HDSupportFilesBuildFlags.BuildSilverlightFiles;
                if ((flags & HDSupportFilesBuildFlags.ForceRebuildAll) != 0)
                    hdBuildFlags |= hdsi.HDSupportFilesBuildFlags.ForceRebuildAll;
                if ((flags & HDSupportFilesBuildFlags.IncludeAssembleTemplates) != 0)
                    hdBuildFlags |= hdsi.HDSupportFilesBuildFlags.IncludeAssembleTemplates;

                app.BuildSupportFiles(template.GetFullPath(), template.Key, hdBuildFlags);
            }
        }