本文整理汇总了C#中System.Drawing.Design.ToolboxItem.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# ToolboxItem.Equals方法的具体用法?C# ToolboxItem.Equals怎么用?C# ToolboxItem.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Design.ToolboxItem
的用法示例。
在下文中一共展示了ToolboxItem.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTool
//.........这里部分代码省略.........
if (parent != null)
{
defaultValues["Parent"] = parent;
}
if ((parent != null) && parent.IsMirrored)
{
x += width;
}
if (hasLocation)
{
defaultValues["Location"] = new Point(x, y);
}
if (hasSize)
{
defaultValues["Size"] = new Size(width, height);
}
if (e != null)
{
defaultValues["ToolboxSnapDragDropEventArgs"] = e;
}
c = tool.CreateComponents(host, defaultValues);
}
catch (CheckoutException exception2)
{
if (exception2 != CheckoutException.Canceled)
{
throw;
}
c = new IComponent[0];
}
catch (ArgumentException exception3)
{
IUIService service4 = (IUIService) this.GetService(typeof(IUIService));
if (service4 != null)
{
service4.ShowError(exception3);
}
}
catch (Exception exception4)
{
IUIService service5 = (IUIService) this.GetService(typeof(IUIService));
string message = string.Empty;
if (exception4.InnerException != null)
{
message = exception4.InnerException.ToString();
}
if (string.IsNullOrEmpty(message))
{
message = exception4.ToString();
}
if (exception4 is InvalidOperationException)
{
message = exception4.Message;
}
if (service5 == null)
{
throw;
}
service5.ShowError(exception4, System.Design.SR.GetString("FailedToCreateComponent", new object[] { tool.DisplayName, message }));
}
if (c == null)
{
c = new IComponent[0];
}
}
finally
{
if ((service != null) && tool.Equals(service.GetSelectedToolboxItem(host)))
{
service.SelectedToolboxItemUsed();
}
}
}
finally
{
if (transaction != null)
{
transaction.Commit();
}
Cursor.Current = current;
}
if ((service2 != null) && (c.Length > 0))
{
if (host != null)
{
host.Activate();
}
ArrayList list = new ArrayList(c);
for (int i = 0; i < c.Length; i++)
{
if (!TypeDescriptor.GetAttributes(c[i]).Contains(DesignTimeVisibleAttribute.Yes))
{
list.Remove(c[i]);
}
}
service2.SetSelectedComponents(list.ToArray(), SelectionTypes.Replace);
}
codemarkers.CodeMarker(0x1d4d);
return c;
}