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


C# TypeName类代码示例

本文整理汇总了C#中TypeName的典型用法代码示例。如果您正苦于以下问题:C# TypeName类的具体用法?C# TypeName怎么用?C# TypeName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TypeName类属于命名空间,在下文中一共展示了TypeName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TypeOf

        public NamedType TypeOf(TypeName name)
        {
            if (!types.ContainsKey(name))
            {
                if (name.Name == typeof(IEnumerable<>).QualifiedName())
                {
                    var itemType = TypeOf(name.GenericArguments.Single());
                    if (itemType == null)
                        return null;
                    types.Add(name, NamedType.Enumerable(itemType));
                }
                else if (name.Name == typeof(Vector<>).QualifiedName())
                {
                    var itemType = TypeOf(name.GenericArguments.Single());
                    if (itemType == null)
                        return null;
                    types.Add(name, NamedType.Vector(itemType));
                }
                else if (name.Name == typeof(Nullable<>).QualifiedName())
                {
                    var itemType = TypeOf(name.GenericArguments.Single());
                    if (itemType == null)
                        return null;
                    types.Add(name, NamedType.Nullable(itemType));
                }
                else
                {
                    return null;
                }
            }

            return types[name];
        }
开发者ID:plioi,项目名称:rook,代码行数:33,代码来源:TypeRegistry.cs

示例2: ProgressGatherStat

        public void ProgressGatherStat(TypeName typeName)
        {
            if(_gatherSkillCollection[typeName] > 300)
                return;

            _gatherSkillCollection[typeName]++;
        }
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:7,代码来源:PlayerCraftStats.cs

示例3: Add

        public void Add(Class @class)
        {
            var typeName = new TypeName(@class.Name.Identifier);

            types[typeName] = new NamedType(@class);
            classes[typeName] = @class;
        }
开发者ID:plioi,项目名称:rook,代码行数:7,代码来源:TypeRegistry.cs

示例4: Jewel

        /// <summary>
        /// instantiate a new Jewel
        /// </summary>
        /// <param name="contentManager">game content manager object</param>
        /// <param name="spriteName">file name of sprite</param>
        /// <param name="position">vector position of Jewel</param>
        public Jewel(
            ContentManager contentManager,
            TypeName type,
            Vector2 position
            )
        {
            _contentManager = contentManager;
            _type = type;
            _position = position;

            // load the jewel image
            if (type == TypeName.Green)
            {
                _sprite = _contentManager.Load<Texture2D>("green_jewel");
            }

            _active = true;

            _spriteWidth = _sprite.Width;
            _spriteHeight = _sprite.Height;

            // set the initial center and bounding rectangle for the player
            _center = new Vector2(position.X + (_spriteWidth / 2), position.Y + (_spriteHeight / 2));
            _boundingRectangle = new Rectangle((int)position.X, (int)position.Y, _spriteWidth, _spriteHeight);
        }
开发者ID:NMC-CIT195,项目名称:Demo_MG_MazeGame,代码行数:31,代码来源:Jewel.cs

示例5: FindByServiceTypeName

        public IList<IComponentDescriptor> FindByServiceTypeName(TypeName serviceTypeName)
        {
            if (serviceTypeName == null)
                throw new ArgumentNullException("serviceTypeName");

            return FindByServiceTypeNameImpl(serviceTypeName);
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:Components.cs

示例6: Coin

 public Coin(TypeName name, string description, int value, int countInGameInventory )
 {
     _name = name;
     _description = description;
     _valueInDollars = value;
     _countInGameInventory = countInGameInventory;
 }
开发者ID:NMC-CIT255,项目名称:Demo_Array_PlayerTreasure,代码行数:7,代码来源:Coin.cs

示例7: ResolveType

 public TypeDef ResolveType(TypeName name)
 {
     var typeDef = default(TypeDef);
     if (!nameToTypeDefCache.TryGetValue(name, out typeDef))
         return null;
     return typeDef;
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:7,代码来源:AssemblyDef.cs

示例8: GetByServiceTypeName

        public IServiceDescriptor GetByServiceTypeName(TypeName serviceTypeName)
        {
            if (serviceTypeName == null)
                throw new ArgumentNullException("serviceTypeName");

            return GetByServiceTypeNameImpl(serviceTypeName);
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:Services.cs

示例9: ComponentRegistration

 /// <summary>
 /// Creates a component registration.
 /// </summary>
 /// <param name="plugin">The plugin to which the component will belong.</param>
 /// <param name="service">The service implemented by the component.</param>
 /// <param name="componentId">The component id.</param>
 /// <param name="componentTypeName">The component type name, or null to use the default component type specified by the service.</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="plugin"/>, <paramref name="service"/>,
 /// <paramref name="componentId"/> is null.</exception>
 public ComponentRegistration(IPluginDescriptor plugin, IServiceDescriptor service, string componentId, TypeName componentTypeName)
 {
     Plugin = plugin;
     Service = service;
     ComponentId = componentId;
     ComponentTypeName = componentTypeName;
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:16,代码来源:ComponentRegistration.cs

示例10: FindComponentsByServiceTypeName

        public IList<IComponentDescriptor> FindComponentsByServiceTypeName(TypeName serviceTypeName)
        {
            ServiceDescriptor service = GetServiceByServiceTypeName(serviceTypeName);
            if (service == null)
                return EmptyArray<IComponentDescriptor>.Instance;

            return FindComponentsByServiceId(service.ServiceId);
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:RegistryData.cs

示例11: ServiceDescriptor

 public ServiceDescriptor(Registry registry, ServiceRegistration serviceRegistration)
 {
     this.registry = registry;
     pluginDescriptor = (PluginDescriptor) serviceRegistration.Plugin;
     serviceId = serviceRegistration.ServiceId;
     serviceTypeName = serviceRegistration.ServiceTypeName;
     defaultComponentTypeName = serviceRegistration.DefaultComponentTypeName;
     traitsHandlerFactory = serviceRegistration.TraitsHandlerFactory;
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:9,代码来源:ServiceDescriptor.cs

示例12: RegisterComponentForServices

        private void RegisterComponentForServices(Type type, IPluginDescriptor plugin)
        {
            var componentId = type.FullName;

            var interfaceTypes = GetDirectInterfaces(type);
            var typeName = new TypeName(type).ConvertToPartialAssemblyName();

            RegisterFirstInterface(interfaceTypes, plugin, componentId, typeName);
            RegisterEventHandlers(interfaceTypes, plugin, componentId, typeName);
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:10,代码来源:DefaultConventionScanner.cs

示例13: HasValueEqualitySemantics

        public void HasValueEqualitySemantics()
        {
            var type = new TypeName("B", new TypeName("A"));
            type.ShouldEqual(type);
            type.ShouldEqual(new TypeName("B", new TypeName("A")));
            type.ShouldNotEqual(new TypeName("B"));

            type.GetHashCode().ShouldEqual(new TypeName("B", new TypeName("A")).GetHashCode());
            type.GetHashCode().ShouldNotEqual(new TypeName("B").GetHashCode());
        }
开发者ID:plioi,项目名称:rook,代码行数:10,代码来源:TypeNameTests.cs

示例14: ComponentDescriptor

 public ComponentDescriptor(Registry registry, ComponentRegistration componentRegistration)
 {
     this.registry = registry;
     pluginDescriptor = (PluginDescriptor) componentRegistration.Plugin;
     serviceDescriptor = (ServiceDescriptor) componentRegistration.Service;
     componentId = componentRegistration.ComponentId;
     componentTypeName = componentRegistration.ComponentTypeName ?? serviceDescriptor.DefaultComponentTypeName;
     componentProperties = componentRegistration.ComponentProperties.Copy().AsReadOnly();
     traitsProperties = componentRegistration.TraitsProperties.Copy().AsReadOnly();
     componentHandlerFactory = componentRegistration.ComponentHandlerFactory;
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:11,代码来源:ComponentDescriptor.cs

示例15: MembersOf

        public Binding[] MembersOf(NamedType type)
        {
            var typeName = new TypeName(type.Name);

            if (!classes.ContainsKey(typeName))
                return new Binding[] { };

            var @class = classes[typeName];

            var result = @class.Methods.Select(m => (Binding)new MethodBinding(m.Name.Identifier, DeclaredType(m))).ToArray();
            //TODO: Cache these results instead of recalculating each time.
            return result;
        }
开发者ID:plioi,项目名称:rook,代码行数:13,代码来源:TypeRegistry.cs


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