本文整理汇总了C#中System.Drawing.Design.ToolboxItem.Lock方法的典型用法代码示例。如果您正苦于以下问题:C# ToolboxItem.Lock方法的具体用法?C# ToolboxItem.Lock怎么用?C# ToolboxItem.Lock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Design.ToolboxItem
的用法示例。
在下文中一共展示了ToolboxItem.Lock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize_Locked_Null
public void Initialize_Locked_Null ()
{
ToolboxItem item = new ToolboxItem ();
item.Lock ();
item.Initialize (null);
}
示例2: Locked_Twice
public void Locked_Twice ()
{
ToolboxItem item = new ToolboxItem ();
item.Lock ();
item.Lock ();
}
示例3: NullValues
public void NullValues ()
{
ToolboxItem item = new ToolboxItem ();
item.AssemblyName = null;
Assert.IsNull (item.AssemblyName, "AssemblyName");
item.Bitmap = null;
Assert.IsNull (item.Bitmap, "Bitmap");
item.DisplayName = null;
Assert.AreEqual (String.Empty, item.DisplayName, "DisplayName");
item.Filter = null;
Assert.AreEqual (0, item.Filter.Count, "Filter");
item.TypeName = null;
Assert.AreEqual (String.Empty, item.TypeName, "TypeName");
item.Company = null;
Assert.AreEqual (String.Empty, item.Company, "Company");
// can't assign null without a NRE
item.DependentAssemblies = new AssemblyName [0];
Assert.AreEqual (0, item.DependentAssemblies.Length, "DependentAssemblies");
item.Description = null;
Assert.AreEqual (String.Empty, item.Description, "Description");
item.IsTransient = true;
Assert.IsTrue (item.IsTransient, "IsTransient");
Assert.AreEqual (9, item.Properties.Count, "Properties");
item.Lock ();
Assert.AreEqual (9, item.Properties.Count, "Properties/Lock");
}