private void Initialize() { foreach (TextTemplate template in TextTemplate.TextTemplates) { SideTab tab = new SideTab(this, template.Name); tab.DisplayName = StringParser.Parse(tab.Name); tab.CanSaved = false; foreach (TextTemplate.Entry entry in template.Entries) { tab.Items.Add(SideTabItemFactory.CreateSideTabItem(entry.Display, entry.Value)); } tab.CanBeDeleted = tab.CanDragDrop = false; Tabs.Add(tab); } try { XmlDocument doc = new XmlDocument(); doc.Load(Path.Combine(PropertyService.ConfigDirectory, "SideBarConfig.xml")); if (doc.DocumentElement.GetAttribute("version") != "1.0") { GenerateStandardSideBar(); } else { LoadSideBarConfig(doc.DocumentElement["SideBar"]); } } catch (FileNotFoundException) { // do not show a warning when the side bar file does not exist GenerateStandardSideBar(); } catch (Exception ex) { MessageService.ShowWarning(ex.ToString()); GenerateStandardSideBar(); } WorkbenchSingleton.WorkbenchUnloaded += delegate { SaveSideBarViewConfig(); }; }
private static SideTab CreateReportingSidetab () { SideTab sideTab = new SideTab("ReportDesigner"); sideTab.CanSaved = false; AddPointerToSideTab(sideTab); // TextItem ToolboxItem tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseTextItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.TextBox"); tb.Bitmap = WinFormsResourceService.GetIcon("Icons.16.16.SharpReport.Textbox").ToBitmap(); sideTab.Items.Add(new SideTabItemDesigner(tb)); // Row tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseRowItem)); tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataRow"); sideTab.Items.Add(new SideTabItemDesigner(tb)); //BaseTable tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseTableItem)); tb.DisplayName ="Table"; sideTab.Items.Add(new SideTabItemDesigner(tb)); tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); //BaseDataItem tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseDataItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataField"); sideTab.Items.Add(new SideTabItemDesigner(tb)); //Grahics // Line tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseLineItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Line"); tb.Bitmap = WinFormsResourceService.GetIcon("Icons.16.16.SharpReport.Line").ToBitmap(); sideTab.Items.Add(new SideTabItemDesigner(tb)); // Rectangle tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseRectangleItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Rectangle"); tb.Bitmap = GlobalValues.RectangleBitmap(); sideTab.Items.Add(new SideTabItemDesigner(tb)); // Circle tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseCircleItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Circle"); tb.Bitmap = GlobalValues.CircleBitmap(); sideTab.Items.Add(new SideTabItemDesigner(tb)); // Image tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseImageItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Image"); tb.Bitmap = WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.bmp").ToBitmap(); sideTab.Items.Add(new SideTabItemDesigner(tb)); return sideTab; }
public void AddProjectDlls(OpenedFile file) { var compilation = SD.ParserService.GetCompilationForFile(file.FileName); foreach (var reference in compilation.ReferencedAssemblies) { string f = reference.GetReferenceAssemblyLocation(); if (f != null && !addedAssemblys.Contains(f)) { try { var assembly = Assembly.LoadFrom(f); SideTab sideTab = new SideTab(sideBar, assembly.FullName.Split(new[] {','})[0]); sideTab.DisplayName = StringParser.Parse(sideTab.Name); sideTab.CanBeDeleted = false; sideTab.ChoosedItemChanged += OnChoosedItemChanged; sideTab.Items.Add(new WpfSideTabItem()); foreach (var t in assembly.GetExportedTypes()) { if (IsControl(t)) { sideTab.Items.Add(new WpfSideTabItem(t)); } } if (sideTab.Items.Count > 1) sideBar.Tabs.Add(sideTab); addedAssemblys.Add(f); } catch (Exception ex) { WpfViewContent.DllLoadErrors.Add(new SDTask(new BuildError(f, ex.Message))); } } } }
public void DeleteSideTab(SideTab tab) { if (tab == null) { return; } Tabs.Remove(tab); OnSideTabDeleted(tab); }
void GenerateStandardSideBar() { clipboardRing = new SideTab(this, "${res:SharpDevelop.SideBar.ClipboardRing}"); clipboardRing.DisplayName = StringParser.Parse(clipboardRing.Name); clipboardRing.CanBeDeleted = false; clipboardRing.CanDragDrop = false; this.Tabs.Add(clipboardRing); this.ActiveTab = clipboardRing; }
public override void Run() { SharpDevelopSideBar sideBar = (SharpDevelopSideBar)Owner; SideTab tab = new SideTab(sideBar, "New Tab"); sideBar.Tabs.Add(tab); sideBar.StartRenamingOf(tab); sideBar.DoAddTab = true; sideBar.Refresh(); }
static SideTabItem CreateToolboxPointer(SideTab sideTab) { var pointer = new SharpDevelopSideTabItem("Pointer") { CanBeRenamed = false, CanBeDeleted = false, Icon = new Bitmap(IconService.GetBitmap("Icons.16x16.FormsDesigner.PointerIcon"), 16, 16), Tag = null }; return(pointer); }
static void SelectedToolUsedHandler(object sender, EventArgs e) { LoggingService.Debug("SelectedToolUsedHandler"); SideTab tab = sideBar.ActiveTab; // try to add project reference if (sender != null && sender is ICSharpCode.FormsDesigner.Services.ToolboxService) { ToolboxItem selectedItem = (sender as IToolboxService).GetSelectedToolboxItem(); if (tab is CustomComponentsSideTab) { if (selectedItem != null && selectedItem.TypeName != null) { LoggingService.Debug("Checking for reference to CustomComponent: " + selectedItem.TypeName); // Check current project has the custom component first. IProjectContent currentProjectContent = ParserService.CurrentProjectContent; if (currentProjectContent != null) { if (currentProjectContent.GetClass(selectedItem.TypeName, 0) == null) { // Check other projects in the solution. LoggingService.Debug("Checking other projects in the solution."); IProject projectContainingType = FindProjectContainingType(selectedItem.TypeName); if (projectContainingType != null) { AddProjectReferenceToProject(ProjectService.CurrentProject, projectContainingType); } } } } } else { if (selectedItem != null && selectedItem.AssemblyName != null) { IProject currentProject = ProjectService.CurrentProject; if (currentProject != null) { if (!ProjectContainsReference(currentProject, selectedItem.AssemblyName)) { AddReferenceToProject(currentProject, selectedItem.AssemblyName); } } } } } if (tab.Items.Count > 0) { tab.ChoosedItem = tab.Items[0]; } sideBar.Refresh(); }
public override void Run() { SharpDevelopSideBar sideBar = (SharpDevelopSideBar)Owner; int index = sideBar.Tabs.IndexOf(sideBar.ActiveTab); if (index >= 0 && index < sideBar.Tabs.Count - 1) { SideTab tab = sideBar.Tabs[index]; sideBar.Tabs[index] = sideBar.Tabs[index + 1]; sideBar.Tabs[index + 1] = tab; sideBar.Refresh(); } }
private static void AddPointerToSideTab(SideTab sideTab) { // Add the standard pointer. SharpDevelopSideTabItem sti = new SharpDevelopSideTabItem("Pointer"); sti.CanBeRenamed = false; sti.CanBeDeleted = false; Bitmap pointerBitmap = new Bitmap(IconService.GetBitmap("Icons.16x16.FormsDesigner.PointerIcon"), 16, 16); sti.Icon = pointerBitmap; sti.Tag = null; sideTab.Items.Add(sti); }
public override void Run() { SharpDevelopSideBar sideBar = (SharpDevelopSideBar)Owner; int index = sideBar.GetTabIndexAt(sideBar.SideBarMousePosition.X, sideBar.SideBarMousePosition.Y); if (index >= 0 && index < sideBar.Tabs.Count - 1) { SideTab tab = sideBar.Tabs[index]; sideBar.Tabs[index] = sideBar.Tabs[index + 1]; sideBar.Tabs[index + 1] = tab; sideBar.Refresh(); } }
static void SelectedToolUsedHandler(object sender, EventArgs e) { SD.Log.Debug("SelectedToolUsedHandler"); SideTab tab = sideBar.ActiveTab; // try to add project reference if (sender is ICSharpCode.FormsDesigner.Services.ToolboxService) { ToolboxItem selectedItem = ((IToolboxService)sender).GetSelectedToolboxItem(); if (tab is CustomComponentsSideTab) { if (selectedItem != null && selectedItem.TypeName != null) { SD.Log.Debug("Checking for reference to CustomComponent: " + selectedItem.TypeName); // Check current project has the custom component first. ICompilation currentCompilation = GetCompilationForCurrentProject(); var typeName = new FullTypeName(selectedItem.TypeName); if (currentCompilation != null && currentCompilation.FindType(typeName).Kind == TypeKind.Unknown) { // Check other projects in the solution. SD.Log.Debug("Checking other projects in the solution."); IProject projectContainingType = FindProjectContainingType(typeName); if (projectContainingType != null) { AddProjectReferenceToProject(SD.ProjectService.CurrentProject, projectContainingType); } } } } else { if (selectedItem != null && selectedItem.AssemblyName != null) { IProject currentProject = ProjectService.CurrentProject; if (currentProject != null) { if (!ProjectContainsReference(currentProject, selectedItem.AssemblyName)) { AddReferenceToProject(currentProject, selectedItem.AssemblyName); } } } } } if (tab.Items.Count > 0) { tab.ChosenItem = tab.Items[0]; } sideBar.Refresh(); }
public WpfToolbox() { sideBar = new WpfSideBar(); SideTab sideTab = new SideTab(sideBar, "Windows Presentation Foundation"); sideTab.DisplayName = StringParser.Parse(sideTab.Name); sideTab.CanBeDeleted = false; sideTab.ChosenItemChanged += OnChosenItemChanged; sideTab.Items.Add(new WpfSideTabItem()); foreach (Type t in Metadata.GetPopularControls()) sideTab.Items.Add(new WpfSideTabItem(t)); sideBar.Tabs.Add(sideTab); sideBar.ActiveTab = sideTab; }
public static void AddViewContent(IViewContent viewContent) { if (viewContent == null) throw new ArgumentNullException("viewContent"); if (!initialised) Initialise(); // Make sure the standard workflow sidebar exists if (standardSideTab == null) { LoggingService.Debug("Creating standard workflow sidetab"); standardSideTab = CreateReportingSidetab(); } ViewCount++; }
public override void Run() { SharpDevelopSideBar sideBar = (SharpDevelopSideBar)Owner; SideTab selectedSideTab = sideBar.GetTabAt(sideBar.SideBarMousePosition.X, sideBar.SideBarMousePosition.Y); if (MessageBox.Show(StringParser.Parse(ResourceService.GetString("SideBarComponent.ContextMenu.DeleteTabHeaderQuestion"), new StringTagPair("TabHeader", selectedSideTab.DisplayName)), ResourceService.GetString("Global.QuestionText"), MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { sideBar.DeleteSideTab(selectedSideTab); sideBar.Refresh(); } }
void GenerateStandardSideBar() { sideBar = new SharpDevelopSideBar(); SideTab tab = new SideTab(sideBar, "${res:SharpDevelop.SideBar.GeneralCategory}"); tab.DisplayName = StringParser.Parse(tab.Name); sideBar.Tabs.Add(tab); sideBar.ActiveTab = tab; tab = new SideTab(sideBar, "${res:SharpDevelop.SideBar.ClipboardRing}"); tab.DisplayName = StringParser.Parse(tab.Name); tab.IsClipboardRing = true; tab.CanBeDeleted = false; tab.CanDragDrop = false; sideBar.Tabs.Add(tab); }
public void AddProjectDlls(OpenedFile file) { var compilation = SD.ParserService.GetCompilationForFile(file.FileName); var typeResolutionService = new TypeResolutionService(file.FileName); foreach (var reference in compilation.ReferencedAssemblies) { string assemblyFileName = reference.GetReferenceAssemblyLocation(); if (assemblyFileName != null && !addedAssemblies.Contains(assemblyFileName)) { try { // DO NOT USE Assembly.LoadFrom!!! // see http://community.sharpdevelop.net/forums/t/19968.aspx Assembly assembly = typeResolutionService.LoadAssembly(assemblyFileName); if (assembly == null) { continue; } SideTab sideTab = new SideTab(sideBar, assembly.FullName.Split(new[] { ',' })[0]); sideTab.DisplayName = StringParser.Parse(sideTab.Name); sideTab.CanBeDeleted = false; sideTab.ChosenItemChanged += OnChosenItemChanged; sideTab.Items.Add(new WpfSideTabItem()); foreach (var t in assembly.GetExportedTypes()) { if (IsControl(t)) { sideTab.Items.Add(new WpfSideTabItem(t)); } } if (sideTab.Items.Count > 1) { sideBar.Tabs.Add(sideTab); } addedAssemblies.Add(assemblyFileName); } catch (Exception ex) { WpfViewContent.DllLoadErrors.Add(new SDTask(new BuildError(assemblyFileName, ex.Message))); } } } }
private void Initialize() { try { foreach (TextTemplate template in TextTemplate.TextTemplates) { SideTab tab = new SideTab(this, template.Name); tab.DisplayName = StringParser.Parse(tab.Name); tab.CanSaved = false; foreach (TextTemplate.Entry entry in template.Entries) { tab.Items.Add(SideTabItemFactory.CreateSideTabItem(entry.Display, entry.Value)); } tab.CanBeDeleted = tab.CanDragDrop = false; Tabs.Add(tab); } } catch { //string s = ex.Message; } try { XmlDocument doc = new XmlDocument(); doc.Load(Path.Combine(PropertyService.ConfigDirectory, "SideBarConfig.xml")); if (doc.DocumentElement.GetAttribute("version") != "1.0") { GenerateStandardSideBar(); } else { LoadSideBarConfig(doc.DocumentElement["SideBar"]); } } catch (FileNotFoundException) { // do not show a warning when the side bar file does not exist GenerateStandardSideBar(); } catch (Exception ex) { MessageService.ShowWarning(ex.ToString()); GenerateStandardSideBar(); } WorkbenchSingleton.WorkbenchUnloaded += delegate { SaveSideBarViewConfig(); }; }
public WpfToolbox() { sideBar = new WpfSideBar(); SideTab sideTab = new SideTab(sideBar, "Windows Presentation Foundation"); sideTab.DisplayName = StringParser.Parse(sideTab.Name); sideTab.CanBeDeleted = false; sideTab.ChoosedItemChanged += OnChoosedItemChanged; sideTab.Items.Add(new WpfSideTabItem()); foreach (Type t in Metadata.GetPopularControls()) { sideTab.Items.Add(new WpfSideTabItem(t)); } sideBar.Tabs.Add(sideTab); sideBar.ActiveTab = sideTab; }
public static void AddViewContent(IViewContent viewContent) { if (viewContent == null) { throw new ArgumentNullException("viewContent"); } if (!initialised) { Initialise(); } // Make sure the standard workflow sidebar exists if (standardSideTab == null) { LoggingService.Debug("Creating standard workflow sidetab"); standardSideTab = CreateReportingSidetab(); } ViewCount++; }
private void Initialize() { foreach (TextTemplate template in TextTemplate.TextTemplates) { SideTab tab = new SideTab(this, template.Name); tab.DisplayName = StringParser.Parse(tab.Name); tab.CanSaved = false; foreach (TextTemplate.Entry entry in template.Entries) { tab.Items.Add(SideTabItemFactory.CreateSideTabItem(entry.Display, entry.Value)); } tab.CanBeDeleted = tab.CanDragDrop = false; Tabs.Add(tab); } try { XmlDocument doc = new XmlDocument(); doc.Load(Path.Combine(PropertyService.ConfigDirectory, "SideBarConfig.xml")); if (doc.DocumentElement.GetAttribute("version") != "1.0") { GenerateStandardSideBar(); } else { LoadSideBarConfig(doc.DocumentElement["SideBar"]); } } catch (FileNotFoundException) { // do not show a warning when the side bar file does not exist GenerateStandardSideBar(); } catch (Exception ex) { LoggingService.Warn("Error loading SideBarConfig.xml", ex); // We cannot show the error to the user; it's possible that this code is called // while dispatcher processing is suspended. // http://community.sharpdevelop.net/forums/t/19984.aspx //MessageService.ShowWarning(ex.ToString()); GenerateStandardSideBar(); } WorkbenchSingleton.WorkbenchUnloaded += delegate { SaveSideBarViewConfig(); }; }
void SetContextMenu(object sender, MouseEventArgs e) { ExitRenameMode(); int index = GetTabIndexAt(e.X, e.Y); if (index >= 0) { SideTab tab = Tabs[index]; SetDeletedState(tab.CanBeDeleted); SetRenameState(tab.CanBeRenamed); if (index > 0) { internalState |= SidebarState.CanMoveUp; } else { internalState = internalState & ~SidebarState.CanMoveUp; } if (index < Tabs.Count - 1) { internalState |= SidebarState.CanMoveDown; } else { internalState = internalState & ~(SidebarState.CanMoveDown); } Tabs.DragOverTab = tab; Refresh(); Tabs.DragOverTab = null; } if (e.Button == MouseButtons.Right) { MenuService.ShowContextMenu(this, contextMenuPath, this, e.X, e.Y); } }
public SharpDevelopSideBar() { SideBar = this; SideTabItemFactory = new SharpDevelopSideTabItemFactory(); MouseUp += new MouseEventHandler(SetContextMenu); sideTabContent.MouseUp += new MouseEventHandler(SetItemContextMenu); foreach (TextTemplate template in TextTemplate.TextTemplates) { SideTab tab = new SideTab(this, template.Name); tab.DisplayName = StringParser.Parse(tab.Name); tab.CanSaved = false; foreach (TextTemplate.Entry entry in template.Entries) { tab.Items.Add(SideTabItemFactory.CreateSideTabItem(entry.Display, entry.Value)); } tab.CanBeDeleted = tab.CanDragDrop = false; standardTabs[tab] = true; Tabs.Add(tab); } sideTabContent.DoubleClick += new EventHandler(MyDoubleClick); }
private void Initialize() { foreach (TextTemplateGroup template in SD.Templates.TextTemplates) { SideTab tab = new SideTab(this, template.Name); tab.DisplayName = StringParser.Parse(tab.Name); tab.CanSaved = false; foreach (TextTemplate entry in template.Entries) { tab.Items.Add(SideTabItemFactory.CreateSideTabItem(entry.Display, entry.Value)); } tab.CanBeDeleted = tab.CanDragDrop = false; Tabs.Add(tab); } try { XmlDocument doc = new XmlDocument(); doc.Load(Path.Combine(PropertyService.ConfigDirectory, "SideBarConfig.xml")); if (doc.DocumentElement.GetAttribute("version") != "1.0") { GenerateStandardSideBar(); } else { LoadSideBarConfig(doc.DocumentElement["SideBar"]); } } catch (FileNotFoundException) { // do not show a warning when the side bar file does not exist GenerateStandardSideBar(); } catch (Exception ex) { LoggingService.Warn("Error loading SideBarConfig.xml", ex); // We cannot show the error to the user; it's possible that this code is called // while dispatcher processing is suspended. // http://community.sharpdevelop.net/forums/t/19984.aspx //MessageService.ShowWarning(ex.ToString()); GenerateStandardSideBar(); } WorkbenchSingleton.WorkbenchUnloaded += delegate { SaveSideBarViewConfig(); }; }
public void AddProjectDlls(OpenedFile file) { var pc = MyTypeFinder.GetProjectContent(file); foreach (var referencedProjectContent in pc.ThreadSafeGetReferencedContents()) { string f = null; if (referencedProjectContent is ParseProjectContent) { var prj = ((ParseProjectContent)referencedProjectContent).Project as AbstractProject; if (prj != null) f = prj.OutputAssemblyFullPath; } else if (referencedProjectContent is ReflectionProjectContent) { f = ((ReflectionProjectContent) referencedProjectContent).AssemblyLocation; } if (f != null && !addedAssemblys.Contains(f)) { try { var assembly = Assembly.LoadFrom(f); SideTab sideTab = new SideTab(sideBar, assembly.FullName.Split(new[] {','})[0]); sideTab.DisplayName = StringParser.Parse(sideTab.Name); sideTab.CanBeDeleted = false; sideTab.ChoosedItemChanged += OnChoosedItemChanged; sideTab.Items.Add(new WpfSideTabItem()); foreach (var t in assembly.GetExportedTypes()) { if (IsControl(t)) { sideTab.Items.Add(new WpfSideTabItem(t)); } } if (sideTab.Items.Count > 1) sideBar.Tabs.Add(sideTab); addedAssemblys.Add(f); } catch (Exception ex) { WpfViewContent.DllLoadErrors.Add( new Task(new BuildError(f, ex.Message))); } } } }
void OnSideTabDeleted(SideTab tab) { if (SideTabDeleted != null) { SideTabDeleted(this, new SideTabEventArgs(tab)); } }
static SideTab CreateReportingSidetab() { var sideTab = new SideTab("ReportDesigner"); sideTab.CanSaved = false; sideTab.Items.Add(CreateToolboxPointer(sideTab)); // TextItem var toolboxItem = new ToolboxItem(typeof(BaseTextItem)) { DisplayName = ResourceService.GetString("SharpReport.Toolbar.TextBox"), Bitmap = IconService.GetBitmap("Icons.16.16.SharpReport.Textbox") }; sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); //DataItem toolboxItem = new ToolboxItem(typeof(BaseDataItem)) { DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataField"), Bitmap = IconService.GetBitmap("Icons.16x16.SharpQuery.Column") }; sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); // Line toolboxItem = new ToolboxItem(typeof(BaseLineItem)) { DisplayName = ResourceService.GetString("SharpReport.Toolbar.Line"), Bitmap = IconService.GetBitmap("Icons.16.16.SharpReport.Line") }; sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); // Rectangle toolboxItem = new ToolboxItem(typeof(BaseRectangleItem)) { DisplayName = ResourceService.GetString("SharpReport.Toolbar.Rectangle"), Bitmap = RectangleBitmap() }; sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); //Circle toolboxItem = new ToolboxItem(typeof(BaseCircleItem)) { DisplayName = ResourceService.GetString("SharpReport.Toolbar.Circle"), Bitmap = CircleBitmap() }; sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); //GroupHeader toolboxItem = new ToolboxItem(typeof(GroupHeader)); toolboxItem.Bitmap = IconService.GetBitmap("Icons.16x16.NameSpace"); toolboxItem.DisplayName = ResourceService.GetString("SharpReport.Toolbar.GroupHeader"); sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); // Row toolboxItem = new ToolboxItem(typeof(BaseRowItem)); toolboxItem.Bitmap = IconService.GetBitmap("Icons.16x16.SharpQuery.Table"); toolboxItem.DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataRow"); sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); // Image toolboxItem = new ToolboxItem(typeof(BaseImageItem)); toolboxItem.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Image"); toolboxItem.Bitmap = IconService.GetBitmap("Icons.16x16.ResourceEditor.bmp"); sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); /* * * //GroupFooter * tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.GroupFooter)); * tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.NameSpace"); * tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.GroupFooter"); * sideTab.Items.Add(new SideTabItemDesigner(tb)); * * // Row * tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseRowItem)); * tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); * tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataRow"); * sideTab.Items.Add(new SideTabItemDesigner(tb)); * * //BaseTable * // tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); * tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); * tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseTableItem)); * tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Table"); * sideTab.Items.Add(new SideTabItemDesigner(tb)); */ return(sideTab); }
public void AddProjectDlls(OpenedFile file) { var compilation = SD.ParserService.GetCompilationForFile(file.FileName); var typeResolutionService = new TypeResolutionService(file.FileName); foreach (var reference in compilation.ReferencedAssemblies) { string assemblyFileName = reference.GetReferenceAssemblyLocation(); if (assemblyFileName != null && !addedAssemblies.Contains(assemblyFileName)) { try { // DO NOT USE Assembly.LoadFrom!!! // see http://community.sharpdevelop.net/forums/t/19968.aspx Assembly assembly = typeResolutionService.LoadAssembly(assemblyFileName); if (assembly == null) continue; SideTab sideTab = new SideTab(sideBar, assembly.FullName.Split(new[] {','})[0]); sideTab.DisplayName = StringParser.Parse(sideTab.Name); sideTab.CanBeDeleted = false; sideTab.ChosenItemChanged += OnChosenItemChanged; sideTab.Items.Add(new WpfSideTabItem()); foreach (var t in assembly.GetExportedTypes()) { if (IsControl(t)) { sideTab.Items.Add(new WpfSideTabItem(t)); } } if (sideTab.Items.Count > 1) sideBar.Tabs.Add(sideTab); addedAssemblies.Add(assemblyFileName); } catch (Exception ex) { WpfViewContent.DllLoadErrors.Add(new SDTask(new BuildError(assemblyFileName, ex.Message))); } } } }
static SideTab CreateReportingSidetab () { var sideTab = new SideTab("ReportDesigner"); sideTab.CanSaved = false; sideTab.Items.Add(CreateToolboxPointer(sideTab)); // TextItem var toolboxItem = new ToolboxItem(typeof(BaseTextItem)) { DisplayName = ResourceService.GetString("SharpReport.Toolbar.TextBox"), Bitmap = IconService.GetBitmap("Icons.16.16.SharpReport.Textbox") }; sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); //DataItem toolboxItem = new ToolboxItem(typeof(BaseDataItem)) { DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataField"), // tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Column"); Bitmap = IconService.GetBitmap("Icons.16x16.SharpQuery.Column") }; sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); // Line toolboxItem = new ToolboxItem(typeof(BaseLineItem)) { DisplayName = ResourceService.GetString("SharpReport.Toolbar.Line"), Bitmap = IconService.GetBitmap("Icons.16.16.SharpReport.Line") }; sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); // Rectangle toolboxItem = new ToolboxItem(typeof(BaseRectangleItem)) { DisplayName = ResourceService.GetString("SharpReport.Toolbar.Rectangle"), Bitmap = RectangleBitmap() }; sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); //Circle toolboxItem = new ToolboxItem(typeof(BaseCircleItem)) { DisplayName = ResourceService.GetString("SharpReport.Toolbar.Circle"), Bitmap = CircleBitmap() }; sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); //GroupHeader toolboxItem = new ToolboxItem(typeof(GroupHeader)); toolboxItem.Bitmap = IconService.GetBitmap("Icons.16x16.NameSpace"); toolboxItem.DisplayName = ResourceService.GetString("SharpReport.Toolbar.GroupHeader"); sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); // Row toolboxItem = new ToolboxItem(typeof(BaseRowItem)); toolboxItem.Bitmap = IconService.GetBitmap("Icons.16x16.SharpQuery.Table"); toolboxItem.DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataRow"); sideTab.Items.Add(new SideTabItemDesigner(toolboxItem)); /* //GroupFooter tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.GroupFooter)); tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.NameSpace"); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.GroupFooter"); sideTab.Items.Add(new SideTabItemDesigner(tb)); // Row tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseRowItem)); tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataRow"); sideTab.Items.Add(new SideTabItemDesigner(tb)); //BaseTable // tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseTableItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Table"); sideTab.Items.Add(new SideTabItemDesigner(tb)); //Grahics // Image tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseImageItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Image"); tb.Bitmap = WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.bmp").ToBitmap(); sideTab.Items.Add(new SideTabItemDesigner(tb)); */ return sideTab; }
void LoadSideBarConfig(XmlElement el) { foreach (XmlElement sideTabEl in el.ChildNodes) { SideTab tab = new SideTab(this, sideTabEl.GetAttribute("text")); tab.DisplayName = StringParser.Parse(tab.Name); if (tab.Name == el.GetAttribute("activetab")) { ActiveTab = tab; } else { if (ActiveTab == null) { ActiveTab = tab; } } foreach (XmlElement sideTabItemEl in sideTabEl.ChildNodes) { tab.Items.Add(SideTabItemFactory.CreateSideTabItem(sideTabItemEl.GetAttribute("text"), sideTabItemEl.GetAttribute("value"))); } if (sideTabEl.GetAttribute("clipboardring") == "true") { tab.CanBeDeleted = false; tab.CanDragDrop = false; tab.Name = "${res:SharpDevelop.SideBar.ClipboardRing}"; tab.DisplayName = StringParser.Parse(tab.Name); clipboardRing = tab; } Tabs.Add(tab); } }
private static SideTab CreateReportingSidetab() { SideTab sideTab = new SideTab("ReportDesigner"); sideTab.CanSaved = false; AddPointerToSideTab(sideTab); // TextItem ToolboxItem tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseTextItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.TextBox"); tb.Bitmap = WinFormsResourceService.GetIcon("Icons.16.16.SharpReport.Textbox").ToBitmap(); sideTab.Items.Add(new SideTabItemDesigner(tb)); // Row tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseRowItem)); tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataRow"); sideTab.Items.Add(new SideTabItemDesigner(tb)); //BaseTable tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseTableItem)); tb.DisplayName = "Table"; sideTab.Items.Add(new SideTabItemDesigner(tb)); tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"); //BaseDataItem tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseDataItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataField"); sideTab.Items.Add(new SideTabItemDesigner(tb)); //Grahics // Line tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseLineItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Line"); tb.Bitmap = WinFormsResourceService.GetIcon("Icons.16.16.SharpReport.Line").ToBitmap(); sideTab.Items.Add(new SideTabItemDesigner(tb)); // Rectangle tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseRectangleItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Rectangle"); tb.Bitmap = GlobalValues.RectangleBitmap(); sideTab.Items.Add(new SideTabItemDesigner(tb)); // Circle tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseCircleItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Circle"); tb.Bitmap = GlobalValues.CircleBitmap(); sideTab.Items.Add(new SideTabItemDesigner(tb)); // Image tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseImageItem)); tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Image"); tb.Bitmap = WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.bmp").ToBitmap(); sideTab.Items.Add(new SideTabItemDesigner(tb)); return(sideTab); }
static SideTabItem CreateToolboxPointer(SideTab sideTab) { var pointer = new SharpDevelopSideTabItem("Pointer") { CanBeRenamed = false, CanBeDeleted = false, Icon = new Bitmap(IconService.GetBitmap("Icons.16x16.FormsDesigner.PointerIcon"), 16, 16), Tag = null }; return pointer; }