本文整理汇总了C#中IConverter类的典型用法代码示例。如果您正苦于以下问题:C# IConverter类的具体用法?C# IConverter怎么用?C# IConverter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IConverter类属于命名空间,在下文中一共展示了IConverter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ArmorConverter
/// <summary>Initializes a new instance of the <see cref="ArmorConverter"/> class.</summary>
/// <param name="converterFactory"></param>
/// <param name="weightClassConverter">The converter for <see cref="WeightClass"/>.</param>
/// <param name="infusionSlotCollectionConverter">The converter for <see cref="ICollection{InfusionSlot}"/>.</param>
/// <param name="infixUpgradeConverter">The converter for <see cref="InfixUpgrade"/>.</param>
public ArmorConverter(
ITypeConverterFactory<ItemDTO, Armor> converterFactory,
IConverter<string, WeightClass> weightClassConverter,
IConverter<ICollection<InfusionSlotDTO>, ICollection<InfusionSlot>> infusionSlotCollectionConverter,
IConverter<InfixUpgradeDTO, InfixUpgrade> infixUpgradeConverter)
: this(converterFactory)
{
if (weightClassConverter == null)
{
throw new ArgumentNullException("weightClassConverter");
}
if (infusionSlotCollectionConverter == null)
{
throw new ArgumentNullException("infusionSlotCollectionConverter");
}
if (infixUpgradeConverter == null)
{
throw new ArgumentNullException("infixUpgradeConverter");
}
this.weightClassConverter = weightClassConverter;
this.infusionSlotCollectionConverter = infusionSlotCollectionConverter;
this.infixUpgradeConverter = infixUpgradeConverter;
}
示例2: CompetitiveMapConverter
/// <summary>Initializes a new instance of the <see cref="CompetitiveMapConverter"/> class.</summary>
/// <param name="converterFactory"></param>
/// <param name="scoreboardConverter">The converter for <see cref="Scoreboard"/>.</param>
/// <param name="objectiveConverter">The converter for <see cref="Objective"/>.</param>
/// <param name="mapBonusConverter">The converter for <see cref="MapBonus"/>.</param>
public CompetitiveMapConverter(
ITypeConverterFactory<CompetitiveMapDTO, CompetitiveMap> converterFactory,
IConverter<int[], Scoreboard> scoreboardConverter,
IConverter<ObjectiveDTO, Objective> objectiveConverter,
IConverter<MapBonusDTO, MapBonus> mapBonusConverter)
: this(converterFactory)
{
if (scoreboardConverter == null)
{
throw new ArgumentNullException("scoreboardConverter");
}
if (objectiveConverter == null)
{
throw new ArgumentNullException("objectiveConverter");
}
if (mapBonusConverter == null)
{
throw new ArgumentNullException("mapBonusConverter");
}
this.scoreboardConverter = scoreboardConverter;
this.objectiveConverter = objectiveConverter;
this.mapBonusConverter = mapBonusConverter;
}
示例3: UpgradeComponentConverter
/// <summary>Initializes a new instance of the <see cref="UpgradeComponentConverter"/> class.</summary>
/// <param name="converterFactory"></param>
/// <param name="upgradeComponentFlagCollectionConverter">The converter for <see cref="UpgradeComponentFlags"/>.</param>
/// <param name="infusionSlotFlagCollectionConverter">The converter for <see cref="ICollection{InfusionSlotFlags}"/>.</param>
/// <param name="infixUpgradeConverter">The converter for <see cref="InfixUpgrade"/>.</param>
public UpgradeComponentConverter(
ITypeConverterFactory<ItemDTO, UpgradeComponent> converterFactory,
IConverter<ICollection<string>, UpgradeComponentFlags> upgradeComponentFlagCollectionConverter,
IConverter<ICollection<string>, InfusionSlotFlags> infusionSlotFlagCollectionConverter,
IConverter<InfixUpgradeDTO, InfixUpgrade> infixUpgradeConverter)
: this(converterFactory)
{
if (upgradeComponentFlagCollectionConverter == null)
{
throw new ArgumentNullException("upgradeComponentFlagCollectionConverter");
}
if (infusionSlotFlagCollectionConverter == null)
{
throw new ArgumentNullException("infusionSlotFlagCollectionConverter");
}
if (infixUpgradeConverter == null)
{
throw new ArgumentNullException("infixUpgradeConverter");
}
this.upgradeComponentFlagCollectionConverter = upgradeComponentFlagCollectionConverter;
this.infusionSlotFlagCollectionConverter = infusionSlotFlagCollectionConverter;
this.infixUpgradeConverter = infixUpgradeConverter;
}
示例4: QuestionsService
public QuestionsService(IStatRepository<Stat> statRepository, IRepository<Word> wordRepository, IConverter converter)
{
this.statRepository = statRepository;
this.wordRepository = wordRepository;
this.converter = converter;
}
示例5: BuildService
/// <summary>Initializes a new instance of the <see cref="BuildService"/> class.</summary>
/// <param name="serviceClient">The service client.</param>
/// <param name="converterForBuild">The converter for <see cref="Build"/>.</param>
internal BuildService(IServiceClient serviceClient, IConverter<BuildDataContract, Build> converterForBuild)
{
Debug.Assert(serviceClient != null, "serviceClient != null");
Debug.Assert(converterForBuild != null, "converterForBuild != null");
this.serviceClient = serviceClient;
this.converterForBuild = converterForBuild;
}
示例6: LetteraMessageService
public LetteraMessageService(IMessaggisticaService messaggisticaService, IConfigurationMessageService configurationService, IConverter converter, IDaoFactory daoFactory)
{
_messaggisticaService = messaggisticaService;
_configurationService = configurationService;
_converter = converter;
_daoFactory = daoFactory;
}
示例7: AddNode
public override INode AddNode(INode currentParent, IConverter converter)
{
//If the current parent is neither the root nor a group
if(!(currentParent is IMotherNode))
throw new ArgumentException("Trying to insert an 'AS' node, but the current node's type '" + currentParent.GetType() + "' is illegal. " + CheckString);
GroupNode group;
//If the current parent is the root
if (currentParent is RootNode)
{
group = (currentParent as IMotherNode).Children.Last() as GroupNode;
if (group == null)
throw new ArgumentException("Trying to insert an 'AS' node, but no Group found at root nor in its children. " + CheckString);
}
// The current parent is the group
else if (currentParent is GroupNode)
group = currentParent as GroupNode;
// The group is the last child of the current parent
else if ((currentParent as IMotherNode).Children.Last() is GroupNode)
group = (currentParent as IMotherNode).Children.Last() as GroupNode;
else
throw new ArgumentException("Trying to insert an 'AS' node, but the current node is neither a group nor contains a group as children. " + CheckString);
if (converter != null && converter.Function != null && converter.Function.Arguments != null && converter.Function.Arguments.Any())
group.Name = converter.Function.Arguments[0].ToString();
return currentParent;
}
示例8: AddNode
public override INode AddNode(INode currentParent, IConverter converter)
{
INode orNode = new OrNode(converter);
//// First element of a chain
//if (currentParent is RootNode)
// throw new NotImplementedException("Or cannot be the first element");
// Insert at root
if (currentParent is RootNode)
{
var root = (currentParent as RootNode);
var firstChild = root.Children.First();
firstChild.Parent = orNode;
(orNode as OrNode).Children.Add(firstChild);
orNode.Parent = root;
root.Children.Remove(firstChild);
}
// Insert before its parent
else if (currentParent.Parent != null && currentParent.Parent as IMotherNode != null)
{
var grandParent = currentParent.Parent as IMotherNode;
grandParent.Children.Remove(currentParent);
(orNode as OrNode).Children.Add(currentParent);
currentParent = currentParent.Parent;
}
this.LinkNodeToParent(currentParent, orNode);
return orNode;
}
示例9: ArtistPageViewModel
public ArtistPageViewModel(
INavigationService navigationService,
ILibraryService libraryService,
IEnumerable<IMetadataProvider> metadataProviders,
IConverter<WebAlbum, Album> webAlbumConverter,
IConverter<WebArtist, Artist> webArtistConverter,
IConverter<WebSong, Track> webSongConverter,
ISettingsUtility settingsUtility)
{
_navigationService = navigationService;
_libraryService = libraryService;
_webAlbumConverter = webAlbumConverter;
_metadataProviders = metadataProviders.FilterAndSort<IExtendedMetadataProvider>();
_webArtistConverter = webArtistConverter;
_webSongConverter = webSongConverter;
_settingsUtility = settingsUtility;
AlbumClickCommand = new DelegateCommand<ItemClickEventArgs>(AlbumClickExecute);
WebAlbumClickCommand = new DelegateCommand<ItemClickEventArgs>(WebAlbumClickExecute);
if (IsInDesignMode)
{
OnNavigatedTo("Childish Gambino", NavigationMode.New, new Dictionary<string, object>());
}
}
示例10: ItemConverter
/// <summary>Initializes a new instance of the <see cref="ItemConverter"/> class.</summary>
/// <param name="converterFactory"></param>
/// <param name="itemRarityConverter">The converter for <see cref="ItemRarity"/>.</param>
/// <param name="gameTypesConverter">The converter for <see cref="GameTypes"/>.</param>
/// <param name="itemFlagsConverter">The converter for <see cref="ItemFlags"/>.</param>
/// <param name="itemRestrictionsConverter">The converter for <see cref="ItemRestrictions"/>.</param>
public ItemConverter(
ITypeConverterFactory<ItemDTO, Item> converterFactory,
IConverter<string, ItemRarity> itemRarityConverter,
IConverter<ICollection<string>, GameTypes> gameTypesConverter,
IConverter<ICollection<string>, ItemFlags> itemFlagsConverter,
IConverter<ICollection<string>, ItemRestrictions> itemRestrictionsConverter)
: this(converterFactory)
{
if (itemRarityConverter == null)
{
throw new ArgumentNullException("itemRarityConverter");
}
if (gameTypesConverter == null)
{
throw new ArgumentNullException("gameTypesConverter");
}
if (itemFlagsConverter == null)
{
throw new ArgumentNullException("itemFlagsConverter");
}
if (itemRestrictionsConverter == null)
{
throw new ArgumentNullException("itemRestrictionsConverter");
}
this.itemRarityConverter = itemRarityConverter;
this.gameTypesConverter = gameTypesConverter;
this.itemFlagsConverter = itemFlagsConverter;
this.itemRestrictionsConverter = itemRestrictionsConverter;
}
示例11: WeaponConverter
/// <summary>Initializes a new instance of the <see cref="WeaponConverter"/> class.</summary>
/// <param name="converterFactory"></param>
/// <param name="damageTypeConverter"></param>
/// <param name="infusionSlotCollectionConverter"></param>
/// <param name="infixUpgradeConverter"></param>
public WeaponConverter(
ITypeConverterFactory<ItemDTO, Weapon> converterFactory,
IConverter<string, DamageType> damageTypeConverter,
IConverter<ICollection<InfusionSlotDTO>, ICollection<InfusionSlot>> infusionSlotCollectionConverter,
IConverter<InfixUpgradeDTO, InfixUpgrade> infixUpgradeConverter)
: this(converterFactory)
{
if (damageTypeConverter == null)
{
throw new ArgumentNullException("damageTypeConverter");
}
if (infixUpgradeConverter == null)
{
throw new ArgumentNullException("infixUpgradeConverter");
}
if (infusionSlotCollectionConverter == null)
{
throw new ArgumentNullException("infusionSlotCollectionConverter");
}
this.damageTypeConverter = damageTypeConverter;
this.infixUpgradeConverter = infixUpgradeConverter;
this.infusionSlotCollectionConverter = infusionSlotCollectionConverter;
}
示例12: EntityBindingDetail
/// <summary>
/// Initializes a new instance of the <see cref="EntityBindingDetail"/> class.
/// </summary>
/// <param name="entityProperty">The entity property.</param>
/// <param name="valueKey">The value key.</param>
/// <param name="converter">The converter.</param>
/// <param name="bindingType">Type of the binding.</param>
public EntityBindingDetail(PropertyInfo entityProperty, string valueKey, IConverter converter, BindingType bindingType)
{
this.EntityProperty = entityProperty;
this.ValueKey = valueKey;
this.Converter = converter;
this.BindingType = bindingType;
}
示例13: LoadConverter
private static void LoadConverter()
{
if (_converter == null)
{
_converter = (IConverter)Activator.CreateInstance(ConfigurationManager.Converter.Type);
}
}
示例14: RecipeConverter
/// <summary>Initializes a new instance of the <see cref="RecipeConverter"/> class.</summary>
/// <param name="converterFactory"></param>
/// <param name="craftingDisciplineCollectionConverter">The converter for <see cref="CraftingDisciplines"/>.</param>
/// <param name="recipeFlagCollectionConverter">The converter for <see cref="RecipeFlags"/>.</param>
/// <param name="itemQuantityCollectionConverter">The converter for <see cref="T:ICollection{ItemQuantity}"/>.</param>
public RecipeConverter(
ITypeConverterFactory<RecipeDTO, Recipe> converterFactory,
IConverter<ICollection<string>, CraftingDisciplines> craftingDisciplineCollectionConverter,
IConverter<ICollection<string>, RecipeFlags> recipeFlagCollectionConverter,
IConverter<ICollection<IngredientDTO>, ICollection<ItemQuantity>> itemQuantityCollectionConverter)
: this(converterFactory)
{
if (craftingDisciplineCollectionConverter == null)
{
throw new ArgumentNullException("craftingDisciplineCollectionConverter");
}
if (recipeFlagCollectionConverter == null)
{
throw new ArgumentNullException("recipeFlagCollectionConverter");
}
if (itemQuantityCollectionConverter == null)
{
throw new ArgumentNullException("itemQuantityCollectionConverter");
}
this.craftingDisciplineCollectionConverter = craftingDisciplineCollectionConverter;
this.recipeFlagCollectionConverter = recipeFlagCollectionConverter;
this.itemQuantityCollectionConverter = itemQuantityCollectionConverter;
}
示例15: ScheduleIndexJobs
public ScheduleIndexJobs(SourceStorageFactory sourceStorageFactory, IScheduler scheduler)
{
_sourceStorageFactory = sourceStorageFactory;
_scheduler = scheduler;
Sources = new IItemSource[] { };
Converters = new IConverter[] { };
}