public AirSyncDataObject(IList <IProperty> propertyFromSchemaLinkId, IAirSyncMissingPropertyStrategy missingPropStrategy, IAirSyncDataObjectGenerator schemaState) { if (propertyFromSchemaLinkId == null) { throw new ArgumentNullException("propertyFromSchemaLinkId"); } if (missingPropStrategy == null) { throw new ArgumentNullException("missingPropStrategy"); } this.missingPropStrategy = missingPropStrategy; this.propertyFromSchemaLinkId = propertyFromSchemaLinkId; this.schemaState = schemaState; this.propertyFromAirSyncTag = new Dictionary <string, AirSyncProperty>(propertyFromSchemaLinkId.Count); for (int i = 0; i < propertyFromSchemaLinkId.Count; i++) { AirSyncProperty airSyncProperty = (AirSyncProperty)propertyFromSchemaLinkId[i]; if (airSyncProperty == null) { throw new ArgumentNullException("airSyncProperty"); } if (airSyncProperty.AirSyncTagNames == null) { throw new ArgumentNullException("airSyncProperty.AirSyncTagNames"); } for (int j = 0; j < airSyncProperty.AirSyncTagNames.Length; j++) { if (airSyncProperty.AirSyncTagNames[j] != null) { this.propertyFromAirSyncTag[airSyncProperty.AirSyncTagNames[j]] = airSyncProperty; } } } this.missingPropStrategy.Validate(this); }
public override void SetSchemaConverterOptions(IDictionary schemaConverterOptions, IAirSyncVersionFactory versionFactory) { AirSyncEntitySchemaState airSyncEntitySchemaState = (AirSyncEntitySchemaState)base.SchemaState; IAirSyncMissingPropertyStrategy missingPropertyStrategy = versionFactory.CreateMissingPropertyStrategy(base.SupportedTags); base.ChangeTrackFilter = ChangeTrackingFilterFactory.CreateFilter(base.ClassType, base.ProtocolVersion); base.AirSyncDataObject = airSyncEntitySchemaState.GetAirSyncDataObject(schemaConverterOptions, missingPropertyStrategy); this.EntityDataObject = airSyncEntitySchemaState.GetEntityDataObject(); }
public override void SetSchemaConverterOptions(IDictionary schemaConverterOptions, IAirSyncVersionFactory versionFactory) { AirSyncRecipientInfoCacheSchemaState airSyncRecipientInfoCacheSchemaState = (AirSyncRecipientInfoCacheSchemaState)base.SchemaState; base.ChangeTrackFilter = ChangeTrackingFilterFactory.CreateFilter(base.ClassType, base.ProtocolVersion); IAirSyncMissingPropertyStrategy missingPropertyStrategy = versionFactory.CreateMissingPropertyStrategy(null); base.AirSyncDataObject = airSyncRecipientInfoCacheSchemaState.GetAirSyncDataObject(schemaConverterOptions, missingPropertyStrategy); this.recipientInfoCacheDataObject = airSyncRecipientInfoCacheSchemaState.GetRecipientInfoCacheDataObject(); }
public AirSyncDataObject GetInnerAirSyncDataObject(IAirSyncMissingPropertyStrategy strategy) { if (this.innerSchemaState == null) { return(null); } List <IProperty> schema = this.innerSchemaState.GetSchema(0); for (int i = 0; i < schema.Count; i++) { AirSyncProperty airSyncProperty = (AirSyncProperty)schema[i]; airSyncProperty.Options = this.options; } return(new AirSyncDataObject(schema, strategy, null)); }
public SchemaCacheItem(AirSyncSchemaState schemaState, IAirSyncMissingPropertyStrategy missingPropertyStrategy) { this.schemaState = schemaState; AirSyncEntitySchemaState airSyncEntitySchemaState = this.schemaState as AirSyncEntitySchemaState; AirSyncXsoSchemaState airSyncXsoSchemaState = this.schemaState as AirSyncXsoSchemaState; if (airSyncEntitySchemaState != null) { this.mailboxDataObject = airSyncEntitySchemaState.GetEntityDataObject(); } else { if (airSyncXsoSchemaState == null) { throw new ApplicationException(string.Format("SchemaState of type {0} is not supported", schemaState.GetType().FullName)); } this.mailboxDataObject = airSyncXsoSchemaState.GetXsoDataObject(); } this.airSyncDataObject = this.schemaState.GetAirSyncDataObject(new Hashtable(), missingPropertyStrategy); }
public AirSyncDataObject GetAirSyncDataObject(IDictionary options, IAirSyncMissingPropertyStrategy missingPropertyStrategy) { if (options == null) { throw new ArgumentNullException("options"); } if (missingPropertyStrategy == null) { throw new ArgumentNullException("missingPropertyStrategy"); } this.options = options; this.missingPropertyStrategy = missingPropertyStrategy; List <IProperty> schema = base.GetSchema(0); for (int i = 0; i < schema.Count; i++) { AirSyncProperty airSyncProperty = (AirSyncProperty)schema[i]; airSyncProperty.Options = this.options; } return(new AirSyncDataObject(schema, this.missingPropertyStrategy, this)); }