public OutputsRegion(ModelItem modelItem, bool isObjectOutputUsed, IFieldAndPropertyMapper mapper) : this(mapper) { Dependants = new List <IToolRegion>(); _modelItem = modelItem; var serviceOutputMappings = _modelItem.GetProperty <ICollection <IServiceOutputMapping> >("Outputs"); if (_modelItem.GetProperty("Outputs") == null || _modelItem.GetProperty <IList <IServiceOutputMapping> >("Outputs").Count == 0) { var current = serviceOutputMappings; if (current == null) { IsEnabled = false; } var outputMappings = current ?? new List <IServiceOutputMapping>(); var outputs = new ObservableCollection <IServiceOutputMapping>(); outputs.CollectionChanged += OutputsCollectionChanged; outputs.AddRange(outputMappings); Outputs = outputs; } else { IsEnabled = true; var outputs = new ObservableCollection <IServiceOutputMapping>(); outputs.CollectionChanged += OutputsCollectionChanged; outputs.AddRange(serviceOutputMappings); Outputs = outputs; } IsObject = _modelItem.GetProperty <bool>("IsObject"); ObjectResult = _modelItem.GetProperty <string>("ObjectResult"); ObjectName = _modelItem.GetProperty <string>("ObjectName"); IsObjectOutputUsed = isObjectOutputUsed; IsOutputsEmptyRows = !IsObject ? Outputs.Count == 0 : !string.IsNullOrWhiteSpace(ObjectResult); }
public OutputsRegion(ModelItem modelItem, bool isObjectOutputUsed, IFieldAndPropertyMapper mapper) : this(mapper) { Dependants = new List <IToolRegion>(); _modelItem = modelItem; var serviceOutputMappings = _modelItem.GetProperty <ICollection <IServiceOutputMapping> >("Outputs"); var outputs = new ObservableCollection <IServiceOutputMapping>(); IsEnabled = serviceOutputMappings != null; if (serviceOutputMappings != null) { outputs.AddRange(serviceOutputMappings); } outputs.CollectionChanged += OutputsCollectionChanged; Outputs = outputs; IsObject = _modelItem.GetProperty <bool>("IsObject"); IsResponseBase64 = _modelItem.GetProperty <bool>("IsResponseBase64"); ObjectResult = _modelItem.GetProperty <string>("ObjectResult"); ObjectName = _modelItem.GetProperty <string>("ObjectName"); IsObjectOutputUsed = isObjectOutputUsed; IsOutputsEmptyRows = !IsObject ? Outputs.Count == 0 : !string.IsNullOrWhiteSpace(ObjectResult); }
public OutputsRegion(IFieldAndPropertyMapper mapper) { _mapper = mapper; ToolRegionName = "OutputsRegion"; _shellViewModel = CustomContainer.Get <IShellViewModel>(); }