本文整理汇总了C#中System.Windows.Forms.ToolStripContainer类的典型用法代码示例。如果您正苦于以下问题:C# ToolStripContainer类的具体用法?C# ToolStripContainer怎么用?C# ToolStripContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolStripContainer类属于System.Windows.Forms命名空间,在下文中一共展示了ToolStripContainer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddExitButton
public ToolStripContainer AddExitButton(ToolStripContainer toolbarContainer,ExitButtonDelegate myDelegate)
{
if (myDelegate != null) {
imgExitToolStrip = new ToolStrip();
// imgExitToolStrip.ImageScalingSize = new Size(18, 18);
imgExitToolStrip.ImageList = new ImageList();
imgExitToolStrip.ItemClicked += new ToolStripItemClickedEventHandler(this.toolBar_Click);
imgExitToolStrip.ImageList.Images.Add("Exit", Image.FromHbitmap(ImageEdit.EXIT.GetHbitmap()));
ToolStripItem button;
button = new ToolStripButton();
button.Text = "";
button.ImageKey = "Exit";
button.Name = "Exit";
button.ToolTipText = "Exit";
imgExitToolStrip.Items.Add(button);
toolbarContainer.TopToolStripPanel.Controls.Add(imgExitToolStrip);
this.exitDelegate = myDelegate;
}
else {
if (imgExitToolStrip != null) {
toolbarContainer.TopToolStripPanel.Controls.Remove(imgExitToolStrip);
}
imgExitToolStrip = null;
}
return toolbarContainer;
}
开发者ID:Amphora2015,项目名称:DemoTest,代码行数:31,代码来源:ImageToolBar.cs
示例2: PropertyRightToolStripPanelVisible
public void PropertyRightToolStripPanelVisible ()
{
ToolStripContainer tsc = new ToolStripContainer ();
tsc.RightToolStripPanelVisible = false; ;
Assert.AreEqual (false, tsc.RightToolStripPanelVisible, "B1");
}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:7,代码来源:ToolStripContainerTest.cs
示例3: OnImportsSatisfied
/// <summary>
/// Called when a part's imports have been satisfied and it is safe to use. (Shell will have a value)
/// </summary>
public void OnImportsSatisfied()
{
this.toolStripContainer1 = new ToolStripContainer();
this.toolStripContainer1.ContentPanel.SuspendLayout();
this.toolStripContainer1.SuspendLayout();
this.toolStripContainer1.Dock = DockStyle.Fill;
this.toolStripContainer1.Name = "toolStripContainer1";
// place all of the controls that were on the form originally inside of our content panel.
while (Shell.Controls.Count > 0)
{
foreach (Control control in Shell.Controls)
{
this.toolStripContainer1.ContentPanel.Controls.Add(control);
}
}
Shell.Controls.Add(this.toolStripContainer1);
this.toolStripContainer1.ContentPanel.ResumeLayout(false);
this.toolStripContainer1.ResumeLayout(false);
this.toolStripContainer1.PerformLayout();
Initialize(toolStripContainer1);
}
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:29,代码来源:SimpleHeaderControl.cs
示例4: InitializeContent
/// <summary>
/// Imports the toolStripContainer with all his nice controls into the given form
/// also adds the controls from this.pnlContentHolder to masterFormContents.pnlContentHolder
/// </summary>
public static void InitializeContent(Form newForm,
Label lblTooltip,
ToolStripContainer toolStripContainer,
Panel pnlContentHolder,
CNNProjectHolder cnnProjectHolder)
{
MasterForm masterFormContents = new MasterForm(newForm, cnnProjectHolder);
// import
toolStripContainer = masterFormContents.toolStripContainer1;
newForm.Controls.Add(toolStripContainer);
// control replacement
newForm.Controls.Remove(pnlContentHolder);
newForm.Controls.Remove(lblTooltip);
masterFormContents.pnlContentHolder.Controls.Clear();
foreach (Control control in pnlContentHolder.Controls)
{
masterFormContents.pnlContentHolder.Controls.Add(control);
}
int time = (cnnProjectHolder.CNNProject.ExpertMode) ? 1 : 5000;
masterFormContents.ShowPictureBoxBalloon(lblTooltip.Text, time, newForm, true);
masterFormContents.lblHeading.Text = newForm.Text;
}
开发者ID:JohannesHoppe,项目名称:clustered-neuronal-network,代码行数:31,代码来源:MasterForm.cs
示例5: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this._coreToolStripContainer = new System.Windows.Forms.ToolStripContainer();
this._coreToolStripContainer.SuspendLayout();
this.SuspendLayout();
//
// _coreToolStripContainer
//
//
// _coreToolStripContainer.ContentPanel
//
this._coreToolStripContainer.ContentPanel.Size = new System.Drawing.Size(632, 445);
this._coreToolStripContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this._coreToolStripContainer.Location = new System.Drawing.Point(0, 0);
this._coreToolStripContainer.Name = "_coreToolStripContainer";
this._coreToolStripContainer.Size = new System.Drawing.Size(632, 445);
this._coreToolStripContainer.TabIndex = 0;
//
// CoreWorkbench
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(632, 445);
this.Controls.Add(this._coreToolStripContainer);
this.Font = new System.Drawing.Font("Tahoma", 8.25F);
this.IsMdiContainer = true;
this.MinimumSize = new System.Drawing.Size(640, 480);
this.Name = "CoreWorkbench";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this._coreToolStripContainer.ResumeLayout(false);
this._coreToolStripContainer.PerformLayout();
this.ResumeLayout(false);
}
开发者ID:ViniciusConsultor,项目名称:geansoft,代码行数:37,代码来源:CoreWorkbench.cs
示例6: GeoPluginArgs
/// <summary>
/// Creates a new instance of the GeoPluginArgs
/// </summary>
/// <param name="map">Each Manager is associated with a single map</param>
/// <param name="legend">The legend</param>
/// <param name="mainMenu">The main menu</param>
/// <param name="mainToolStrip">The main toolstrip</param>
/// <param name="progressHandler">The progress handler</param>
/// <param name="plugins">The list of plugins controlled by the manager</param>
/// <param name="toolStripContainer">The container where any toolstrips should be added</param>
public GeoPluginArgs(IMap map, ILegend legend, MenuStrip mainMenu, ToolStrip mainToolStrip, IProgressHandler progressHandler, List<IMapPlugin> plugins, ToolStripContainer toolStripContainer)
{
_toolStripContainer = toolStripContainer;
_map = map;
_legend = legend;
_mainMenu = mainMenu;
_mainToolStrip = mainToolStrip;
_plugins = plugins;
_progressHandler = progressHandler;
}
开发者ID:zhongshuiyuan,项目名称:mapwindowsix,代码行数:20,代码来源:MapPluginArgs.cs
示例7: FindBar
public FindBar(ToolStripContainer workspace, EditorControl editor)
{
this.editor = editor;
var cancelImage = Image.FromFile("/res/critical.png".AsAbsolute());
var goImage = Image.FromFile("/res/findnexths.png".AsAbsolute());
workspace.BottomToolStripPanel.Controls.Add(this);
Visible = false;
Left = workspace.LeftToolStripPanel.Width;
Items.Add("", cancelImage, (_, e) => Visible = false);
Items.Add(new ToolStripLabel("Find What:"));
ec = new FindBarTextBox() { Width = 300 };
ec.Dismissed += () => { Hide(); editor.Focus(); };
ec.Accepted += () => { DoFind(); };
var i = new ToolStripControlHost(ec) { AutoSize = false, Width = ec.Width };
Items.Add(i);
Items.Add(new ToolStripButton("", goImage, (_, e) => DoFind()));
RegExCheckBox = new CheckBox()
{
Text = "Regular Expression",
AutoSize = false,
Width = 130,
Checked = false,
BackColor = Color.Transparent,
};
CaseSensitivityCheckBox = new CheckBox()
{
Text = "Case Sensitive",
Checked = false,
BackColor = Color.Transparent,
};
var RegExHost = new ToolStripControlHost(RegExCheckBox)
{
AutoSize = false,
Width = RegExCheckBox.Width
};
var CaseHost = new ToolStripControlHost(CaseSensitivityCheckBox)
{
AutoSize = false,
Width = CaseSensitivityCheckBox.Width
};
Items.Add(RegExHost);
Items.Add(CaseHost);
}
开发者ID:chrisforbes,项目名称:corfu,代码行数:55,代码来源:FindBar.cs
示例8: ToolbarBuilder
public ToolbarBuilder(ToolStripContainer container, Dictionary<string, Image> images)
{
toolstrip = Lazy.New(() =>
{
var ts = new ToolStrip();
container.LeftToolStripPanel.Controls.Add(ts);
return ts;
});
this.images = images;
}
开发者ID:chrisforbes,项目名称:Ijw.Framework,代码行数:11,代码来源:ToolbarBuilder.cs
示例9: MainForm
public MainForm() {
this.Text = Catalog.GetString("Xenon File Manager");
this.Size = new Size(600, 450);
this.Icon = new Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("XenonFileManagerWinForms.xenon.ico"));
MenuStrip menuStrip = new MenuStrip();
menuStrip.Parent = this;
ToolStripMenuItem file = new ToolStripMenuItem("&File");
menuStrip.Items.Add(file);
ToolStripMenuItem newTab = new ToolStripMenuItem("New &Tab");
newTab.ShortcutKeys = Keys.Control | Keys.T;
file.DropDownItems.Add(newTab);
MainMenuStrip = menuStrip;
//menuStrip.RenderMode = ToolStripRenderMode.Custom;
//Szotar.WindowsForms.ToolStripAeroRenderer rende = ;
//menuStrip.Renderer = new Szotar.WindowsForms.ToolStripAeroRenderer(Szotar.WindowsForms.ToolbarTheme.Toolbar);
//menuStrip.Renderer.
ToolStripContainer toolStripContainer = new ToolStripContainer();
toolStripContainer.Dock = DockStyle.Fill;
//toolStripContainer.
ToolStrip toolStrip = new ToolStrip();
toolStrip.Items.Add("Back");
toolStripContainer.TopToolStripPanel.Controls.Add(toolStrip);
toolStripContainer.TopToolStripPanel.Controls.Add(menuStrip);
locationBar = new TextBox();
locationBar.Dock = DockStyle.Top;
toolStripContainer.ContentPanel.Controls.Add(locationBar);
tabs = new XeTabControl();
tabs.DrawTabButtonBox = false;
tabs.HighlightTextInSelectedTab = true;
tabs.ShowButtons = LazzyTab.ShowButtonEnum.Quit;
tabs.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Top;
tabs.Top = locationBar.Height;
tabs.Height = toolStripContainer.ContentPanel.Height - toolStripContainer.ContentPanel.Padding.Top
- toolStripContainer.ContentPanel.Padding.Bottom - locationBar.Height;
tabs.Width = toolStripContainer.ContentPanel.Width - toolStripContainer.ContentPanel.Padding.Right
- toolStripContainer.ContentPanel.Padding.Left + 2;
toolStripContainer.ContentPanel.Controls.Add(tabs);
this.Controls.Add(toolStripContainer);
//Controls.Add(toolContainer);
CommonUtil.DirectoryChanged += new DirectoryChangedEventHandler(this.OnDirectoryChanged);
TabPage page = (TabPage)CommonUtil.LoadControlInstance();
tabs.TabPages.Add(page);
}
开发者ID:MI3Guy,项目名称:Xenon-File-Manager--.NET-Mono-,代码行数:53,代码来源:MainForm.cs
示例10: WebBrowserTabPage
public WebBrowserTabPage(WebKitBrowser browserControl, bool goHome)
{
InitializeComponent();
statusStrip = new StatusStrip();
statusStrip.Name = "statusStrip";
statusStrip.Visible = true;
statusStrip.SizingGrip = false;
container = new ToolStripContainer();
container.Name = "container";
container.Visible = true;
container.Dock = DockStyle.Fill;
statusLabel = new ToolStripLabel();
statusLabel.Name = "statusLabel";
statusLabel.Text = "Done";
statusLabel.Visible = true;
iconLabel = new ToolStripLabel();
iconLabel.Name = "iconLabel";
iconLabel.Text = "No Icon";
iconLabel.Visible = true;
statusStrip.Items.Add(statusLabel);
statusStrip.Items.Add(iconLabel);
container.BottomToolStripPanel.Controls.Add(statusStrip);
// create webbrowser control
browser = browserControl;
browser.Visible = true;
browser.Dock = DockStyle.Fill;
browser.Name = "browser";
container.ContentPanel.Controls.Add(browser);
// context menu
this.Controls.Add(container);
this.Text = "<New Tab>";
// events
browser.DocumentTitleChanged += (s, e) => this.Text = browser.DocumentTitle;
browser.Navigating += (s, e) => statusLabel.Text = "Loading...";
browser.Navigated += (s, e) => { statusLabel.Text = "Downloading..."; };
browser.DocumentCompleted += (s, e) => { statusLabel.Text = "Done"; };
if (goHome)
browser.Navigate("http://www.google.com");
browser.ApplicationName = "WebKit.NET-test";
}
开发者ID:davejohnson,项目名称:webkit-dot-net,代码行数:50,代码来源:WebBrowserTabPage.cs
示例11: Constructor
public void Constructor ()
{
ToolStripContainer tsc = new ToolStripContainer ();
Assert.AreEqual ("System.Windows.Forms.ToolStripPanel", tsc.BottomToolStripPanel.ToString (), "A1");
Assert.AreEqual (true, tsc.BottomToolStripPanelVisible, "A2");
Assert.AreEqual ("System.Windows.Forms.ToolStripContentPanel", tsc.ContentPanel.GetType ().ToString (), "A3");
Assert.AreEqual ("System.Windows.Forms.ToolStripPanel", tsc.LeftToolStripPanel.ToString (), "A4");
Assert.AreEqual (true, tsc.LeftToolStripPanelVisible, "A5");
Assert.AreEqual ("System.Windows.Forms.ToolStripPanel", tsc.RightToolStripPanel.ToString (), "A6");
Assert.AreEqual (true, tsc.RightToolStripPanelVisible, "A7");
Assert.AreEqual ("System.Windows.Forms.ToolStripPanel", tsc.TopToolStripPanel.ToString (), "A8");
Assert.AreEqual (true, tsc.TopToolStripPanelVisible, "A9");
}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:14,代码来源:ToolStripContainerTest.cs
示例12: ApplicationBridge
public ApplicationBridge(MenuStrip menuStrip,
ToolStripContainer toolStripContainer, MapPanel mapPanel)
: base(false)
{
m_commandHistory = CommandHistory.Instance;
m_menuStripBridge = new MenuStripBridge(menuStrip);
m_toolStripContainer = toolStripContainer;
m_toolBars = new List<ToolBarBridge>();
PopulateToolBars(toolStripContainer.TopToolStripPanel);
PopulateToolBars(toolStripContainer.BottomToolStripPanel);
PopulateToolBars(toolStripContainer.LeftToolStripPanel);
PopulateToolBars(toolStripContainer.RightToolStripPanel);
m_editorBridge = new EditorBridge(mapPanel);
}
开发者ID:dekk7,项目名称:xEngine,代码行数:17,代码来源:ApplicationBridge.cs
示例13: NotificationPanel
public NotificationPanel()
{
BackColor = Color.Black;
ForeColor = Color.White;
Height = 200;
//imgLst
ImageList imgLst = new ImageList();
imgLst.Images.Add("E", Properties.Resources.Error);
imgLst.Images.Add("I", Properties.Resources.Info);
imgLst.Images.Add("Q", Properties.Resources.Question);
imgLst.Images.Add("S", Properties.Resources.Success);
imgLst.Images.Add("W", Properties.Resources.Warning);
//listView
listView = new ListView();
listView.AllowColumnReorder = false;
listView.BackColor = Color.Black;
listView.CheckBoxes = false;
listView.Dock = DockStyle.Fill;
listView.ForeColor = Color.White;
listView.FullRowSelect = true;
listView.LargeImageList = listView.SmallImageList = listView.StateImageList = imgLst;
listView.MultiSelect = false;
listView.ShowItemToolTips = true;
listView.View = View.Details;
listView.Columns.Add("", 20, HorizontalAlignment.Left); //icon
listView.Columns.Add("", 20, HorizontalAlignment.Left); //S/N
listView.Columns.Add("Message", 200, HorizontalAlignment.Left);
listView.Columns.Add("File", 100, HorizontalAlignment.Left);
listView.Columns.Add("Line", 50, HorizontalAlignment.Left);
listView.Columns.Add("Column", 50, HorizontalAlignment.Left);
//searchBox
searchBox = new ToolStripTextBox()
{
//BackColor = Color.Black,
//ForeColor = Color.White,
ToolTipText = "search"
};
searchBox.ToolTipText = "search";
searchBox.KeyUp += searchBox_KeyUp;
searchBox.TextChanged += searchBox_TextChanged;
//stripListViewToolBar
stripListViewToolBar = new ToolStrip();
stripListViewToolBar.Dock = DockStyle.Fill;
stripListViewToolBar.Items.Add(searchBox);
//tscListView
tscListViewCont = new ToolStripContainer();
tscListViewCont.Dock = DockStyle.Fill;
tscListViewCont.TopToolStripPanel.BackColor = tscListViewCont.ContentPanel.BackColor = Color.Black;
tscListViewCont.TopToolStripPanel.ForeColor = tscListViewCont.ContentPanel.ForeColor = Color.White;
tscListViewCont.TopToolStripPanel.Controls.Add(stripListViewToolBar);
tscListViewCont.ContentPanel.Controls.Add(listView);
//this
this.Controls.Add(tscListViewCont);
this.SizeChanged += NotificationPanel_SizeChanged;
Messenger.Notified += Messenger_Notified;
Messenger.NotificationsCleared += Messenger_NotificationsCleared;
}
开发者ID:Chieze-Franklin,项目名称:Quic,代码行数:64,代码来源:QuicBar.cs
示例14: Main
static void Main(string[] args)
{
// important to call these before creating application host
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.DoEvents(); // see http://www.codeproject.com/buglist/EnableVisualStylesBug.asp?df=100&forumid=25268&exp=0&select=984714
// Set up localization support early on, so that user-readable strings will be localized
// during the initialization phase below. Use XML files that are embedded resources.
Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.CurrentCulture;
Localizer.SetStringLocalizer(new EmbeddedResourceStringLocalizer());
var catalog = new TypeCatalog(
typeof(SettingsService), // persistent settings and user preferences dialog
typeof(StatusService), // status bar at bottom of main Form
typeof(CommandService), // handles commands in menus and toolbars
typeof(ControlHostService), // docking control host
typeof(WindowLayoutService), // multiple window layout support
typeof(WindowLayoutServiceCommands), // window layout commands
typeof(FileDialogService), // standard Windows file dialogs
typeof(AutoDocumentService), // opens documents from last session, or creates a new document, on startup
typeof(Outputs), // service that provides static methods for writing to IOutputWriter objects.
typeof(OutputService), // rich text box for displaying error and warning messages. Implements IOutputWriter.
typeof(RecentDocumentCommands), // standard recent document commands in File menu
typeof(StandardFileCommands), // standard File menu commands for New, Open, Save, SaveAs, Close
typeof(StandardFileExitCommand), // standard File exit menu command
typeof(HelpAboutCommand), // Help -> About command
typeof(AtfUsageLogger), // logs computer info to an ATF server
typeof(CrashLogger), // logs unhandled exceptions to an ATF server
typeof(ContextRegistry), // central context registry with change notification
typeof(DocumentRegistry), // central document registry with change notification
typeof(MainWindowTitleService), // tracks document changes and updates main form title
typeof(TabbedControlSelector), // enable ctrl-tab selection of documents and controls within the app
typeof(DefaultTabCommands), // provides the default commands related to document tab Controls
typeof(Editor), // code editor component
typeof(PythonService), // scripting service for automated tests
typeof(ScriptConsole), // provides a dockable command console for entering Python commands
typeof(AtfScriptVariables), // exposes common ATF services as script variables
typeof(AutomationService), // provides facilities to run an automated script using the .NET remoting service
typeof(PerforceService), // Perforce plugin
typeof(SourceControlCommands), // source control commmands to interact with Perforce plugin
typeof(SourceControlContext) // source control context component
);
var container = new CompositionContainer(catalog);
var toolStripContainer = new ToolStripContainer();
toolStripContainer.Dock = DockStyle.Fill;
var mainForm = new MainForm(toolStripContainer);
var image = GdiUtil.GetImage("CodeEditor.Resources.File_edit.ico");
mainForm.Icon = GdiUtil.CreateIcon(image, 32, true);
mainForm.Text = "Code Editor".Localize();
var batch = new CompositionBatch();
batch.AddPart(mainForm);
batch.AddPart(new WebHelpCommands("https://github.com/SonyWWS/ATF/wiki/ATF-Code-Editor-Sample".Localize()));
container.Compose(batch);
// Initialize components that require it. Initialization often can't be done in the constructor,
// or even after imports have been satisfied by MEF, since we allow circular dependencies between
// components, via the System.Lazy class. IInitializable allows components to defer some operations
// until all MEF composition has been completed.
container.InitializeAll();
// Show the main form and start message handling. The main Form Load event provides a final chance
// for components to perform initialization and configuration.
Application.Run(mainForm);
container.Dispose();
}
开发者ID:vincenthamm,项目名称:ATF,代码行数:72,代码来源:Program.cs
示例15: Main
static void Main()
{
// important to call these before creating application host
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.DoEvents(); // see http://www.codeproject.com/buglist/EnableVisualStylesBug.asp?df=100&forumid=25268&exp=0&select=984714
#if true
// Set up localization support early on, so that user-readable strings will be localized
// during the initialization phase below. Use XML files that are embedded resources.
Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.CurrentCulture;
Localizer.SetStringLocalizer(new EmbeddedResourceStringLocalizer());
var catalog = new TypeCatalog(
typeof(SettingsService), // persistent settings and user preferences dialog
typeof(StatusService), // status bar at bottom of main Form
typeof(CommandService), // handles commands in menus and toolbars
typeof(ControlHostService), // docking control host
typeof(WindowLayoutService), // multiple window layout support
typeof(WindowLayoutServiceCommands), // window layout commands
typeof(FileDialogService), // standard Windows file dialogs
typeof(AutoDocumentService), // opens documents from last session, or creates a new document, on startup
typeof(Outputs), // service that provides static methods for writing to IOutputWriter objects.
typeof(OutputService), // rich text box for displaying error and warning messages. Implements IOutputWriter.
typeof(RecentDocumentCommands), // standard recent document commands in File menu
typeof(StandardFileCommands), // standard File menu commands for New, Open, Save, SaveAs, Close
typeof(StandardFileExitCommand), // standard File exit menu command
typeof(StandardEditCommands), // standard Edit menu commands for copy/paste
typeof(StandardEditHistoryCommands), // standard Edit menu commands for undo/redo
typeof(StandardSelectionCommands), // standard Edit menu selection commands
typeof(HelpAboutCommand), // Help -> About command
typeof(UnhandledExceptionService), // catches unhandled exceptions, displays info, and gives user a chance to save
typeof(ContextRegistry), // central context registry with change notification
typeof(DocumentRegistry), // central document registry with change notification
typeof(MainWindowTitleService), // tracks document changes and updates main form title
typeof(TabbedControlSelector), // enable ctrl-tab selection of documents and controls within the app
typeof(DefaultTabCommands), // provides the default commands related to document tab Controls
typeof(PropertyEditor), // property grid for editing selected objects
//typeof(GridPropertyEditor), // grid control for editing selected objects
typeof(PropertyEditingCommands), // commands for PropertyEditor and GridPropertyEditor, like Reset,
// Reset All, Copy Value, Paste Value, Copy All, Paste All
typeof(Editor), // code editor component
typeof(SchemaLoader), // loads schema and extends types
typeof(CharacterEditor),
typeof(CharacterSettingsCommands)
);
// Set up the MEF container with these components
var container = new CompositionContainer(catalog);
var toolStripContainer = new ToolStripContainer();
toolStripContainer.Dock = DockStyle.Fill;
var mainForm = new MainForm(toolStripContainer);
mainForm.Icon = GdiUtil.CreateIcon(ResourceUtil.GetImage(Sce.Atf.Resources.AtfIconImage));
mainForm.Text = "Butterfly Engine".Localize();
var batch = new CompositionBatch();
batch.AddPart(mainForm);
container.Compose(batch);
// To make the tab commands (e.g., "Copy Full Path", "Open Containing Folder") available, we have to change
// the default behavior to work with this sample app's unusual Editor. In most cases, an editor like this
// would implement IDocumentClient and this customization of DefaultTabCommands wouldn't be necessary.
var tabCommands = container.GetExportedValue<DefaultTabCommands>();
tabCommands.IsDocumentControl = controlInfo => controlInfo.Client is Editor;
// Initialize components that require it. Initialization often can't be done in the constructor,
// or even after imports have been satisfied by MEF, since we allow circular dependencies between
// components, via the System.Lazy class. IInitializable allows components to defer some operations
// until all MEF composition has been completed.
container.InitializeAll();
// Show the main form and start message handling. The main Form Load event provides a final chance
// for components to perform initialization and configuration.
Application.Run(mainForm);
// Give components a chance to clean up.
container.Dispose();
#else
var mainForm = new FormTest
{
Icon = GdiUtil.CreateIcon(ResourceUtil.GetImage(Sce.Atf.Resources.AtfIconImage))
};
Application.Run(mainForm);
#endif
}
开发者ID:lxjk,项目名称:ButterflyEngine,代码行数:94,代码来源:Program.cs
示例16: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MapForm));
this.treeView1 = new System.Windows.Forms.TreeView();
this.treeviewcontext = new System.Windows.Forms.ContextMenuStrip(this.components);
this.setActiveMatgToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.setActiveScnrToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.renameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.duplicateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.duplicateRecursivelyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.overwriteMetaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.convertCEToH2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.removeFromQuickListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.outputListToFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.sortByToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tagTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.folderHierarchyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.clearTagQuickListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveMetaDialog = new System.Windows.Forms.SaveFileDialog();
this.loadMetaDialog = new System.Windows.Forms.OpenFileDialog();
this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
this.openInfoFileDialog = new System.Windows.Forms.OpenFileDialog();
this.displayMenu = new System.Windows.Forms.ContextMenu();
this.SwapItem = new System.Windows.Forms.MenuItem();
this.FloodfillSwapItem = new System.Windows.Forms.MenuItem();
this.JumpToTagItem = new System.Windows.Forms.MenuItem();
this.chunkclone = new System.Windows.Forms.MenuItem();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.ShowReflex = new System.Windows.Forms.MenuItem();
this.ShowIdent = new System.Windows.Forms.MenuItem();
this.ShowString = new System.Windows.Forms.MenuItem();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.progressbar = new System.Windows.Forms.ToolStripProgressBar();
this.statusbar = new System.Windows.Forms.ToolStripStatusLabel();
this.references = new System.Windows.Forms.ListView();
this.refs = new System.Windows.Forms.ColumnHeader();
this.panel2 = new System.Windows.Forms.Panel();
this.btnUndock = new System.Windows.Forms.Button();
this.buttonInternalize = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.referenceEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.metaEditorNewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.metaEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.hexEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.StringEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rebuilderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fixSystemLinkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pluginsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportScriptsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripDropDownButton2 = new System.Windows.Forms.ToolStripDropDownButton();
this.metaTreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rawDataDropDown = new System.Windows.Forms.ToolStripDropDownButton();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.BitmapContextStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.saveBitmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.injectBitmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.convertToBumpMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bitmapEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.secondaryMagicBox = new System.Windows.Forms.RichTextBox();
this.primaryMagicBox = new System.Windows.Forms.RichTextBox();
this.label4 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.panel3 = new System.Windows.Forms.Panel();
this.metaRawBox = new System.Windows.Forms.RichTextBox();
this.lblRawSize = new System.Windows.Forms.Label();
this.scanbspwithifp = new System.Windows.Forms.CheckBox();
this.soundsCheckBox = new System.Windows.Forms.CheckBox();
this.recursiveCheckBox = new System.Windows.Forms.CheckBox();
this.parsedCheckBox = new System.Windows.Forms.CheckBox();
this.loadMetaButton = new System.Windows.Forms.Button();
this.saveMetaButton = new System.Windows.Forms.Button();
this.metaTypeBox = new System.Windows.Forms.RichTextBox();
this.label2 = new System.Windows.Forms.Label();
this.metaIdentBox = new System.Windows.Forms.RichTextBox();
this.metaSizeBox = new System.Windows.Forms.RichTextBox();
this.metaOffsetBox = new System.Windows.Forms.RichTextBox();
this.label5 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.signMapButton = new System.Windows.Forms.Button();
this.analyzeMapButton = new System.Windows.Forms.Button();
this.buildButton = new System.Windows.Forms.Button();
this.searchGroupBox = new System.Windows.Forms.GroupBox();
this.searchLabel = new System.Windows.Forms.Label();
this.searchButton = new System.Windows.Forms.Button();
this.searchTextBox = new System.Windows.Forms.TextBox();
this.searchComboBox = new System.Windows.Forms.ComboBox();
this.button3 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox();
//.........这里部分代码省略.........
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:101,代码来源:MapForm.Designer.cs
示例17: TestBindingToToolStripContainer
public void TestBindingToToolStripContainer()
{
ToolStripContainer control = new ToolStripContainer();
IBusinessObject obj = new BusinessObject();
using(BindingScope scope = new BindingScope())
{
IBusinessObject bindableSource = scope.CreateSource(obj);
if(control is Control)
((Control)control).CreateControl();
control.BindingContext = new BindingContext();
ToolStripContainer bindableTarget = scope.CreateTarget(control);
int dataBindingsBeforeAccessibleDefaultActionDescription = control.DataBindings.Count;
scope.Bind(bindableSource.Name).To(bindableTarget.AccessibleDefaultActionDescription);
Assert.AreEqual(dataBindingsBeforeAccessibleDefaultActionDescription + 1, control.DataBindings.Count);
Assert.AreEqual(control.AccessibleDefaultActionDescription, obj.Name);
obj.ChangeName();
Assert.AreEqual(control.AccessibleDefaultActionDescription, obj.Name);
int dataBindingsBeforeAccessibleDescription = control.DataBindings.Count;
scope.Bind(bindableSource.Name).To(bindableTarget.AccessibleDescription);
Assert.AreEqual(dataBindingsBeforeAccessibleDescription + 1, control.DataBindings.Count);
Assert.AreEqual(control.AccessibleDescription, obj.Name);
obj.ChangeName();
Assert.AreEqual(control.AccessibleDescription, obj.Name);
int dataBindingsBeforeAccessibleName = control.DataBindings.Count;
scope.Bind(bindableSource.Name).To(bindableTarget.AccessibleName);
Assert.AreEqual(dataBindingsBeforeAccessibleName + 1, control.DataBindings.Count);
Assert.AreEqual(control.AccessibleName, obj.Name);
obj.ChangeName();
Assert.AreEqual(control.AccessibleName, obj.Name);
int dataBindingsBeforeHeight = control.DataBindings.Count;
scope.Bind(bindableSource.IntValue).To(bindableTarget.Height);
Assert.AreEqual(dataBindingsBeforeHeight + 1, control.DataBindings.Count);
Assert.AreEqual(control.Height, obj.IntValue);
obj.ChangeIntValue();
Assert.AreEqual(control.Height, obj.IntValue);
int dataBindingsBeforeLeft = control.DataBindings.Count;
scope.Bind(bindableSource.IntValue).To(bindableTarget.Left);
Assert.AreEqual(dataBindingsBeforeLeft + 1, control.DataBindings.Count);
Assert.AreEqual(control.Left, obj.IntValue);
obj.ChangeIntValue();
Assert.AreEqual(control.Left, obj.IntValue);
int dataBindingsBeforeName = control.DataBindings.Count;
scope.Bind(bindableSource.Name).To(bindableTarget.Name);
Assert.AreEqual(dataBindingsBeforeName + 1, control.DataBindings.Count);
Assert.AreEqual(control.Name, obj.Name);
obj.ChangeName();
Asse
|
请发表评论