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


C# IComponent.GetType方法代码示例

本文整理汇总了C#中IComponent.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IComponent.GetType方法的具体用法?C# IComponent.GetType怎么用?C# IComponent.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IComponent的用法示例。


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

示例1: RemoveComponent

 public void RemoveComponent(IComponent component)
 {
     if (component == null)
         return;
     if (_components.ContainsKey(component.GetType()))
         RemoveComponent(component.GetType());
 }
开发者ID:doanhtdpl,项目名称:plants-vs-zombies-gameonmobile-uit-term7,代码行数:7,代码来源:ObjectEntity.cs

示例2: AddComponent

 public bool AddComponent(IComponent component)
 {
     if (component == null)
         return false;
     if (_components.ContainsKey(component.GetType()))
         throw new Exception("SCSEngine: Duplicate component!");
     component.Owner = this;
     _components.Add(component.GetType(), component);
     return true;
 }
开发者ID:doanhtdpl,项目名称:plants-vs-zombies-gameonmobile-uit-term7,代码行数:10,代码来源:ObjectEntity.cs

示例3: CreateAccessor

 ITweenAccessor CreateAccessor(IComponent component)
 {
     switch(component.GetType().ToString()) {
     case "PositionComponent":
         return new PositionAccessor();
     case "GameObjectComponent":
         return new GameObjectAccessor();
     case "LaserSpawnerComponent":
         return new LaserSpawnerAccessor();
         default:
         throw new Exception("Component " + component.GetType().ToString() + " doesn't have accessor");
     }
 }
开发者ID:kicholen,项目名称:SpaceShooter,代码行数:13,代码来源:TweenComponent.cs

示例4: AddComponent

        public void AddComponent(IComponent toAdd)
        {
            if (toAdd == null)
            {
                throw new ArgumentNullException();
            }

            if (components.ContainsKey(toAdd.GetType()))
            {
                throw new System.ArgumentException("Duplicate Component Added of Type " + toAdd.GetType() + "!");
            }

            components.Add(toAdd.GetType(), toAdd);
        }
开发者ID:knexer,项目名称:MonoGameShooterModernUI,代码行数:14,代码来源:Entity.cs

示例5: LocalizationExtenderProvider

 public LocalizationExtenderProvider(ISite serviceProvider, IComponent baseComponent)
 {
     this.serviceProvider = serviceProvider;
     this.baseComponent = baseComponent;
     if (serviceProvider != null)
     {
         IExtenderProviderService service = (IExtenderProviderService) serviceProvider.GetService(typeof(IExtenderProviderService));
         if (service != null)
         {
             service.AddExtenderProvider(this);
         }
     }
     this.language = CultureInfo.InvariantCulture;
     ResourceManager manager = new ResourceManager(baseComponent.GetType());
     if (manager != null)
     {
         ResourceSet set = manager.GetResourceSet(this.language, true, false);
         if (set != null)
         {
             object obj2 = set.GetObject("$this.Localizable");
             if (obj2 is bool)
             {
                 this.defaultLocalizable = (bool) obj2;
                 this.localizable = this.defaultLocalizable;
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:LocalizationExtenderProvider.cs

示例6: CreateDesignerActionPanel

 internal DesignerActionPanel CreateDesignerActionPanel(IComponent relatedComponent)
 {
     DesignerActionListCollection actionLists = new DesignerActionListCollection();
     actionLists.AddRange(this.ActionLists);
     DesignerActionPanel panel = new DesignerActionPanel(this.serviceProvider);
     panel.UpdateTasks(actionLists, new DesignerActionListCollection(), System.Design.SR.GetString("DesignerActionPanel_DefaultPanelTitle", new object[] { relatedComponent.GetType().Name }), null);
     return panel;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:DesignerActionBehavior.cs

示例7: CreateComponentDesigner

 protected override IDesigner CreateComponentDesigner(IComponent component, Type designerType)
 {
     Type type = _designerTable[component.GetType()] as Type;
     if (type != null)
     {
         return (IDesigner) Activator.CreateInstance(type);
     }
     return base.CreateComponentDesigner(component, designerType);
 }
开发者ID:ikvm,项目名称:webmatrix,代码行数:9,代码来源:MobileDesignerHost.cs

示例8: RemoveComponent

        public void RemoveComponent(IComponent toRemove)
        {
            if (toRemove == null)
            {
                throw new ArgumentNullException();
            }

            RemoveComponent(toRemove.GetType());
        }
开发者ID:knexer,项目名称:MonoGameShooterModernUI,代码行数:9,代码来源:Entity.cs

示例9: FindBinder

        /// <summary>
        /// Finds the binder for specified component.
        /// </summary>
        /// <param name="component">The component.</param>
        /// <returns></returns>
        protected IDelegateCommandBinder FindBinder(IComponent component)
        {
            var binder = GetBinderFor(component);

            if (binder == null)
                throw new Exception(string.Format("No binding found for component of type {0}", component.GetType().Name));

            return binder;
        }
开发者ID:Barbados87,项目名称:MvvmSample,代码行数:14,代码来源:CommandManager.cs

示例10: ComponentModel

        public ComponentModel( IComponent frontend )
        {
            _component = frontend;
             _connectableCommunicationIntefaces = frontend.GetType()
                                                       .GetInterfaces()
                                                       .Where( type => type.Name == "IConnectingComponent`1" )
                                                       .Select( x => x.GetGenericArguments().First() )
                                                       .ToList();

             _connectedComponents = new List<ComponentModel>();
        }
开发者ID:FINESCE,项目名称:ComponentCompositionFramework,代码行数:11,代码来源:ComponentModel.cs

示例11: AddComponent

		public void AddComponent(IComponent component)
		{
			if (this.EditorEnabled || component.Entity == null || component.Entity.CannotSuspend)
				component.Suspended.Value = false;

			component.SetMain(this);
			if (typeof(IGraphicsComponent).IsAssignableFrom(component.GetType()))
				((IGraphicsComponent)component).LoadContent(false);
			component.Awake();
			this.componentsToAdd.Add(component);
		}
开发者ID:dsmo7206,项目名称:Lemma,代码行数:11,代码来源:BaseMain.cs

示例12: Initialize

		public override void Initialize(IComponent component)
		{
			base.Initialize(component);
		    if (!(component is DockContainer))
		        SandDockLanguage.ShowCachedAssemblyError(component.GetType().Assembly, GetType().Assembly);

		    //ISelectionService arg_3F_0 = (ISelectionService)GetService(typeof(ISelectionService));
			_component = (IComponentChangeService)GetService(typeof(IComponentChangeService));
			_idesignerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
			_component.ComponentRemoving += OnComponentRemoving;
			_component.ComponentRemoved += OnComponentRemoved;
			_dockContainer = (DockContainer)component;
		}
开发者ID:javagg,项目名称:DemoDock,代码行数:13,代码来源:DockContainerDesigner.cs

示例13: AddComponent

        public IEntity AddComponent(IComponent c, bool overwriteIfExists = false)
        {
            var componentType = c.GetType();

            if (HasComponent(componentType) && !overwriteIfExists)
            {
                throw new InvalidOperationException("Component already exists on this entity");
            }

            Components[componentType] = c;
            OnComponentAdded(c);
            return this;
        }
开发者ID:PhoenixSystem,项目名称:PhoenixSystem,代码行数:13,代码来源:DefaultEntity.cs

示例14: GetComponentDetail

 public static string GetComponentDetail(IComponent cp)
 {
     object[] atts = cp.GetType().GetCustomAttributes(typeof(DocumentAttribute), false);
     if (atts.Length == 0)
     {
         return string.Empty;
     }
     DocumentAttribute attr = atts[0] as DocumentAttribute;
     if (attr == null)
     {
         return string.Empty;
     }
     return attr.Detail;
 }
开发者ID:felix-tien,项目名称:TechLab,代码行数:14,代码来源:AttributeHelper.cs

示例15: ComponentBlueprint

        public ComponentBlueprint(int index, IComponent component)
        {
            _type = component.GetType();
            _componentMembers = null;

            this.index = index;
            this.fullTypeName = _type.FullName;

            var memberInfos = _type.GetPublicMemberInfos();
            members = new SerializableMember[memberInfos.Count];
            for (int i = 0, memberInfosLength = memberInfos.Count; i < memberInfosLength; i++) {
                var info = memberInfos[i];
                members[i] = new SerializableMember(info.name, info.GetValue(component));
            }
        }
开发者ID:Cotoff,项目名称:Entitas-CSharp,代码行数:15,代码来源:ComponentBlueprint.cs


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