本文整理汇总了C#中IComponent.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IComponent.ToString方法的具体用法?C# IComponent.ToString怎么用?C# IComponent.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IComponent
的用法示例。
在下文中一共展示了IComponent.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StoreResourceInfo
static void StoreResourceInfo(IComponent component, string propertyName, ProjectResourceInfo resourceInfo)
{
var dictService = component.Site.GetService(typeof(IDictionaryService)) as IDictionaryService;
if (dictService == null) {
throw new InvalidOperationException("The required IDictionaryService is not available on component '" + component.ToString() + "'.");
}
dictService.SetValue(ProjectResourceService.ProjectResourceKey + propertyName, resourceInfo);
}
示例2: unregister
/// <summary>
/// Unregister specific component.
/// </summary>
/// <param name="c">component</param>
public void unregister(IComponent c)
{
IComponent v;
if(!components.TryRemove(c.GetType(), out v)) {
throw new SBEException("Cannot remove component '{0}'", c.ToString());
}
}
示例3: CreateUniqueMethodName
/// Creates a unique method name. The name must be
/// compatible with the script language being used and
/// it must not conflict with any other name in the user's
/// code. Since we have no code editor, we can guarantee this
/// method name will be unique. However, if code were editable,
/// we would have to check our codeCompileUnit's methods.
protected string CreateUniqueMethodName(IComponent component, EventDescriptor e)
{
string name = component.ToString().Split(new char[] { ' ' })[0];
//return "handler_" + name + "_" + e.Name;
return name + "_" + e.Name;
}
示例4: register
/// <summary>
/// Register new component.
/// </summary>
/// <param name="c">component</param>
public void register(IComponent c)
{
if(String.IsNullOrEmpty(c.Condition)) {
throw new ComponentException("Condition for '{0}' is null or empty.", c.ToString());
}
Type ident = c.GetType();
if(components.ContainsKey(ident)) {
throw new ComponentException("IComponent '{0}:{1}' is already registered.", ident, c.ToString());
}
components[ident] = c;
}
示例5: ReferenceHolder
internal ReferenceHolder(string trailingName, object reference, IComponent sitedComponent)
{
this.trailingName = trailingName;
this.reference = reference;
this.sitedComponent = sitedComponent;
Debug.Assert(trailingName != null, "Expected a trailing name");
Debug.Assert(reference != null, "Expected a reference");
#if DEBUG
Debug.Assert(sitedComponent != null, "Expected a sited component");
if (sitedComponent != null)
Debug.Assert(sitedComponent.Site != null, "Sited component is not really sited: " + sitedComponent.ToString());
if (sitedComponent != null && sitedComponent.Site != null)
Debug.Assert(sitedComponent.Site.Name != null, "Sited component has no name: " + sitedComponent.ToString());
#endif // DEBUG
}