public void FillSolutionComponent(ICollection <SolutionComponent> result, SolutionImageComponent solutionImageComponent)
        {
            if (solutionImageComponent == null ||
                string.IsNullOrEmpty(solutionImageComponent.SchemaName) ||
                string.IsNullOrEmpty(solutionImageComponent.ParentSchemaName)
                )
            {
                return;
            }

            AttributeMetadata metaData = _source.GetAttributeMetadata(solutionImageComponent.ParentSchemaName, solutionImageComponent.SchemaName);

            if (metaData != null)
            {
                var component = new SolutionComponent()
                {
                    ComponentType             = new OptionSetValue(this.ComponentTypeValue),
                    ObjectId                  = metaData.MetadataId.Value,
                    RootComponentBehaviorEnum = SolutionComponent.Schema.OptionSets.rootcomponentbehavior.Include_Subcomponents_0,
                };

                if (solutionImageComponent.RootComponentBehavior.HasValue)
                {
                    component.RootComponentBehavior = new OptionSetValue(solutionImageComponent.RootComponentBehavior.Value);
                }

                result.Add(component);
            }
        }
Ejemplo n.º 2
0
        public override void FillSolutionImageComponent(ICollection<SolutionImageComponent> result, SolutionComponent solutionComponent)
        {
            if (solutionComponent == null
                || !solutionComponent.ObjectId.HasValue
                )
            {
                return;
            }

            var entity = GetEntity<Report>(solutionComponent.ObjectId.Value);

            if (entity != null)
            {
                var imageComponent = new SolutionImageComponent()
                {
                    ComponentType = (int)ComponentType.Report,

                    ObjectId = solutionComponent.ObjectId.Value,

                    RootComponentBehavior = (int)solutionComponent.RootComponentBehaviorEnum.GetValueOrDefault(SolutionComponent.Schema.OptionSets.rootcomponentbehavior.Include_Subcomponents_0),

                    Description = GenerateDescriptionSingle(solutionComponent, true, false, false),
                };

                if (entity.SignatureId.HasValue && entity.SignatureLcid.HasValue)
                {
                    imageComponent.SchemaName = string.Format("{0}{1:B}", entity.SignatureLcid, entity.SignatureId);
                }

                result.Add(imageComponent);
            }
        }
        public override void FillSolutionImageComponent(ICollection <SolutionImageComponent> result, SolutionComponent solutionComponent)
        {
            if (solutionComponent == null ||
                !solutionComponent.ObjectId.HasValue
                )
            {
                return;
            }

            var entity = GetEntity <WebResource>(solutionComponent.ObjectId.Value);

            if (entity != null)
            {
                var imageComponent = new SolutionImageComponent()
                {
                    ComponentType = this.ComponentTypeValue,
                    SchemaName    = entity.Name,

                    RootComponentBehavior = (int)solutionComponent.RootComponentBehaviorEnum.GetValueOrDefault(SolutionComponent.Schema.OptionSets.rootcomponentbehavior.Include_Subcomponents_0),

                    Description = GenerateDescriptionSingle(solutionComponent, true, false, false),
                };

                result.Add(imageComponent);
            }
        }
Ejemplo n.º 4
0
        private async Task ExecuteAction(SolutionImageComponent entity, Func <string, SolutionImageComponent, Task> action)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            string folder = txtBFolder.Text.Trim();

            folder = CorrectFolderIfEmptyOrNotExists(_iWriteToOutput, folder);

            await action(folder, entity);
        }
        public void FillSolutionComponent(ICollection <SolutionComponent> result, SolutionImageComponent solutionImageComponent)
        {
            if (solutionImageComponent == null || string.IsNullOrEmpty(solutionImageComponent.SchemaName))
            {
                return;
            }

            EntityMetadata metaData = _source.GetEntityMetadata(solutionImageComponent.SchemaName);

            if (metaData != null)
            {
                FillSolutionComponentInternal(result, metaData, solutionImageComponent.RootComponentBehavior);
            }
        }
Ejemplo n.º 6
0
        public void FillSolutionComponent(ICollection <SolutionComponent> result, SolutionImageComponent solutionImageComponent)
        {
            if (solutionImageComponent == null || !solutionImageComponent.ObjectId.HasValue)
            {
                return;
            }

            if (this.AllManagedProperties != null &&
                this.AllManagedProperties.Any() &&
                this.AllManagedProperties.ContainsKey(solutionImageComponent.ObjectId.Value)
                )
            {
                FillSolutionComponentInternal(result, solutionImageComponent.ObjectId.Value, solutionImageComponent.RootComponentBehavior);
            }
        }
        private async Task ExecuteAction(SolutionImageComponent entity, Func <string, SolutionImageComponent, Task> action)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            string folder = txtBFolder.Text.Trim();

            if (string.IsNullOrEmpty(folder))
            {
                _iWriteToOutput.WriteToOutput(null, Properties.OutputStrings.FolderForExportIsEmpty);
                folder = FileOperations.GetDefaultFolderForExportFilePath();
            }
            else if (!Directory.Exists(folder))
            {
                _iWriteToOutput.WriteToOutput(null, Properties.OutputStrings.FolderForExportDoesNotExistsFormat1, folder);
                folder = FileOperations.GetDefaultFolderForExportFilePath();
            }

            await action(folder, entity);
        }
        public void FillSolutionComponent(ICollection <SolutionComponent> result, SolutionImageComponent solutionImageComponent)
        {
            if (solutionImageComponent == null ||
                string.IsNullOrEmpty(solutionImageComponent.SchemaName)
                )
            {
                return;
            }

            if (this._source.AllOptionSetMetadata == null)
            {
                return;
            }

            var optionSet = this._source.AllOptionSetMetadata.Values.FirstOrDefault(o => string.Equals(o.Name, solutionImageComponent.SchemaName, StringComparison.InvariantCultureIgnoreCase));

            if (optionSet != null)
            {
                int?behavior = solutionImageComponent.RootComponentBehavior;

                FillSolutionComponentInternal(result, optionSet, behavior);
            }
        }
        public override void FillSolutionComponent(ICollection <SolutionComponent> result, SolutionImageComponent solutionImageComponent)
        {
            if (solutionImageComponent == null)
            {
                return;
            }

            string schemaName = solutionImageComponent.SchemaName;
            int?   behavior   = solutionImageComponent.RootComponentBehavior;

            FillSolutionComponentFromSchemaName(result, schemaName, behavior);
        }
 public override void FillSolutionComponent(ICollection <SolutionComponent> result, SolutionImageComponent solutionImageComponent)
 {
 }
Ejemplo n.º 11
0
        public virtual void FillSolutionComponent(ICollection <SolutionComponent> result, SolutionImageComponent solutionImageComponent)
        {
            if (solutionImageComponent == null || !solutionImageComponent.ObjectId.HasValue)
            {
                return;
            }

            FillSolutionComponentInternal(result, solutionImageComponent.ObjectId.Value, solutionImageComponent.RootComponentBehavior);
        }
        public override void FillSolutionComponent(ICollection <SolutionComponent> result, SolutionImageComponent solutionImageComponent)
        {
            if (solutionImageComponent == null)
            {
                return;
            }

            if (!string.IsNullOrEmpty(solutionImageComponent.SchemaName) &&
                !string.IsNullOrEmpty(solutionImageComponent.ParentSchemaName) &&
                int.TryParse(solutionImageComponent.ParentSchemaName, out var langCode)
                )
            {
                string key      = solutionImageComponent.SchemaName;
                int?   behavior = solutionImageComponent.RootComponentBehavior;

                var repository = new DisplayStringRepository(_service);

                var entity = repository.GetByKeyAndLanguage(key, langCode, new ColumnSet(false));

                if (entity != null)
                {
                    FillSolutionComponentInternal(result, entity.Id, behavior);
                }
            }
        }
Ejemplo n.º 13
0
        public virtual void FillSolutionComponent(ICollection <SolutionComponent> result, SolutionImageComponent solutionImageComponent)
        {
            if (solutionImageComponent == null || !solutionImageComponent.ObjectId.HasValue)
            {
                return;
            }

            Guid entityId = solutionImageComponent.ObjectId.Value;
            int? behavior = solutionImageComponent.RootComponentBehavior;

            FillSolutionComponentInternal(result, entityId, behavior);
        }
Ejemplo n.º 14
0
        public override void FillSolutionComponent(ICollection <SolutionComponent> result, SolutionImageComponent solutionImageComponent)
        {
            if (solutionImageComponent == null)
            {
                return;
            }

            if (FillSolutionComponentFromSchemaName(result, solutionImageComponent.SchemaName, solutionImageComponent.RootComponentBehavior))
            {
                return;
            }

            base.FillSolutionComponent(result, solutionImageComponent);
        }