public static StorageTypeConverter GetTypeConverter(IModificationContext context) { if (context == null) { throw new ArgumentException("context"); } StorageTypeConverter converter = context.Get <StorageTypeConverter>(TypeConverter, null); if (converter != null) { return(converter); } // Create the converter // Get the provider informations first IProviderInformation originalProvider = context.Get <IProviderInformation>(ModificationContextHelper.OriginalProvider, null); IProviderInformation newProvider = context.Get <IProviderInformation>(ModificationContextHelper.NewProvider, null); if (originalProvider == null) { throw new ArgumentException("", "context"); } if (newProvider == null) { throw new ArgumentException("", "context"); } converter = new StorageTypeConverter(originalProvider, newProvider); // Store for future usage context.Set(TypeConverter, converter); return(converter); }
public static StorageTypeConverter GetTypeConverter(IModificationContext context) { if (context == null) { throw new ArgumentException("context"); } StorageTypeConverter converter = context.Get<StorageTypeConverter>(TypeConverter, null); if (converter != null) { return converter; } // Create the converter // Get the provider informations first IProviderInformation originalProvider = context.Get<IProviderInformation>(ModificationContextHelper.OriginalProvider, null); IProviderInformation newProvider = context.Get<IProviderInformation>(ModificationContextHelper.NewProvider, null); if (originalProvider == null) { throw new ArgumentException("", "context"); } if (newProvider == null) { throw new ArgumentException("", "context"); } converter = new StorageTypeConverter(originalProvider, newProvider); // Store for future usage context.Set(TypeConverter, converter); return converter; }
public void Modify(XAttribute attribute, IModificationContext context) { if (attribute == null) { throw new ArgumentNullException("attribute"); } if (context == null) { throw new ArgumentNullException("context"); } IProviderInformation newProvider = context.Get<IProviderInformation>(ModificationContextHelper.NewProvider, null); if (newProvider == null) { throw new InvalidOperationException(); } attribute.Value = newProvider.InvariantName; }
public void Modify(XAttribute attribute, IModificationContext context) { if (attribute == null) { throw new ArgumentNullException("attribute"); } if (context == null) { throw new ArgumentNullException("context"); } IProviderInformation newProvider = context.Get <IProviderInformation>(ModificationContextHelper.NewProvider, null); if (newProvider == null) { throw new InvalidOperationException(); } attribute.Value = newProvider.ManifestToken; }