StagingPanelSettings.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using InABox.Configuration;
  2. using InABox.Core;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. namespace Comal.Classes
  7. {
  8. [Caption("Staging Panel Settings")]
  9. public class StagingPanellSettings : BaseObject, IGlobalConfigurationSettings
  10. {
  11. [Caption("PDF Markup Program Pathway", IncludePath = false)]
  12. [FileNameEditor]
  13. [EditorSequence(1)]
  14. public string MarkupPathway { get; set; } = "";
  15. [FolderEditor(Environment.SpecialFolder.CommonDocuments)]
  16. [EditorSequence(2)]
  17. public string SetoutsFolder { get; set; } = "";
  18. [Comment("Maximum Document Size (MB)")]
  19. [IntegerEditor(Caption = "Maximum Document Size (MB)", ToolTip = "The user will be warned when uploading documents which are larger than this size in megabytes. Set to zero for no maximum.")]
  20. [EditorSequence(3)]
  21. public int MaximumDocumentSize { get; set; } = 0;
  22. [ScriptEditor]
  23. [EditorSequence(4)]
  24. public string? Script { get; set; }
  25. [Comment("Variable name for the EmbeddedImage document field on StagingSetout forms")]
  26. [EditorSequence(5)]
  27. public string FormVariable { get; set; } = "";
  28. private class DefaultFormLookup : LookupDefinitionGenerator<DigitalForm, StagingPanellSettings>
  29. {
  30. public override Filter<DigitalForm>? DefineFilter(StagingPanellSettings[] items)
  31. {
  32. return Filter<DigitalForm>.Where(x => x.AppliesTo).IsEqualTo(nameof(StagingSetout));
  33. }
  34. }
  35. [Comment("Default form to be used for requesting site measurements")]
  36. [EditorSequence(6)]
  37. [LookupDefinition(typeof(DefaultFormLookup))]
  38. public DigitalFormLink DefaultForm { get; set; }
  39. public static string DefaultScript()
  40. {
  41. return @"
  42. using PRSDesktop;
  43. using InABox.Core;
  44. using System.Collections.Generic;
  45. public class Module
  46. {
  47. /*public void CustomiseSetouts(CustomiseSetoutsArgs args)
  48. {
  49. // Perform customisation on the setouts when they are added to the 'Staged Documents' grid.
  50. }*/
  51. }";
  52. }
  53. }
  54. }