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