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(); };
		}
Пример #2
0
		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;
		}
Пример #3
0
		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)));
					}
				}
			}
		}
Пример #4
0
		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;
		}
Пример #6
0
		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();
		}
Пример #7
0
        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);
        }
Пример #8
0
        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();
        }
Пример #9
0
        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();
            }
        }
Пример #10
0
        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);
        }
Пример #11
0
        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();
            }
        }
Пример #12
0
        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();
        }
Пример #13
0
		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;
		}
Пример #14
0
		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++;
		}
Пример #15
0
        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();
            }
        }
Пример #16
0
		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);
		}
Пример #17
0
        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)));
                    }
                }
            }
        }
Пример #18
0
        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);
        }
Пример #19
0
        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(); };
        }
Пример #20
0
        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;
        }
Пример #21
0
        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);
            }
        }
Пример #24
0
        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);
        }
Пример #25
0
		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(); };
		}
Пример #26
0
		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);
		}
Пример #27
0
		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)));
					}
				}
			}
		}
Пример #28
0
		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);
		}
Пример #29
0
		void OnSideTabDeleted(SideTab tab)
		{
			if (SideTabDeleted != null) {
				SideTabDeleted(this, new SideTabEventArgs(tab));
			}
		}
Пример #30
0
        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);
        }
Пример #31
0
		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)));
					}
				}
			}
		}
Пример #32
0
		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);
			}
		}
Пример #34
0
        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);
        }
Пример #35
0
		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;
		}