本文整理汇总了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());
}
示例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;
}
示例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");
}
}
示例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);
}
示例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;
}
示例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);
}
示例8: RemoveComponent
public void RemoveComponent(IComponent toRemove)
{
if (toRemove == null)
{
throw new ArgumentNullException();
}
RemoveComponent(toRemove.GetType());
}
示例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;
}
示例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>();
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
}