Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ObservableWeaver"/> class.
        /// </summary>
        /// <param name="parentWeaver">A reference to the Parent Cortex.Net weaver.</param>
        /// <param name="enumerableInterfaceWeaver">An implementation of <see cref="IEnumerableInterfaceWeaver" />.</param>
        /// <param name="processorQueue">The queue to add ILProcessor actions to.</param>
        /// <param name="resolvedTypes">The resolved types necessary by this weaver.</param>
        /// <exception cref="ArgumentNullException">When any of the arguments is null.</exception>
        public ObservableWeaver(BaseModuleWeaver parentWeaver, IEnumerableInterfaceWeaver enumerableInterfaceWeaver, ISharedStateAssignmentILProcessorQueue processorQueue, IDictionary <string, TypeReference> resolvedTypes)
            : base(parentWeaver, processorQueue, resolvedTypes)
        {
            if (resolvedTypes is null)
            {
                throw new ArgumentNullException(nameof(resolvedTypes));
            }

            this.enumerableInterfaceWeaver = enumerableInterfaceWeaver ?? throw new ArgumentNullException(nameof(enumerableInterfaceWeaver));

            this.observableAttributeReference  = resolvedTypes["Cortex.Net.Api.ObservableAttribute"];
            this.deepEnhancerReference         = resolvedTypes["Cortex.Net.Types.DeepEnhancer"];
            this.observableObjectReference     = resolvedTypes["Cortex.Net.Types.ObservableObject"];
            this.observableCollectionReference = resolvedTypes["Cortex.Net.Types.ObservableCollection`1"];
            this.actionExtensionsReference     = resolvedTypes["Cortex.Net.Core.ActionExtensions"];
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ObservableWeaver"/> class.
 /// </summary>
 /// <param name="parentWeaver">A reference to the Parent Cortex.Net weaver.</param>
 /// <param name="enumerableInterfaceWeaver">An implementation of <see cref="IEnumerableInterfaceWeaver" />.</param>
 /// <param name="processorQueue">The queue to add ILProcessor actions to.</param>
 /// <param name="weavingContext">The resolved types necessary by this weaver.</param>
 /// <exception cref="ArgumentNullException">When any of the arguments is null.</exception>
 public ObservableWeaver(ModuleWeaver parentWeaver, IEnumerableInterfaceWeaver enumerableInterfaceWeaver, ISharedStateAssignmentILProcessorQueue processorQueue, WeavingContext weavingContext)
     : base(parentWeaver, processorQueue, weavingContext)
 {
     this.enumerableInterfaceWeaver = enumerableInterfaceWeaver ?? throw new ArgumentNullException(nameof(enumerableInterfaceWeaver));
 }