📄 designutil.cs
字号:
//------------------------------------------------------------------------------
// Copyright (c) 2000-2003 Microsoft Corporation. All Rights Reserved.
//------------------------------------------------------------------------------
namespace Microsoft.Web.UI.WebControls.Design
{
using System;
using System.ComponentModel;
/// <summary>
/// Utility class with various useful static functions.
/// </summary>
internal class DesignUtil
{
private static System.Resources.ResourceManager _ResourceManager = null;
internal static System.Resources.ResourceManager GetResourceManager()
{
if (_ResourceManager == null)
{
Type ourType = typeof(DesignUtil);
_ResourceManager = new System.Resources.ResourceManager(ourType.Namespace, ourType.Module.Assembly);
}
return _ResourceManager;
}
internal static string GetStringResource(string name)
{
return (string)GetResourceManager().GetObject(name);
}
/// <summary>
/// Given an object and a property name, retrieves the property descriptor.
/// </summary>
/// <param name="obj">The source object</param>
/// <param name="propName">The property name</param>
/// <returns>The PropertyDescriptor of the property on the object, or null if not found.</returns>
internal static PropertyDescriptor GetPropertyDescriptor(object obj, string propName)
{
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(obj);
if (props != null)
{
foreach (PropertyDescriptor propDesc in props)
{
if (propDesc.Name == propName)
{
return propDesc;
}
}
}
return null;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -