当前位置: 首页>>代码示例>>C#>>正文


C# IConverter类代码示例

本文整理汇总了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;
        }
开发者ID:tigerbytes,项目名称:GW2.NET,代码行数:31,代码来源:ArmorConverter.cs

示例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;
        }
开发者ID:tigerbytes,项目名称:GW2.NET,代码行数:31,代码来源:CompetitiveMapConverter.cs

示例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;
        }
开发者ID:tigerbytes,项目名称:GW2.NET,代码行数:31,代码来源:UpgradeComponentConverter.cs

示例4: QuestionsService

        public QuestionsService(IStatRepository<Stat> statRepository, IRepository<Word> wordRepository, IConverter converter)
        {
            this.statRepository = statRepository;
            this.wordRepository = wordRepository;

            this.converter = converter;
        }
开发者ID:neodenit,项目名称:active-reader,代码行数:7,代码来源:QuestionsService.cs

示例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;
 }
开发者ID:gitter-badger,项目名称:GW2.NET,代码行数:10,代码来源:BuildService.cs

示例6: LetteraMessageService

 public LetteraMessageService(IMessaggisticaService messaggisticaService, IConfigurationMessageService configurationService, IConverter converter, IDaoFactory daoFactory)
 {
     _messaggisticaService = messaggisticaService;
     _configurationService = configurationService;
     _converter = converter;
     _daoFactory = daoFactory;
 }
开发者ID:gipasoft,项目名称:Sfera,代码行数:7,代码来源:LetteraMessageService.cs

示例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;
        }
开发者ID:Timothep,项目名称:SimpleExpressions,代码行数:29,代码来源:AsBuilder.cs

示例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;
        }
开发者ID:Timothep,项目名称:SimpleExpressions,代码行数:30,代码来源:OrBuilder.cs

示例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>());
            }
        }
开发者ID:haroldma,项目名称:Audiotica,代码行数:26,代码来源:ArtistPageViewModel.cs

示例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;
        }
开发者ID:tigerbytes,项目名称:GW2.NET,代码行数:39,代码来源:ItemConverter.cs

示例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;
        }
开发者ID:tigerbytes,项目名称:GW2.NET,代码行数:31,代码来源:WeaponConverter.cs

示例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;
 }
开发者ID:GAlexandreBastien,项目名称:Dynamite-2010,代码行数:14,代码来源:EntityBindingDetail.cs

示例13: LoadConverter

 private static void LoadConverter()
 {
     if (_converter == null)
     {
         _converter = (IConverter)Activator.CreateInstance(ConfigurationManager.Converter.Type);
     }
 }
开发者ID:footprint4me,项目名称:objectpool,代码行数:7,代码来源:TypeConverter.cs

示例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;
        }
开发者ID:Waevka,项目名称:GW2.NET,代码行数:31,代码来源:RecipeConverter.cs

示例15: ScheduleIndexJobs

 public ScheduleIndexJobs(SourceStorageFactory sourceStorageFactory, IScheduler scheduler)
 {
     _sourceStorageFactory = sourceStorageFactory;
     _scheduler = scheduler;
     Sources = new IItemSource[] { };
     Converters = new IConverter[] { };
 }
开发者ID:brunomlopes,项目名称:ILoveLucene,代码行数:7,代码来源:ScheduleIndexJobs.cs


注:本文中的IConverter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。