本文整理汇总了C#中ShellObject.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ShellObject.GetType方法的具体用法?C# ShellObject.GetType怎么用?C# ShellObject.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShellObject
的用法示例。
在下文中一共展示了ShellObject.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayProperties
private void DisplayProperties(ShellObject selectedSO)
{
// Display some basic properties
if (selectedSO != null)
{
// display properties for this folder, as well as a thumbnail image.
selectedSO.Thumbnail.CurrentSize = new System.Windows.Size(128, 128);
pictureBox1.Image = selectedSO.Thumbnail.Bitmap;
// show the properties
AddProperty("Name", selectedSO.Name);
AddProperty("Path", selectedSO.ParsingName);
AddProperty("Type of ShellObject", selectedSO.GetType().Name);
foreach (IShellProperty prop in selectedSO.Properties.DefaultPropertyCollection)
{
if (prop.ValueAsObject != null)
{
try
{
if (prop.ValueType == typeof(string[]))
{
string[] arr = (string[])prop.ValueAsObject;
string value = "";
if (arr != null && arr.Length > 0)
{
foreach (string s in arr)
value = value + s + "; ";
if (value.EndsWith("; "))
value = value.Remove(value.Length - 2);
}
AddProperty(prop.CanonicalName, value);
}
else
AddProperty(prop.CanonicalName, prop.ValueAsObject.ToString());
}
catch
{
// Ignore
// Accessing some properties might throw exception.
}
}
}
}
}