private OpenFileDialog CreateOpenFileDialog(string title, bool includeProjects, bool includeAssemblies) { OpenFileDialog dlg = new OpenFileDialog(); System.ComponentModel.ISite site = Form == null ? null : Form.Site; if (site != null) { dlg.Site = site; } dlg.Title = title; dlg.Filter = DialogFilter(includeProjects, includeAssemblies); dlg.FilterIndex = 1; dlg.FileName = ""; dlg.Multiselect = true; return(dlg); }
public static bool IsDesignMode(Control control) { while (control != null) { System.Reflection.PropertyInfo siteProperty = control.GetType().GetProperty("Site"); if (siteProperty != null) { System.ComponentModel.ISite site = siteProperty.GetGetMethod().Invoke(control, new object[0]) as System.ComponentModel.ISite; if (site != null && site.DesignMode) { return(true); } } control = control.Parent; } return(false); }
public void OpenProject() { OpenFileDialog dlg = new OpenFileDialog(); System.ComponentModel.ISite site = Form == null ? null : Form.Site; if (site != null) { dlg.Site = site; } dlg.Title = "Open Project"; if (VisualStudioSupport) { dlg.Filter = "Projects & Assemblies(*.nunit,*.csproj,*.vbproj,*.vjsproj, *.vcproj,*.sln,*.dll,*.exe )|*.nunit;*.csproj;*.vjsproj;*.vbproj;*.vcproj;*.sln;*.dll;*.exe|" + "All Project Types (*.nunit,*.csproj,*.vbproj,*.vjsproj,*.vcproj,*.sln)|*.nunit;*.csproj;*.vjsproj;*.vbproj;*.vcproj;*.sln|" + "Test Projects (*.nunit)|*.nunit|" + "Solutions (*.sln)|*.sln|" + "C# Projects (*.csproj)|*.csproj|" + "J# Projects (*.vjsproj)|*.vjsproj|" + "VB Projects (*.vbproj)|*.vbproj|" + "C++ Projects (*.vcproj)|*.vcproj|" + "Assemblies (*.dll,*.exe)|*.dll;*.exe"; } else { dlg.Filter = "Projects & Assemblies(*.nunit,*.dll,*.exe)|*.nunit;*.dll;*.exe|" + "Test Projects (*.nunit)|*.nunit|" + "Assemblies (*.dll,*.exe)|*.dll;*.exe"; } dlg.FilterIndex = 1; dlg.FileName = ""; if (dlg.ShowDialog(Form) == DialogResult.OK) { OpenProject(dlg.FileName); } }
// Constructors public RegexEditorDialog(System.ComponentModel.ISite site) { }
// Constructors public LocalizationExtenderProvider(System.ComponentModel.ISite serviceProvider, System.ComponentModel.IComponent baseComponent) { }