当前位置: 首页>>代码示例>>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;未经允许,请勿转载。