本文整理汇总了C#中IExtension.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IExtension.GetType方法的具体用法?C# IExtension.GetType怎么用?C# IExtension.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IExtension
的用法示例。
在下文中一共展示了IExtension.GetType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HaveConfigurationSectionName
/// <summary>
/// Initializes a new instance of the <see cref="HaveConfigurationSectionName"/> class.
/// </summary>
/// <param name="extension">The extension.</param>
public HaveConfigurationSectionName(IExtension extension)
{
Ensure.ArgumentNotNull(extension, "extension");
var namer = extension as IHaveConfigurationSectionName;
this.SectionName = namer != null
? namer.SectionName
: extension.GetType().Name;
}
示例2: ExtensionInfo
public ExtensionInfo(IExtension extension)
{
_extensionName = extension.GetMeta("Name");
Type extensionType = extension.GetType();
_guid = extension.Guid;
Assembly extensionAssembly = extensionType.Assembly;
_version = extensionAssembly.GetName().Version.ToString(3);
_filePath = extensionAssembly.Location;
FileInfo fileInfo = new FileInfo(_filePath);
_fileSize = fileInfo.Length;
_vendor = extension.GetMeta("Vendor");
}
示例3: GetExtensionDetails
void GPSProxy.Extension.IApplication.LogMessage(IExtension sender, string message)
{
ExtensionDetails details = GetExtensionDetails(sender.GetType());
LogMessage(details.ExtensionAttribute.ExtensionName + ": " + message);
}
示例4: GetExtensionPath
internal static string GetExtensionPath(IExtension ext)
{
var assembly = Assembly.GetAssembly(ext.GetType());
return assembly.Location;
}
示例5: Reflect
/// <inheritdoc />
public IEnumerable<PropertyInfo> Reflect(IExtension extension)
{
Ensure.ArgumentNotNull(extension, "extension");
return extension.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public).Where(x => x.CanWrite);
}
示例6: RegisterPlugIn
/// <summary>
/// Registers an extension plugin.
/// </summary>
/// <param name="plugIn">IExtension object to register.</param>
public void RegisterPlugIn(IExtension plugIn)
{
for (int i = 0; i < _ExtensionPlugIns.Count; i++)
{
if (_ExtensionPlugIns[i].GetType() == plugIn.GetType())
{
_ExtensionPlugIns[i] = plugIn;
return;
}
}
_ExtensionPlugIns.Add(plugIn);
}