當前位置: 首頁>>代碼示例>>C#>>正文


C# Bar.Dispose方法代碼示例

本文整理匯總了C#中Bar.Dispose方法的典型用法代碼示例。如果您正苦於以下問題:C# Bar.Dispose方法的具體用法?C# Bar.Dispose怎麽用?C# Bar.Dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Bar的用法示例。


在下文中一共展示了Bar.Dispose方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TestNativeToManagedMapWithOwnObjects

 public void TestNativeToManagedMapWithOwnObjects()
 {
     using (var testNativeToManagedMap = new TestNativeToManagedMap())
     {
         var bar = new Bar();
         testNativeToManagedMap.PropertyWithNoVirtualDtor = bar;
         Assert.AreSame(bar, testNativeToManagedMap.PropertyWithNoVirtualDtor);
         Assert.IsTrue(Qux.NativeToManagedMap.ContainsKey(bar.__Instance));
         bar.Dispose();
         Assert.IsFalse(Qux.NativeToManagedMap.ContainsKey(bar.__Instance));
     }
 }
開發者ID:daxiazh,項目名稱:CppSharp,代碼行數:12,代碼來源:CSharp.Tests.cs

示例2: DeleteBar

 public void DeleteBar()
 {
     var bar = new Bar(Context);
     bar.Dispose();
     Assert.AreEqual(1, Context.Count());
 }
開發者ID:TomCrypto,項目名稱:AntTweakBar.NET,代碼行數:6,代碼來源:Tests.cs

示例3: dotNetBarManager1_ItemClick


//.........這裏部分代碼省略.........
					m_SaveFileDialog.DefaultExt = "xml";
					m_SaveFileDialog.FileName = (bar.Name!=""?bar.Name:"MyBar");
					m_SaveFileDialog.Filter = "DotNetBar Bar Files (*.xml)|*.xml|All Files (*.*)|*.*";
				
					if(m_SaveFileDialog.ShowDialog()==DialogResult.OK)
					{
						bar.SaveDefinition(m_SaveFileDialog.FileName);
					}

					m_SaveFileDialog.Title=stitle;
					m_SaveFileDialog.DefaultExt=defaultExt;
					m_SaveFileDialog.FileName=fileName;
					m_SaveFileDialog.Filter=filter;
					break;
				}
				case LOAD_BAR:
				{
					string defaultExt=m_OpenFileDialog.DefaultExt;
					string filter=m_OpenFileDialog.Filter;
					m_OpenFileDialog.DefaultExt="xml";
					m_OpenFileDialog.Filter = "DotNetBar Bar Files (*.xml)|*.xml|All Files (*.*)|*.*";
					if(m_OpenFileDialog.ShowDialog()==DialogResult.OK && System.IO.File.Exists(m_OpenFileDialog.FileName))
					{
						Bar bar=new Bar();
						try
						{
							bar.LoadDefinition(m_OpenFileDialog.FileName);
						}
						catch(Exception ex)
						{
							MessageBox.Show("File '"+m_OpenFileDialog.FileName+"' does not appear to be valid Bar file.\n\rException has been generated while loading: "+ex.Source+": "+ex.Message+"\n\r"+ex.StackTrace);
							return;
						}
						bar.Dispose();
						bar=new Bar();
						this.GetDesignManager().SuspendLayout=true;
						this.GetDesignManager().Bars.Add(bar);
						bar.LoadDefinition(m_OpenFileDialog.FileName);
						this.GetDesignManager().SuspendLayout=false;
						this.DisplayTreeBar(bar);
					}
					m_OpenFileDialog.DefaultExt=defaultExt;
					m_OpenFileDialog.Filter=filter;
					break;
				}
				case MOVE_LEFT:
				case MOVE_RIGHT:
				case MOVE_UP:
				case MOVE_DOWN:
				{
					MoveSelectedItem(item.Name);
					RefreshDesignBar();
					break;
				}
				case SYNC_CATEGORIES:
				{
					RescanCategories();
					break;
				}
				case NEW_BUTTON:
				{
					ButtonItem btn=CreateObject(typeof(ButtonItem)) as ButtonItem;
					AssignItemName(btn);
					btn.Text=btn.Name;
					AddNewItem(btn);
					RefreshDesignBar();
開發者ID:,項目名稱:,代碼行數:67,代碼來源:

示例4: AddBar

 public void AddBar()
 {
     var bar = new Bar(Context);
     Assert.AreEqual(2, Context.Count()); // new bar + default one
     bar.Dispose();
 }
開發者ID:TomCrypto,項目名稱:AntTweakBar.NET,代碼行數:6,代碼來源:Tests.cs


注:本文中的Bar.Dispose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。