/// <summary> /// Initializes a new instance of the <see cref="ChecklistFieldMapping"/> class. /// </summary> /// <param name="property"> /// The property. /// </param> /// <param name="valueExpression"> /// The value expression. /// </param> /// <param name="childMappings"> /// The child mappings. /// </param> /// <param name="dynamicTypeManager"> /// The dynamic type manager. /// </param> public ChecklistFieldMapping( PropertyInfo property, MappingExpression valueExpression, IEnumerable<IProcessFieldMapping> childMappings, IDynamicTypeManager dynamicTypeManager) { if (property == null) throw new ArgumentNullException("property"); var checklistAttribute = property.GetCustomAttribute<ChecklistFieldAttribute>(); if (checklistAttribute == null) throw new ArgumentException("The specified property is not a checklist field."); if (childMappings == null) throw new ArgumentNullException("childMappings"); var childMappingsArray = childMappings.ToArray(); if (childMappingsArray.All(m => !m.IsKey)) throw new ArgumentException("At least one key field should be specified."); if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); _property = property; _valueExpression = valueExpression; _childMappings = childMappingsArray; _dynamicTypeManager = dynamicTypeManager; _answerProcessName = checklistAttribute.AnswerProcessName; }
/// <summary> /// Initializes a new instance of the <see cref="MultiCrossReferenceFieldMapping"/> class. /// </summary> /// <param name="property"> /// The property. /// </param> /// <param name="valueExpression"> /// The value expression. /// </param> /// <param name="childMappings"> /// The child mappings. /// </param> /// <param name="dynamicTypeManager"> /// The dynamic type manager. /// </param> /// <param name="runtimeDatabase"> /// The runtime database. /// </param> public MultiCrossReferenceFieldMapping( PropertyInfo property, MappingExpression valueExpression, IEnumerable<IProcessFieldMapping> childMappings, IDynamicTypeManager dynamicTypeManager, IRuntimeDatabase runtimeDatabase) { if (property == null) throw new ArgumentNullException("property"); var crAttribute = property.GetCustomAttribute<CrossRefFieldAttribute>(); if (crAttribute == null || !crAttribute.AllowMultiple) throw new ArgumentException("The specified property is not a multi cross reference field."); if (childMappings == null) throw new ArgumentNullException("childMappings"); var childMappingsArray = childMappings.ToArray(); if (childMappingsArray.All(m => !m.IsKey)) throw new ArgumentException("At least one key field should be specified."); if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); if (runtimeDatabase == null) throw new ArgumentNullException("runtimeDatabase"); _property = property; _valueExpression = valueExpression; _childMappings = childMappingsArray; _dynamicTypeManager = dynamicTypeManager; _runtimeDatabase = runtimeDatabase; _referencedProcessName = crAttribute.ReferenceTableName; }
public void Init() { dynamicManagerMock = Mock.Create<IDynamicTypeManager>(); systemOptions = Mock.Create<ISystemOptionsWrapper>(); this.SetPassword(UserPassword); this.SetSystemOptions(); }
/// <summary> /// Initializes a new instance of the <see cref="SelectQueryGenerator"/> class. /// </summary> /// <param name="dynamicTypeManager"> /// The dynamic type manager. /// </param> public SelectQueryGenerator(IDynamicTypeManager dynamicTypeManager) { if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); _dynamicTypeManager = dynamicTypeManager; }
public ProcessFieldItemsRetrieverFactory(IDynamicTypeManager dynamicTypeManager) { if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); _dynamicTypeManager = dynamicTypeManager; }
/// <summary> /// Initializes a new instance of the <see cref="SingleCrossReferenceFieldMapping"/> class. /// </summary> /// <param name="property"> /// The property. /// </param> /// <param name="valueExpression"> /// The value expression. /// </param> /// <param name="isKey"> /// Specifies whether this is a key mapping. /// </param> /// <param name="typeConverter"> /// The type converter. /// </param> /// <param name="dynamicTypeManager"> /// The dynamic type manager. /// </param> /// <param name="runtimeDatabase"> /// The runtime database. /// </param> /// <param name="childMappings"> /// The child mappings. /// </param> public SingleCrossReferenceFieldMapping( PropertyInfo property, MappingExpression valueExpression, bool isKey, ITypeConverter typeConverter, IDynamicTypeManager dynamicTypeManager, IRuntimeDatabase runtimeDatabase, IEnumerable<IProcessFieldMapping> childMappings) { if (property == null) throw new ArgumentNullException("property"); var crAttribute = property.GetCustomAttribute<CrossRefFieldAttribute>(); if (crAttribute == null || crAttribute.AllowMultiple || !typeof(int?).IsAssignableFrom(property.PropertyType)) throw new ArgumentException("The specified property is not a single cross reference field."); if (typeConverter == null) throw new ArgumentNullException("typeConverter"); if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); if (runtimeDatabase == null) throw new ArgumentNullException("runtimeDatabase"); _property = property; _valueExpression = valueExpression; _isKey = isKey; _typeConverter = typeConverter; _dynamicTypeManager = dynamicTypeManager; _runtimeDatabase = runtimeDatabase; _childMappings = (childMappings ?? Enumerable.Empty<IProcessFieldMapping>()).ToArray(); _referencedProcessName = crAttribute.ReferenceTableName; }
/// <summary> /// Initializes a new instance of the <see cref="ReverseCrossReferenceItemsRetriever"/> class. /// </summary> /// <param name="propertyInfo"> /// The property info. /// </param> /// <param name="dynamicTypeManager"> /// The dynamic type manager. /// </param> /// <exception cref="ArgumentNullException"> /// The <paramref name="propertyInfo"/> parameter is null. /// </exception> /// <exception cref="ArgumentException"> /// The <paramref name="propertyInfo"/> parameter is not a valid reverse cross reference field. /// </exception> /// <exception cref="ArgumentNullException"> /// The <paramref name="dynamicTypeManager"/> parameter is null. /// </exception> public ReverseCrossReferenceItemsRetriever(PropertyInfo propertyInfo, IDynamicTypeManager dynamicTypeManager) { if (propertyInfo == null) throw new ArgumentNullException("propertyInfo"); if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); _property = propertyInfo; _dynamicTypeManager = dynamicTypeManager; var rcrAttribute = Property.GetCustomAttribute<ReverseCrossRefFieldAttribute>(); if (rcrAttribute == null) throw new ArgumentException( string.Format( CultureInfo.InvariantCulture, "The property \"{0}\" in type \"{1}\" is not a valid reverse cross-reference field.", Property.Name, Property.DeclaringType != null ? Property.DeclaringType.AssemblyQualifiedName : string.Empty), "propertyInfo"); _displayMultiple = rcrAttribute.DisplayMultiple; _itemType = DynamicTypeManager.GetEditableRootType(rcrAttribute.ReferenceTableName); _elementProcessName = rcrAttribute.ReferenceTableName; }
public void TestInit() { _searchCommandFactory = Mock.Create<ISearchCommandFactory>(Behavior.Loose); _searchUtils = Mock.Create<ISearchUtils>(Behavior.Loose); _logger = Mock.Create<ILogger>(Behavior.Loose); _filteringUtils = Mock.Create<IFilteringUtils>(Behavior.Loose); _filterRepository = Mock.Create<IFilterRepository>(Behavior.Loose); _layoutRepository = Mock.Create<ILayoutRepository>(Behavior.Loose); _searchResultFormatter = Mock.Create<ISearchResultFormatter>(Behavior.Loose); _searchResultFormatterCollection = new SearchResultFormatterCollection(new[] { _searchResultFormatter }); _detailsCommandFactory = Mock.Create<IDetailsCommandFactory>(Behavior.Loose); _dtm = Mock.Create<IDynamicTypeManager>(Behavior.Loose); }
public DetailsCommand(IDynamicTypeManager dynamicTypeManager) { if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); _dynamicTypeManager = dynamicTypeManager; _handlers.Add(ColumnTypes.Integer, new NumberFieldTypeHandler()); _handlers.Add(ColumnTypes.Image, new ImageFieldTypeHandler()); _handlers.Add(ColumnTypes.File, new FileFieldTypeHandler()); _handlers.Add(ColumnTypes.Frequency, new FrequencyFieldTypeHandler()); _handlers.Add(ColumnTypes.SampleType, new SampleTypeFieldTypeHandler()); }
public void TestInit() { _processRepository = Mock.Create<IProcessMetadataRepository>(Behavior.Loose); _dtm = Mock.Create<IDynamicTypeManager>(Behavior.Loose); _filterManager = Mock.Create<IFilterManager>(Behavior.Loose); _filterMetadataFactory = Mock.Create<IFilterMetadataFactory>(Behavior.Loose); _layoutManager = Mock.Create<ILayoutManager>(Behavior.Loose); _layoutMetadataFactory = Mock.Create<ILayoutMetadataFactory>(Behavior.Loose); _processMetadata = CreateProcess(ProcessName); Mock.Arrange(() => _processMetadata.SupportsStates).Returns(true); Mock.Arrange(() => _processRepository.GetProcessMetadata(ProcessName)).Returns(_processMetadata); }
public NavigationController(IDynamicTypeManager dynamicTypeManager, IColorTranslator colorTranslator, ILogger logger) { if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); if (colorTranslator == null) throw new ArgumentNullException("colorTranslator"); if (logger == null) throw new ArgumentNullException("logger"); _dynamicTypeManager = dynamicTypeManager; _colorTranslator = colorTranslator; _logger = logger; }
private ApprovalActionDefinition(Builder builder) : base(builder) { #if !SILVERLIGHT _dynamicTypeManager = builder.DynamicTypeManager; _communicationService = builder.CommunicationService; _personManager = builder.PersonManager; #endif _approvalFieldName = builder.ApprovalFieldName; #if !SILVERLIGHT _rules = new ReadOnlyCollection<IActionRule>(builder.Rule != null ? new[] { builder.Rule } : new IActionRule[0]); _dataContext = builder.DataContext; #endif }
public void TestInit() { _dynamicTypeManager = Mock.Create<IDynamicTypeManager>(Behavior.Loose); _filterManager = Mock.Create<IFilterManager>(Behavior.Loose); _layoutManager = Mock.Create<ILayoutManager>(Behavior.Loose); _searchUtils = Mock.Create<ISearchUtils>(Behavior.Loose); _processMetadataRepository = Mock.Create<IProcessMetadataRepository>(Behavior.Loose); _filterDescriptorFactory = Mock.Create<IFilterDescriptorFactory>(Behavior.Loose); _metricsManager = Mock.Create<IMetricsManager>(Behavior.Loose); _kpiManager = Mock.Create<IKPIManager>(Behavior.Loose); _filterRepository = Mock.Create<IFilterRepository>(Behavior.Loose); _processMetadata = Mock.Create<IProcessMetadata>(Behavior.Loose); Mock.Arrange(() => _processMetadata.Name).Returns(ProcessName); Mock.Arrange(() => _processMetadataRepository.GetProcessMetadata(ProcessName)).Returns(_processMetadata); }
private AssignmentActionDefinition(Builder builder) : base(builder) { #if !SILVERLIGHT _dynamicTypeManager = builder.DynamicTypeManager; _personManager = builder.PersonManager; _communicationService = builder.CommunicationService; #endif _dueDateFieldName = builder.DueDateFieldName; _isNotification = builder.IsNotification; #if !SILVERLIGHT _dataContext = builder.DataContext; _rules = new ReadOnlyCollection<IActionRule>(builder.Rules.ToArray()); #endif }
/// <summary> /// Gets the process fields. /// </summary> /// <param name="process">The process.</param> /// <returns></returns> public static IEnumerable<IFieldInfo> GetProcessFields(string process, IDynamicTypeManager dynamicTypeManager) { var itemType = dynamicTypeManager.GetEditableRootType(process); if (itemType == null) return null; var fields = AddFieldsForType(itemType); var baseEditProperty = itemType.GetProperty(Constants.BaseEditPropertyName); while (baseEditProperty != null) { fields.AddRange(AddFieldsForType(baseEditProperty.PropertyType)); baseEditProperty = baseEditProperty.PropertyType.GetProperty(Constants.BaseEditPropertyName); } return fields; }
/// <summary> /// Initializes a new instance of the <see cref="ChecklistItemsRetriever"/> class. /// </summary> /// <param name="propertyInfo"> /// The property info. /// </param> /// <param name="dynamicTypeManager"> /// The dynamic type manager. /// </param> /// <exception cref="ArgumentNullException"> /// The <paramref name="propertyInfo"/> parameter is null. /// </exception> /// <exception cref="ArgumentException"> /// The <paramref name="propertyInfo"/> parameter is not a checklist field. /// </exception> /// <exception cref="ArgumentNullException"> /// The <paramref name="dynamicTypeManager"/> parameter is null. /// </exception> public ChecklistItemsRetriever(PropertyInfo propertyInfo, IDynamicTypeManager dynamicTypeManager) { if (propertyInfo == null) throw new ArgumentNullException("propertyInfo"); if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); _property = propertyInfo; _dynamicTypeManager = dynamicTypeManager; var checklistAttribute = Property.GetCustomAttribute<ChecklistFieldAttribute>(); if (checklistAttribute == null) throw new ArgumentException( string.Format( CultureInfo.InvariantCulture, "The property \"{0}\" in type \"{1}\" is not valid checklist field.", Property.Name, Property.DeclaringType != null ? Property.DeclaringType.AssemblyQualifiedName : string.Empty), "propertyInfo"); _itemType = DynamicTypeManager.GetEditableRootType(checklistAttribute.AnswerProcessName); }
public FilteringUtils(IProcessMetadataRepository processRepository, IDynamicTypeManager dynamicTypeManager) { if (processRepository == null) throw new ArgumentNullException("processRepository"); if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); _processRepository = processRepository; _dynamicTypeManager = dynamicTypeManager; }
public KPIManager(IDynamicTypeManager dynamicTypeManager) { if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); _dynamicTypeManager = dynamicTypeManager; }
public DisplayListController(IDynamicTypeManager dynamicTypeManager) { if (dynamicTypeManager == null) throw new ArgumentNullException(); _dynamicTypeManager = dynamicTypeManager; }
public SearchUtils( IProcessMetadataRepository processMetadataRepository, IDynamicTypeManager dynamicTypeManager, IFilterManager filterManager, IFilterMetadataFactory filterMetadataFactory, ILayoutManager layoutManager, ILayoutMetadataFactory layoutMetadataFactory) { if (processMetadataRepository == null) throw new ArgumentNullException("processMetadataRepository"); if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); if (filterManager == null) throw new ArgumentNullException("filterManager"); if (filterMetadataFactory == null) throw new ArgumentNullException("filterMetadataFactory"); if (layoutManager == null) throw new ArgumentNullException("layoutManager"); if (layoutMetadataFactory == null) throw new ArgumentNullException("layoutMetadataFactory"); _processMetadataRepository = processMetadataRepository; _dynamicTypeManager = dynamicTypeManager; _filterManager = filterManager; _filterMetadataFactory = filterMetadataFactory; _layoutManager = layoutManager; _layoutMetadataFactory = layoutMetadataFactory; }
public void TestInit() { _dtm = Mock.Create<IDynamicTypeManager>(Behavior.Loose); }
public DataContext(string procesName, IDynamicTypeManager dynamicTypeManager) { _dynamicTypeManager = dynamicTypeManager; ProcessName = procesName; }
/// <summary> /// Initializes a new instance of the <see cref="ProcessMetadata"/> class. /// </summary> /// <param name="processName"> /// The process name. /// </param> /// <param name="processMetadataRepository"> /// The process metadata repository. /// </param> /// <param name="dynamicTypeManager"> /// The dynamic type manager. /// </param> /// <exception cref="ArgumentException"> /// The editable root type doesn't have a <see cref="ProcessInfoAttribute"/> attribute. /// </exception> public ProcessMetadata(string processName, IProcessMetadataRepository processMetadataRepository, IDynamicTypeManager dynamicTypeManager) { if (processMetadataRepository == null) throw new ArgumentNullException("processMetadataRepository"); if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); var editType = dynamicTypeManager.GetEditableRootType(processName); var infoType = dynamicTypeManager.GetInfoType(processName); _processInfo = editType.GetCustomAttribute<ProcessInfoAttribute>(false); if (_processInfo == null) throw new ArgumentException(@"ProcessInfo attribute not found.", "processName"); _repository = processMetadataRepository; if (typeof(IHasParent).IsAssignableFrom(editType)) { var baseEditProperty = editType.GetProperty(Constants.BaseEditPropertyName); if (baseEditProperty != null) { _baseProcess = new Lazy<IProcessMetadata>( () => Repository.GetProcessMetadata(baseEditProperty.PropertyType), LazyThreadSafetyMode.PublicationOnly); } } var properties = editType.GetProperties(BindingFlags.Instance | BindingFlags.Public); var fields = new List<IFieldMetadata>(); foreach (var editProperty in properties) { if (!Attribute.IsDefined(editProperty, typeof(FieldTypeAttribute), false)) { continue; } if (Attribute.IsDefined(editProperty, typeof(LocalizedFieldAttribute), false)) { continue; } var infoProperty = infoType.GetProperty(editProperty.Name, BindingFlags.Public | BindingFlags.Instance); fields.Add(FieldMetadataFactory.CreateFieldMetadata(this, editProperty, infoProperty)); } _fields = new ReadOnlyCollection<IFieldMetadata>(fields); foreach (var field in Fields) { _fieldMap[field.Name] = field; } var supportedLocalizations = new List<ILocalizationInfo>(editType.GetCustomAttributes<LocalizationInfoAttribute>(false)); _supportedLocalizations = new ReadOnlyCollection<ILocalizationInfo>(supportedLocalizations); var states = new List<IStateMetadata>(); if (Attribute.IsDefined(editType, typeof(SupportsStatesAttribute), false)) { _supportsStates = true; states.AddRange(editType.GetCustomAttributes<StateInfoAttribute>(false).Select(x => new StateMetadata(x)).OrderBy(s => s.Id)); } _states = new ReadOnlyCollection<IStateMetadata>(states); _hiddenFields = new HashSet<string>(dynamicTypeManager.GetHiddenFields(processName)); }
public ActionHelper(IDynamicTypeManager dynamicTypeManager, IFileHelper fileHelper) { if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); if (fileHelper == null) throw new ArgumentNullException("fileHelper"); _dynamicTypeManager = dynamicTypeManager; _fileHelper = fileHelper; }
public FileFieldController(IDynamicTypeManager dynamicTypeManager) { if (dynamicTypeManager == null) throw new ArgumentNullException(); _dynamicTypeManager = dynamicTypeManager; }
public void TestInit() { _dtm = Mock.Create<IDynamicTypeManager>(Behavior.Loose); Mock.Arrange(() => _dtm.GetEditableRootType(ReverseCrossReferenceProcessName)).Returns(typeof(RCRProcess)); }
public DetailsCommandFactory(IDynamicTypeManager dynamicTypeManager) { _dynamicTypeManager = dynamicTypeManager; }
/// <summary> /// Initializes a new instance of the <see cref="IntegrationServiceMethod"/> class. /// </summary> /// <param name="processName"> /// The process name. /// </param> /// <param name="fieldMappings"> /// The field mappings. /// </param> /// <param name="resultCalculator"> /// The result calculator. /// </param> /// <param name="dynamicTypeManager"> /// The dynamic type manager. /// </param> /// <param name="applicationContext"> /// The application context. /// </param> /// <param name="runtimeDatabase"> /// The runtime database. /// </param> /// <param name="editableRootDataContextFactory"> /// The editable root data context factory. /// </param> /// <param name="logger"> /// The logger. /// </param> public IntegrationServiceMethod( string processName, IEnumerable<IProcessFieldMapping> fieldMappings, IValueCalculator resultCalculator, IDynamicTypeManager dynamicTypeManager, IApplicationContext applicationContext, IRuntimeDatabase runtimeDatabase, IEditableRootDataContextFactory editableRootDataContextFactory, ILogger logger) { if (string.IsNullOrEmpty(processName)) throw new ArgumentException(@"The process name cannot be null or empty.", "processName"); if (fieldMappings == null) throw new ArgumentNullException("fieldMappings"); if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); if (applicationContext == null) throw new ArgumentNullException("applicationContext"); if (runtimeDatabase == null) throw new ArgumentNullException("runtimeDatabase"); if (editableRootDataContextFactory == null) throw new ArgumentNullException("editableRootDataContextFactory"); if (logger == null) throw new ArgumentNullException("logger"); ProcessName = processName; DynamicTypeManager = dynamicTypeManager; ApplicationContext = applicationContext; RuntimeDatabase = runtimeDatabase; EditableRootDataContextFactory = editableRootDataContextFactory; Logger = logger; foreach (var fieldMapping in fieldMappings) { FieldMappings.Add(fieldMapping); if (fieldMapping.IsKey) KeyMappings.Add(fieldMapping); } ResultCalculator = resultCalculator; }
public BulkUpdateController(IDynamicTypeManager dynamicTypeManager) { if (dynamicTypeManager == null) throw new ArgumentNullException(); _dynamicTypeManager = dynamicTypeManager; }
public FilterManager(IDynamicTypeManager dynamicTypeManager, IUtils utils) { if (dynamicTypeManager == null) throw new ArgumentNullException("dynamicTypeManager"); if (utils == null) throw new ArgumentNullException("utils"); _dynamicTypeManager = dynamicTypeManager; _utils = utils; }