Esempio n. 1
0
 /// <summary>
 /// DI Constructor
 /// </summary>
 /// <param name="httpClientFactory">HttpClientFactory instance</param>
 /// <param name="listRetrievalWorker">List retrieval worker instance</param>
 /// <param name="xmlHelper">XML Helper instance</param>
 public DataPushWorker(IHttpClientFactory httpClientFactory, IListRetrievalWorker listRetrievalWorker,
                       IXmlHelper xmlHelper)
 {
     _httpClientFactory   = httpClientFactory;
     _listRetrievalWorker = listRetrievalWorker;
     _xmlHelper           = xmlHelper;
 }
Esempio n. 2
0
 public BlockCycleController(IBlockCycleAppService blockCycleAppService, IXmlHelper xmlHelper, ILogger <InspectionController> logger, IMapper mapper)
 {
     _blockCycleAppService = blockCycleAppService;
     _xmlHelper            = xmlHelper;
     _logger = logger;
     _mapper = mapper;
 }
Esempio n. 3
0
        public void SetUp()
        {
            var files = Directory.GetFiles(Tempdir);

            Array.ForEach(files, File.Delete);
            _dmp = Builder <DataManagementPlan> .CreateNew()
                   .With(o => o.BackupLocations             = BackupLocations.MicrosoftSharePoint | BackupLocations.PersonalHardDrives | BackupLocations.InstitutionalBackup | BackupLocations.Other)
                   .And(o => o.BackupPolicyResponsibilities = DataResponsibilities.Other | DataResponsibilities.PrincipalInvestigator)
                   .And(o => o.IsSensitive  = Pick <bool> .RandomItemFrom(new[] { false, true }))
                   .And(o => o.CreationDate = DateTime.Now)
                   .And(o => o.UrdmsUsers   = Builder <UrdmsUser> .CreateListOfSize(5).Build())
                   .And(o => o.RelationshipBetweenExistingAndNewData = EnumValuesHelper.RandomItem(DataRelationship.None))
                   .And(o => o.DataRetentionLocations        = DataRetentionLocations.External | DataRetentionLocations.Internal | DataRetentionLocations.Other)
                   .And(o => o.DataRetentionPeriod           = EnumValuesHelper.RandomItem(DataRetentionPeriod.Short))
                   .And(o => o.DataRetentionResponsibilities = DataResponsibilities.Other | DataResponsibilities.PrincipalInvestigator)
                   .And(o => o.DepositToRepository           = Pick <bool> .RandomItemFrom(new[] { false, true }))
                   .And(o => o.DataSharingAvailability       = DataSharingAvailability.AfterASpecifiedEmbargoPeriod)
                   .And(o => o.DataSharingAvailabilityDate   = DateTime.Today.AddYears(10))
                   .And(o => o.DataLicensingType             = EnumValuesHelper.RandomItem <DataLicensingType>())
                   .And(o => o.ShareAccess = EnumValuesHelper.RandomItem(ShareAccess.None))
                   .And(o => o.InstitutionalStorageTypes = InstitutionalStorageTypes.ProjectStorageSpace | InstitutionalStorageTypes.PersonalNetworkDrive | InstitutionalStorageTypes.PersonalNetworkDrive | InstitutionalStorageTypes.Other)
                   .And(o => o.ExternalStorageTypes      = ExternalStorageTypes.DataFabric | ExternalStorageTypes.IvecPetabyte | ExternalStorageTypes.Other)
                   .And(o => o.MaxDataSize             = EnumValuesHelper.RandomItem(MaxDataSize.None))
                   .And(o => o.PersonalStorageTypes    = PersonalStorageTypes.RemovableMedia | PersonalStorageTypes.InternalHardDrives | PersonalStorageTypes.Other)
                   .And(o => o.VersionControl          = EnumValuesHelper.RandomItem(VersionControl.None))
                   .And(o => o.EthicRequiresClearance  = Pick <bool> .RandomItemFrom(new[] { false, true }))
                   .And(o => o.ExistingDataAccessTypes = ExistingDataAccessTypes.DataIsFreelyAvailable | ExistingDataAccessTypes.ObtainApprovalFromOwner | ExistingDataAccessTypes.Other | ExistingDataAccessTypes.Purchase)
                   .And(o => o.UseExistingData         = Pick <bool> .RandomItemFrom(new[] { false, true }))
                   .And(o => o.DataOwners           = DataOwners.MyInstitution | DataOwners.Researcher | DataOwners.Other)
                   .And(o => o.DataActionFrequency  = EnumValuesHelper.RandomItem(DataActionFrequency.None))
                   .And(o => o.NonUrdmsUsers        = Builder <User> .CreateListOfSize(4).Build())
                   .And(o => o.PricipalInvestigator = Pick <string> .RandomItemFrom(new[] { "John Doe", "Joe Bloggs", "Jane Doe", "John Smith" }))
                   .And(o => o.ProjectTitle         = Pick <string> .RandomItemFrom(new[] { "Feeding Habits of Polar Bears", "The Ecosystem in the Sahara Desert" }))
                   .And(o => o.DateModified         = DateTime.Now)
                   .Build();

            _dataManagementPlanRepository = Substitute.For <IDataManagementPlanRepository>();
            _dataManagementPlanRepository.GetDataManagementPlanByProjectId(Arg.Is(ProjectId)).Returns(_dmp);
            _sharePointHelper = Substitute.For <ISharePointHelper>();
            _pdfHelper        = Substitute.For <IPdfHelper>();
            _generatorHelper  = Substitute.For <IGeneratorHelper>();
            _xmlHelper        = Substitute.For <IXmlHelper>();
            _generator        = new DmpGenerator(_sharePointHelper, _dataManagementPlanRepository, _pdfHelper, _generatorHelper, _xmlHelper);

            _projectRepository = Substitute.For <IProjectRepository>();
            var projects = Builder <Project> .CreateListOfSize(2)
                           .TheFirst(1)
                           .With(o => o.SourceProjectType = EnumValuesHelper.RandomItem(SourceProjectType.None, SourceProjectType.DEPOSIT))
                           .TheNext(1)
                           .With(o => o.SourceProjectType = SourceProjectType.DEPOSIT)
                           .Build()
                           .ToList();

            _nonDepositProject = projects[0];
            _depositProject    = projects[1];
            projects.ForEach(o => _projectRepository.Get(Arg.Is(o.Id)).Returns(o));

            // Initialise PDF library
            // XSettings.InstallRedistributionLicense(ConfigurationManager.AppSettings["ABCPDFLicenseKey"]);
        }
Esempio n. 4
0
        /// <summary>
        /// Returns the type of axis than represents specified node. Not supported in <c>EPPlus</c> library.
        /// </summary>
        /// <param name="axis"><c>Xml</c> node than represent an axis definition.</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <returns>
        /// A <see cref="KnownAxisType" /> value.
        /// </returns>
        /// <exception cref="T:System.ArgumentNullException">If <paramref name="axis" /> is <c>null</c>.</exception>
        /// <exception cref="T:System.InvalidOperationException">If <paramref name="axis" /> is not an axis.</exception>
        public static KnownAxisType ExtractAxisType(this XmlNode axis, IXmlHelper documentHelper)
        {
            SentinelHelper.ArgumentNull(axis, nameof(axis));
            SentinelHelper.IsFalse(axis.Name.Contains("catAx") || axis.Name.Contains("valAx") || axis.Name.Contains("dateAx"), "Imposible extraer tipo. el nodo no es de tipo eje");

            var idElement = documentHelper.GetXmlNode(axis, "c:axId");
            var valueAttr = idElement.Attributes["val"];

            var value = valueAttr.Value;

            switch (value)
            {
            case "2":
                return(KnownAxisType.PrimaryValueAxis);

            case "3":
                return(KnownAxisType.SecondaryCategoryAxis);

            case "4":
                return(KnownAxisType.SecondaryValueAxis);

            default:
                return(KnownAxisType.PrimaryCategoryAxis);
            }
        }
 public InspectionController(IInspectionAppService inspectionAppService, IXmlHelper xmlHelper, ILogger <InspectionController> logger, IMapper mapper)
 {
     _inspectionAppService = inspectionAppService;
     _xmlHelper            = xmlHelper;
     _logger = logger;
     _mapper = mapper;
 }
 public OutstandingInvoiceService(IUnitOfWorkFactory unitOfWorkFactory, IXmlHelper XmlHelper, IUrlHelper urlHelper) : base(unitOfWorkFactory)
 {
     this.unitOfWork = unitOfWorkFactory;
     customSettings  = new CustomSettings();
     this.xmlHelper  = XmlHelper;
     this.UrlHelper  = urlHelper;
 }
Esempio n. 7
0
 public OutstandingInvoicesV1Controller(IXmlHelper XmlHelper, ICookieManager cookieManager, IUnitOfWorkFactory unitOfWorkFactory, OutstandingInvoiceService OutstandingInvoiceService)
     : base(cookieManager)
 {
     this.unitOfWork = unitOfWorkFactory.GetUnitOfWork();
     this.xmlHelper  = XmlHelper;
     this.OutstandingInvoiceService = OutstandingInvoiceService;
     customSettings = new CustomSettings();
 }
Esempio n. 8
0
 public DmpGenerator(ISharePointHelper sharePointHelper, IDataManagementPlanRepository repository, IPdfHelper pdfHelper, IGeneratorHelper generatorHelper, IXmlHelper xmlHelper)
 {
     SharePointHelper = sharePointHelper;
     Repository       = repository;
     PdfHelper        = pdfHelper;
     GeneratorHelper  = generatorHelper;
     XmlHelper        = xmlHelper;
 }
 public DmpGenerator(ISharePointHelper sharePointHelper, IDataManagementPlanRepository repository, IPdfHelper pdfHelper, IGeneratorHelper generatorHelper, IXmlHelper xmlHelper)
 {
     SharePointHelper = sharePointHelper;
     Repository = repository;
     PdfHelper = pdfHelper;
     GeneratorHelper = generatorHelper;
     XmlHelper = xmlHelper;
 }
Esempio n. 10
0
 public HomeController(
     IXmlHelper xmlHelper,
     ISubscriptionRepository subscriptionRepository,
     IContactFormRepository contactFormRepository)
 {
     _xmlHelper = xmlHelper;
     _subscriptionRepository = subscriptionRepository;
     _contactFormRepository  = contactFormRepository;
 }
Esempio n. 11
0
        // Initial Condition
        public FSymbol(IXmlHelper api)
        {
            this.api = api;

            //Defaults
            FActionType = FActionType.In;
            FType       = FType.Stock;
            Result      = new ErrorResult();
        }
        /// <summary>
        /// Adds a <c>ea</c> node (East Asian Font) to the node of type <c>defRPr</c> (Default Text Run Properties) specified. Not supported in <c>EPPlus</c> library.
        /// </summary>
        /// <param name="node"><c>defRPr</c> node (Shape Properties).</param>
        /// <param name="fontname">Font name.</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <remarks>
        /// For more information please see <a href="http://www.schemacentral.com/sc/ooxml/e-a_ea-1.html">http://www.schemacentral.com/sc/ooxml/e-a_ea-1.html</a>
        /// </remarks>
        private static void AddEastAsianFontNode(this XmlNode node, string fontname, IXmlHelper documentHelper)
        {
            var typefaceAttr = documentHelper.CreateAttribute("typeface");

            typefaceAttr.Value = fontname;

            var eastAsianFontNode = documentHelper.CreateOrDefaultAndAppendElementToNode(node, "a", "ea");

            eastAsianFontNode.Attributes.Append(typefaceAttr);
        }
Esempio n. 13
0
        public void SetUp()
        {
            fakeXmlFeed = new FakeXmlFeed();
            Api         = Substitute.For <IXmlHelper>();
            Feed        = Substitute.For <IXmlFeed>();
            xmlHelper   = new XmlHelper(fakeXmlFeed);
            model       = new MainModel(xmlHelper);

            Global.ShareSize = 200;
        }
Esempio n. 14
0
        public Project(string filePath, ICommandExecutor commandExecutor, IXmlHelper xmlHelper)
        {
            if (!Path.IsPathRooted(filePath))
            {
                throw new ArgumentOutOfRangeException(nameof(filePath), "The project file path must be absolute.");
            }

            FilePath         = filePath;
            _commandExecutor = commandExecutor;
            _xmlHelper       = xmlHelper;
        }
Esempio n. 15
0
        public void SetUp()
        {
            var builder = new ContainerBuilder();

            builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
            .AsImplementedInterfaces();

            builder.RegisterType <FakeXmlFeed>().As <IXmlFeed>();
            Global.IsFakePoco = true;

            container = builder.Build();
            scope     = container.BeginLifetimeScope();

            fw    = scope.Resolve <IFileWatcher>();
            api   = scope.Resolve <IXmlHelper>();
            model = scope.Resolve <IMainModel>();
        }
Esempio n. 16
0
        public JwtHelper(IOptions <TokenSettings> settings, ILogger <JwtHelper> logger, IXmlHelper xmlHelper)
        {
            _settings  = settings.Value ?? throw new ArgumentNullException(nameof(settings));
            _logger    = logger ?? throw new ArgumentNullException(nameof(logger));
            _xmlHelper = xmlHelper ?? throw new ArgumentNullException(nameof(xmlHelper));

            if (_settings.UseRsa)
            {
                InitializeRsa();
            }
            else
            {
                InitializeHmac();
            }

            InitializeJwtParameters();
        }
Esempio n. 17
0
        /// <summary>
        /// Modifies crosses for the specified axis. Supported in <c>EPPlus</c> library but fails.
        /// </summary>
        /// <param name="axis"><c>Xml</c> node than represent an axis definition.</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <exception cref="T:System.ArgumentNullException">If <paramref name="axis" /> is <c>null</c>.</exception>
        /// <exception cref="T:System.InvalidOperationException">If <paramref name="axis" /> is not an axis.</exception>
        public static void ModifyAxisCrosses(this XmlNode axis, IXmlHelper documentHelper)
        {
            SentinelHelper.ArgumentNull(axis, nameof(axis));
            SentinelHelper.IsFalse(axis.Name.Contains("catAx") || axis.Name.Contains("valAx") || axis.Name.Contains("dateAx"), "Imposible extraer tipo. el nodo no es de tipo eje");

            var axisType = axis.ExtractAxisType(documentHelper);

            if (axisType != KnownAxisType.SecondaryCategoryAxis)
            {
                return;
            }

            var valAttr = documentHelper.CreateAttribute("val");

            valAttr.Value = "max";

            var crossesXmlNode = documentHelper.CreateOrDefaultAndAppendElementToNode(axis, "c:crosses");

            crossesXmlNode.Attributes.Append(valAttr);
        }
Esempio n. 18
0
        /// <summary>
        /// Adds major, minor or both grid lines to the specified axis. Not supported in <c>EPPlus</c> library.
        /// </summary>
        /// <param name="axis"><c>Xml</c> node than represent an axis definition.</param>
        /// <param name="model">A <see cref="GridLine"/> value from model.</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <exception cref="T:System.ArgumentNullException">If <paramref name="axis" /> is <c>null</c>.</exception>
        /// <exception cref="T:System.InvalidOperationException">If <paramref name="axis" /> is not an axis.</exception>
        /// <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value specified is outside the range of valid values.</exception>
        public static void AddAxisGridLinesMode(this XmlNode axis, GridLine model, IXmlHelper documentHelper)
        {
            SentinelHelper.ArgumentNull(axis, nameof(axis));
            SentinelHelper.IsEnumValid(model);
            SentinelHelper.IsFalse(axis.Name.Contains("catAx") || axis.Name.Contains("valAx") || axis.Name.Contains("dateAx"), "Imposible extraer tipo. el nodo no es de tipo eje");

            var existMajorGridLinesNode = documentHelper.TryGetElementFrom(axis, "c:majorGridlines", out var majorGridLinesElement);

            if (existMajorGridLinesNode)
            {
                var parent = majorGridLinesElement.ParentNode;
                parent.RemoveChild(majorGridLinesElement);
            }

            var existMinorGridLinesNode = documentHelper.TryGetElementFrom(axis, "c:minorGridlines", out var minorGridLinesElement);

            if (existMinorGridLinesNode)
            {
                var parent = minorGridLinesElement.ParentNode;
                parent.RemoveChild(minorGridLinesElement);
            }

            switch (model)
            {
            case GridLine.None:
                break;

            case GridLine.Major:
                axis.AppendChild(majorGridLinesElement);
                break;

            case GridLine.Minor:
                axis.AppendChild(minorGridLinesElement);
                break;

            case GridLine.Both:
                axis.AppendChild(majorGridLinesElement);
                axis.AppendChild(minorGridLinesElement);
                break;
            }
        }
Esempio n. 19
0
        public Form1()
        {
            //Init Autofac
            var builder = new ContainerBuilder();

            builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
            .AsImplementedInterfaces();

            //Force IXmlFeed to use mock

            //UseFakeXml(builder);
            UseRealXml(builder);

            container = builder.Build();
            scope     = container.BeginLifetimeScope();
            InitializeComponent();
            Form1Edit = this;

            fw    = scope.Resolve <IFileWatcher>();
            api   = scope.Resolve <IXmlHelper>();
            model = scope.Resolve <IMainModel>();
            InstructionTextBox.Text =
                @"Instruction:  The output csv file should be in the following format (Symbol,Profit,Win Ratio,Current Price)";
        }
Esempio n. 20
0
        /// <summary>
        /// Adds a <c>endParaRPr</c> node (End Paragraph Run Properties) to the node of type <c>p</c> (Text Paragraphs) specified. Not supported in <c>EPPlus</c> library.
        /// </summary>
        /// <param name="textParagraphsNode"><c>p</c> node (Text Paragraphs).</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <remarks>
        /// For more information please see <a href="http://www.schemacentral.com/sc/ooxml/e-a_endParaRPr-1.html">http://www.schemacentral.com/sc/ooxml/e-a_endParaRPr-1.html</a>
        /// </remarks>
        private static void AddEndParagraphRunPropertiesNode(this XmlNode textParagraphsNode, IXmlHelper documentHelper)
        {
            var langAttr = documentHelper.CreateAttribute("lang");

            langAttr.Value = CultureInfo.CurrentCulture.Name;

            var endParagraphRunPropertiesNode = documentHelper.CreateOrDefaultAndAppendElementToNode(textParagraphsNode, "a", "endParaRPr");

            endParagraphRunPropertiesNode.Attributes.Append(langAttr);
        }
Esempio n. 21
0
        /// <summary>
        /// Adds a <c>p</c> node (Text Paragraphs) to the node of type <c>txPr</c> (Text properties) specified. Not supported in <c>EPPlus</c> library.
        /// </summary>
        /// <param name="textPropertiesNode"><c>txPr</c> node (Text properties).</param>
        /// <param name="model">Font from model.</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <remarks>
        /// For more information please see <a href="http://www.schemacentral.com/sc/ooxml/e-a_p-1.html">http://www.schemacentral.com/sc/ooxml/e-a_p-1.html</a>
        /// </remarks>
        private static void AddTextParagraphsNode(this XmlNode textPropertiesNode, FontModel model, IXmlHelper documentHelper)
        {
            var textParagraphsNode = documentHelper.CreateOrDefaultAndAppendElementToNode(textPropertiesNode, "a", "p");

            textParagraphsNode.AddTextParagraphPropertiesNode(model, documentHelper);
            textParagraphsNode.AddEndParagraphRunPropertiesNode(documentHelper);
        }
Esempio n. 22
0
 /// <summary>
 /// Adds a <c>lstStyle</c> node (Text List Styles) to the node of type <c>txPr</c> (Text properties) specified. Not supported in <c>EPPlus</c> library.
 /// </summary>
 /// <param name="textPropertiesNode"><c>txPr</c> node (Text properties).</param>
 /// <param name="documentHelper">Target xml document helper.</param>
 /// <remarks>
 /// For more information please see <a href="http://www.schemacentral.com/sc/ooxml/e-a_lstStyle-2.html">http://www.schemacentral.com/sc/ooxml/e-a_lstStyle-2.html</a>
 /// </remarks>
 private static void AddTextListStylesNode(this XmlNode textPropertiesNode, IXmlHelper documentHelper)
 {
     documentHelper.CreateOrDefaultAndAppendElementToNode(textPropertiesNode, "a", "lstStyle");
 }
Esempio n. 23
0
        /// <summary>
        /// Adds a <c>bodyPr</c> node (Body Properties) to the node of type <c>txPr</c> (Text properties) specified. Not supported in <c>EPPlus</c> library.
        /// </summary>
        /// <param name="textPropertiesNode"><c>txPr</c> node (Text properties).</param>
        /// <param name="orientation">A <see cref="KnownLabelOrientation" /> value from model.</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <remarks>
        /// For more information please see <a href="http://www.schemacentral.com/sc/ooxml/e-a_bodyPr-2.html">http://www.schemacentral.com/sc/ooxml/e-a_bodyPr-2.html</a>
        /// </remarks>
        private static void AddBodyPropertiesNode(this XmlNode textPropertiesNode, LabelOrientation orientation, IXmlHelper documentHelper)
        {
            var rotAttr = documentHelper.CreateAttribute("rot");

            rotAttr.Value = orientation.ToAngle().ToString(CultureInfo.InvariantCulture);

            var vertAttr = documentHelper.CreateAttribute("vert");

            vertAttr.Value = orientation == LabelOrientation.Vertical ? "wordArtVert" : "horz";

            var bodyPropertiesNode = documentHelper.CreateOrDefaultAndAppendElementToNode(textPropertiesNode, "a", "bodyPr");

            bodyPropertiesNode.Attributes.Append(rotAttr);
            bodyPropertiesNode.Attributes.Append(vertAttr);
        }
Esempio n. 24
0
        /// <summary>
        /// Adds a <c>txPr</c> node (Text properties) to the node of type <c>valAx</c> (Value Axis), <c>catAx</c> (Category Axis Data), <c>dateAx</c> (Date Axis), <c>serAx</c> (Series Axis) specified. Not supported in <c>EPPlus</c> library.
        /// </summary>
        /// <param name="node">Node of type <c>valAx</c> (Value Axis), <c>catAx</c> (Category Axis Data), <c>dateAx</c> (Date Axis), <c>serAx</c> (Series Axis).</param>
        /// <param name="model">Axis from model.</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <remarks>
        /// For more information please see <a href="http://www.schemacentral.com/sc/ooxml/e-draw-chart_txPr-1.html">http://www.schemacentral.com/sc/ooxml/e-draw-chart_txPr-1.html</a>
        /// </remarks>
        private static void AddTextPropertiesNode(this XmlNode node, XlsxChartAxisDefinitionLabels model, IXmlHelper documentHelper)
        {
            var textPropertiesNode = documentHelper.CreateOrDefaultAndAppendElementToNode(node, "c", "txPr");

            textPropertiesNode.AddBodyPropertiesNode(model.Orientation, documentHelper);
            textPropertiesNode.AddTextListStylesNode(documentHelper);
            textPropertiesNode.AddTextParagraphsNode(model.Font, documentHelper);
        }
Esempio n. 25
0
 public Folder2Wxs(IIdFromNameGenerator idFromNameGenerator,IXmlHelper xmlHelper, ILog logger)
 {
     _idFromNameGenerator = idFromNameGenerator;
     _xmlHelper = xmlHelper;
     _logger = logger;
 }
Esempio n. 26
0
        /// <summary>
        /// Adds a <c>spPr</c> node (Shape properties) to the node of type <c>ser</c> (Area Chart Series) specified. Not supported in <c>EPPlus</c> library.
        /// </summary>
        /// <param name="node"><c>ser</c> node (Area Chart Series).</param>
        /// <param name="model">Serie from model.</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <remarks>
        /// For more information please see <a href="http://www.schemacentral.com/sc/ooxml/e-draw-chart_spPr-1.html">http://www.schemacentral.com/sc/ooxml/e-draw-chart_spPr-1.html</a>
        /// </remarks>
        /// <exception cref="T:System.ArgumentNullException">If <paramref name="node" /> is <c>null</c>.</exception>
        /// <exception cref="T:System.ArgumentNullException">If <paramref name="model" /> is <c>null</c>.</exception>
        public static void AddShapePropertiesNode(this XmlNode node, XlsxChartSerie model, IXmlHelper documentHelper)
        {
            SentinelHelper.ArgumentNull(node, nameof(node));
            SentinelHelper.ArgumentNull(model, nameof(model));

            var shapePropertiesNode = documentHelper.CreateOrDefaultAndAppendElementToNode(node, "c:spPr");

            shapePropertiesNode.AddSolidFillNode(model.GetColor(), documentHelper);
        }
Esempio n. 27
0
        /// <summary>
        /// Adds label properties (orientation, alignment, color and font) to the specified axis. Not supported in <b>EPPlus</b> library.
        /// </summary>
        /// <param name="axis"><b>Xml</b> node than represent an axis definition.</param>
        /// <param name="model">Axis from model.</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <exception cref="ArgumentNullException">If <paramref name="axis" /> is <b>null</b>.</exception>
        /// <exception cref="ArgumentNullException">If <paramref name="model" /> is <b>null</b>.</exception>
        /// <exception cref="InvalidOperationException">If <paramref name="axis" /> is not an axis.</exception>
        public static void AddAxisLabelProperties(this XmlNode axis, XlsxChartAxisDefinitionLabels model, IXmlHelper documentHelper)
        {
            SentinelHelper.ArgumentNull(axis, nameof(axis));
            SentinelHelper.ArgumentNull(model, nameof(model));
            SentinelHelper.IsFalse(axis.Name.Contains("catAx") || axis.Name.Contains("valAx") || axis.Name.Contains("dateAx"), "Imposible extraer tipo. el nodo no es de tipo eje");

            axis.AddTextPropertiesNode(model, documentHelper);
        }
Esempio n. 28
0
        /// <summary>
        /// Adds the label alignment to the specified axis. Not supported in <b>EPPlus</b> library.
        /// </summary>
        /// <param name="axis"><b>Xml</b> node than represent an axis definition.</param>
        /// <param name="model">A <see cref="KnownHorizontalAlignment"/> value from model.</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <exception cref="ArgumentNullException">If <paramref name="axis"/> is <b>null</b>.</exception>
        /// <exception cref="InvalidEnumArgumentException">The value specified is outside the range of valid values.</exception>
        /// <exception cref="InvalidOperationException">If <paramref name="axis"/> is not an axis.</exception>
        public static void AddAxisLabelAlignment(this XmlNode axis, KnownHorizontalAlignment model, IXmlHelper documentHelper)
        {
            SentinelHelper.ArgumentNull(axis, nameof(axis));
            SentinelHelper.IsEnumValid(model);
            SentinelHelper.IsFalse(axis.Name.Contains("catAx") || axis.Name.Contains("valAx") || axis.Name.Contains("dateAx"), "Imposible extraer tipo. el nodo no es de tipo eje");

            var axisType = axis.ExtractAxisType(documentHelper);

            switch (axisType)
            {
            case KnownAxisType.PrimaryCategoryAxis:
            case KnownAxisType.SecondaryCategoryAxis:

                var valAttr = documentHelper.CreateAttribute("val");
                valAttr.Value = model.ToEppLabelAlignmentString();

                var lblAlignXmlNode = documentHelper.CreateOrDefaultAndAppendElementToNode(axis, "c:lblAlgn");
                lblAlignXmlNode.Attributes.Append(valAttr);
                break;

            case KnownAxisType.PrimaryValueAxis:
            case KnownAxisType.SecondaryValueAxis:
                break;
            }
        }
 public ReportAllGposCommandProvider(IGpmcWindowsFeature gpmcWindowsFeature, IXmlHelper xmlHelper, ILog logger)
 {
     _gpmcWindowsFeature = gpmcWindowsFeature;
     _xmlHelper = xmlHelper;
     _logger = logger;
 }
Esempio n. 30
0
 public MainModel(IXmlHelper api)
 {
     this.api = api;
     log      = new Log();
 }
Esempio n. 31
0
 static Xml()
 {
     helper = new DefaultXmlHelper();
 }
Esempio n. 32
0
 public ProjectFactory(ICommandExecutor commandExecutor, IXmlHelper xmlHelper)
 {
     _commandExecutor = commandExecutor;
     _xmlHelper       = xmlHelper;
 }
Esempio n. 33
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="xmlHelper">Helper for Xml work</param>
 /// <param name="logger">Logging utility</param>
 public WebPartHelper(IXmlHelper xmlHelper, ILogger logger)
 {
     this.xmlHelper = xmlHelper;
     this.logger = logger;
 }
Esempio n. 34
0
 public SearchModel(IXmlHelper xmlHelper, IFileHelper fileHelper)
 {
     this.xmlHelper  = xmlHelper;
     this.fileHelper = fileHelper;
 }