本文整理匯總了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;
}