本文整理匯總了C#中Bar.LoadDefinition方法的典型用法代碼示例。如果您正苦於以下問題:C# Bar.LoadDefinition方法的具體用法?C# Bar.LoadDefinition怎麽用?C# Bar.LoadDefinition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Bar
的用法示例。
在下文中一共展示了Bar.LoadDefinition方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: dotNetBarManager1_ItemClick
private void dotNetBarManager1_ItemClick(object sender, System.EventArgs e)
{
BaseItem item=sender as BaseItem;
if(item==null)
return;
PropertyGrid grid=propertyBars;
if(navigationPane1.SelectedPanel==navigationPanePanel2)
grid=propertyMenus;
if(navigationPane1.SelectedPanel==navigationPanePanel3)
grid=propertyCategories;
switch(item.Name)
{
case CREATE_BARS_PARENT:
{
if (!item.Expanded)
item.Expanded = true;
break;
}
case OPEN_DEFINITION:
{
if(m_OpenFileDialog.ShowDialog()==DialogResult.OK && System.IO.File.Exists(m_OpenFileDialog.FileName))
{
DotNetBarManager manager=this.GetDesignManager();
manager.LoadDefinition(m_OpenFileDialog.FileName);
m_DefinitionFileName=m_OpenFileDialog.FileName;
SetupProperties();
RefreshView();
m_DataChanged=true;
}
break;
}
case RESET_IMAGE:
{
m_DataChanged=true;
if(grid.SelectedGridItem!=null && (grid.SelectedGridItem.PropertyDescriptor.PropertyType==typeof(System.Drawing.Image) || grid.SelectedGridItem.PropertyDescriptor.PropertyType==typeof(System.Drawing.Icon)))
{
grid.SelectedGridItem.PropertyDescriptor.SetValue(grid.SelectedObject,null);
}
grid.Refresh();
break;
}
case CLOSE_DESIGNER:
{
this.DialogResult=DialogResult.OK;
this.Close();
break;
}
case SHOW_HELP:
{
if(m_HtmlHelp!=null)
m_HtmlHelp.ShowContents();
break;
}
case SHOW_HELP_SEARCH:
{
if(m_HtmlHelp!=null)
m_HtmlHelp.ShowSearch();
break;
}
case NEW_TOOLBAR:
case NEW_MENUBAR:
case NEW_STATUSBAR:
case NEW_TASKBAR:
{
m_DataChanged=true;
Bar bar;
if(item.Name==NEW_MENUBAR)
{
bar=CreateObject(typeof(Bar)) as Bar;
bar.Text="Main Menu";
bar.MenuBar=true;
bar.Stretch=true;
bar.Name="mainmenu";
}
else if(item.Name==NEW_STATUSBAR)
{
bar=CreateObject(typeof(Bar)) as Bar;
bar.Text="Status";
bar.Stretch=true;
bar.Name="statusBar"+((int)this.GetDesignManager().Bars.Count+1).ToString();
bar.LayoutType=eLayoutType.Toolbar;
bar.GrabHandleStyle=eGrabHandleStyle.ResizeHandle;
bar.ItemSpacing=2;
}
else if(item.Name==NEW_TASKBAR)
{
bar=CreateObject(typeof(Bar)) as Bar;
bar.Text="Task Pane";
bar.Stretch=true;
bar.Name="taskbar"+((int)this.GetDesignManager().Bars.Count+1).ToString();
bar.LayoutType=eLayoutType.TaskList;
bar.GrabHandleStyle=eGrabHandleStyle.Caption;
}
else
{
bar=CreateObject(typeof(Bar)) as Bar;
//.........這裏部分代碼省略.........