Beispiel #1
0
        private void InitSearchButton(string groupName, RibbonPageGroup ribbonGroup)
        {
            var buttonItem = new BarButtonItem()
            {
                Caption = GetLocalizedCaption("Search")
            };

            var   icon       = WinFormsResourceService.GetIcon("search");
            Image largeImage = icon.ToBitmap();

            buttonItem.LargeGlyph = largeImage;
            buttonItem.Glyph      = new Bitmap(largeImage, new Size(16, 16));


            buttonItem.ItemClick += (sender, e) =>
            {
                var worker = new BackgroundWorker();
                worker.WorkerSupportsCancellation = true;
                worker.DoWork += (s, ex) =>
                {
                    ex.Result = GetOpportunityOverviewCollection();
                };
                worker.RunWorkerCompleted += WorkerRunWorkerCompleted;
                worker.RunWorkerAsync();
            };
            ribbonGroup.ItemLinks.Add(buttonItem, true);
        }
Beispiel #2
0
        private void InitImageList()
        {
            ImageList imageList = new ImageList();

            imageList.ColorDepth = ColorDepth.Depth32Bit;
            imageList.ImageSize  = new System.Drawing.Size(16, 16);

            imageList.Images.Add(IconService.GetBitmap("Icons.16x16.ClosedFolderBitmap"));
            imageList.Images.Add(IconService.GetBitmap("Icons.16x16.OpenFolderBitmap"));
            imageList.Images.Add(new Bitmap(1, 1));

            imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SelectionArrow"));

            imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpReport.Ascending"));

            imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpReport.Descending"));
            //Table's or procedure
            imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Table"));
            imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Procedure"));

            //Parameters
            imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Column"));

            //Function
            imageList.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.SharpReport.Function"));
            this.ImageList = imageList;
        }
Beispiel #3
0
        public void SetItemGlyph(ICSharpCode.Core.Codon codon, BarItem item)
        {
            string imageName   = codon.Properties["imageName"];
            string overlayName = codon.Properties["overlay"];


            if (string.IsNullOrEmpty(imageName))
            {
                return;
            }
            var icon = WinFormsResourceService.GetIcon(imageName.ToLower());

            if (icon == null)
            {
                return;
            }
            Image largeImage = icon.ToBitmap();

            if (!string.IsNullOrEmpty(overlayName))
            {
                var overlay = WinFormsResourceService.GetBitmap(overlayName.ToLower());
                if (overlay != null)
                {
                    DrawOverlay(largeImage, overlay);
                }
            }
            item.LargeGlyph = largeImage;
            item.Glyph      = new Bitmap(largeImage, new Size(16, 16));
        }
Beispiel #4
0
        public DefaultWorkbench()
        {
            Text = ResourceService.GetString("MainWindow.DialogName");
            Icon = WinFormsResourceService.GetIcon("Icons.SharpDevelopIcon");

            StartPosition = FormStartPosition.Manual;
            AllowDrop     = true;
        }
Beispiel #5
0
 void AddImages()
 {
     goButton.Image      = WinFormsResourceService.GetBitmap("Icons.16x16.RunProgramIcon");
     refreshButton.Image = WinFormsResourceService.GetBitmap("Icons.16x16.BrowserRefresh");
     backButton.Image    = WinFormsResourceService.GetBitmap("Icons.16x16.BrowserBefore");
     forwardButton.Image = WinFormsResourceService.GetBitmap("Icons.16x16.BrowserAfter");
     stopButton.Image    = WinFormsResourceService.GetBitmap("Icons.16x16.BrowserCancel");
     Icon = WinFormsResourceService.GetIcon("Icons.16x16.WebSearchIcon");
 }
Beispiel #6
0
        void _tabbedView_DocumentAdded(object sender, DocumentEventArgs e)
        {
            IWorkspace1 workspace = e.Document.Control as IWorkspace1;
            var         icon      = WinFormsResourceService.GetIcon(workspace.ObjectName.ToLower());

            if (icon != null)
            {
                e.Document.Image = new Bitmap(icon.ToBitmap(), new Size(16, 16));
            }
        }
Beispiel #7
0
        public static Icon GetIcon(string name)
        {
            Icon icon = WinFormsResourceService.GetIcon(name);

            if (icon != null)
            {
                return(icon);
            }
            return(WinFormsResourceService.GetIcon("Icons.16x16.MiscFiles"));
        }
 void SetIcon()
 {
     if (this.WorkbenchWindow != null)
     {
         System.Drawing.Icon icon = WinFormsResourceService.GetIcon(IconService.GetImageForFile(this.PrimaryFileName));
         if (icon != null)
         {
             this.WorkbenchWindow.Icon = icon;
         }
     }
 }
        public ResourceList(ResourceEditorControl editor)
        {
            name.Text  = ResourceService.GetString("Global.Name");
            name.Width = 250;

            type.Text  = ResourceService.GetString("ResourceEditor.ResourceEdit.TypeColumn");
            type.Width = 170;

            content.Text  = ResourceService.GetString("ResourceEditor.ResourceEdit.ContentColumn");
            content.Width = 300;

            comment.Text  = ResourceService.GetString("ResourceEditor.ResourceEdit.CommentColumn");
            comment.Width = 300;

            Columns.AddRange(new ColumnHeader[] { name, type, content, comment });

            FullRowSelect = true;
            AutoArrange   = true;
            Alignment     = ListViewAlignment.Left;
            View          = View.Details;
            GridLines     = true;
            LabelEdit     = true;
            Dock          = DockStyle.Fill;
            HideSelection = false;

            BorderStyle = System.Windows.Forms.BorderStyle.None;

            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.string"));
            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.bmp"));
            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.icon"));
            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.cursor"));
            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.bin"));
            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.obj"));
            SmallImageList = images;

            // Set up sorting:
            // User can sort the list by name and by type,
            // whereas sorting by type also implicitly sorts by name.
            IListViewItemComparer textComparer     = new ListViewTextColumnComparer();
            IListViewItemComparer typeNameComparer = new ListViewMultipleColumnsComparer(textComparer, 1, textComparer, 0);

            sorter = new ListViewItemSorter(this,
                                            new IListViewItemComparer[] {
                textComparer,
                typeNameComparer,
                null,
                null
            });
            sorter.SortColumnIndex = 0;
            sorter.SortOrder       = SortOrder.Ascending;

            ContextMenuStrip = MenuService.CreateContextMenu(editor, "/SharpDevelop/ResourceEditor/ResourceList/ContextMenu");
        }
Beispiel #10
0
        public object CreateValue(Type propertyType, string valueString)
        {
            if (propertyType == typeof(Icon))
            {
                return(WinFormsResourceService.GetIcon(valueString));
            }

            if (propertyType == typeof(Image))
            {
                return(WinFormsResourceService.GetBitmap(valueString));
            }

            return(null);
        }
        private void SetItemImage(NavBarGroup group, ICSharpCode.Core.Codon codon)
        {
            if (string.IsNullOrEmpty(codon.Properties["icon"]))
            {
                return;
            }
            var icon = WinFormsResourceService.GetIcon(codon.Properties["icon"]);

            if (icon == null)
            {
                return;
            }
            group.LargeImage = icon.ToBitmap();
            group.SmallImage = icon.ToBitmap();
        }
        private void SetItemImage(NavBarItem barItem, ICSharpCode.Core.Codon codon)
        {
            string iconName = codon.Properties["icon"];

            if (string.IsNullOrEmpty(iconName))
            {
                return;
            }
            var icon = WinFormsResourceService.GetIcon(iconName.ToLower());

            if (icon == null)
            {
                return;
            }
            barItem.LargeImage = icon.ToBitmap();
            barItem.SmallImage = icon.ToBitmap();
        }
Beispiel #13
0
        public void InitData(string objectTypeName)
        {
            treeList1.FocusedNodeChanged -= treeList1_FocusedNodeChanged;
            treeList1.Nodes.Clear();
            ImageList columnImageList = new ImageList();

            columnImageList.Images.Add(WinFormsResourceService.GetIcon("all").ToBitmap());
            columnImageList.Images.SetKeyName(0, string.Empty);
            treeList1.SelectImageList = columnImageList;

            var root = treeList1.AppendNode(new object[] { ResourceService.GetString("All"), string.Empty, 0 }, null);

            root.SetValue(colFilters, string.Empty);
            IObjectSpace objectSpace = new ODataObjectSpace();

            var notificationQuery = (List <NotificationDTO>)AuthorizationManager.NotificationList.List;
            var objectTypes       = notificationQuery.Select(c => c.ObjectTypeEn).Distinct().ToList();

            if (objectTypes.Contains("sysMsg"))
            {
                objectTypes.Remove("sysMsg");
                objectTypes.Insert(0, "sysMsg");
            }

            int           imageIndex = 1;
            List <string> noteType   = new List <string>();

            foreach (var item in objectTypes)
            {
                columnImageList.Images.Add(WinFormsResourceService.GetIcon(item.ToLower()).ToBitmap());
                columnImageList.Images.SetKeyName(imageIndex, string.Empty);
                int ncount = notificationQuery.Where(c => c.ObjectTypeEn == item && c.NotificationStatus == 1).Count();
                var node   = treeList1.AppendNode(new object[] { ResourceService.GetString(item) + "(" + ncount + ")", string.Empty, string.Empty, imageIndex }, root);
                if (item == objectTypeName)
                {
                    node.Selected = true;
                }
                node.SetValue(colFilters, "[ObjectTypeEn] = '" + item + "'");
                node.SetValue(colNodeName, item);
                imageIndex++;
            }
            treeList1.ExpandAll();
            treeList1.FocusedNodeChanged += treeList1_FocusedNodeChanged;
        }
        private void SetItemGlyph(ICSharpCode.Core.Codon codon)
        {
            string       imageName     = codon.Properties["imageName"];
            string       overlayName   = codon.Properties["overlay"];
            PropertyInfo objectNamePro = _caller.GetType().GetProperty("ObjectName");

            if (objectNamePro != null)
            {
                _objectName = objectNamePro.GetValue(_caller, null) as string;
            }
            if (string.IsNullOrEmpty(imageName))
            {
                imageName = _objectName;
            }

            if (string.IsNullOrEmpty(imageName))
            {
                return;
            }
            var icon = WinFormsResourceService.GetIcon(imageName.ToLower());

            if (icon == null)
            {
                return;
            }
            Image largeImage = icon.ToBitmap();


            if (!string.IsNullOrEmpty(overlayName))
            {
                var overlay = WinFormsResourceService.GetBitmap(overlayName.ToLower());
                if (overlay != null)
                {
                    DrawOverlay(largeImage, overlay);
                }
            }
            LargeGlyph = largeImage;
            Glyph      = new Bitmap(largeImage, new Size(16, 16));
        }
Beispiel #15
0
        public DefaultWorkbench()
        {
            Text = "SharpDevelop UI";
            Icon = WinFormsResourceService.GetIcon("Icons.SharpDevelopIcon");

            StartPosition = FormStartPosition.Manual;
            _NormalBounds = PropertyService.Get <Rectangle>(_BoundProperty, new Rectangle(60, 80, 640, 480));
            Bounds        = _NormalBounds;
            bool bMax = PropertyService.Get <bool>(_WindowIsMaximized, false);

            if (bMax)
            {
                _WindowState = FormWindowState.Maximized;
                WindowState  = FormWindowState.Maximized;
            }
            _FullScreen = PropertyService.Get <bool>(_WindowIsFullScreen, false);
            if (_FullScreen)
            {
                FormBorderStyle = FormBorderStyle.None;
                WindowState     = FormWindowState.Maximized;
            }

            AllowDrop = true;

            PadDescriptor.BringPadToFrontEvent += delegate(PadDescriptor padDesc)
            {
                foreach (PadDescriptor pd in PadContentCollection)
                {
                    if (pd.Equals(padDesc))
                    {
                        layout.ShowPad(padDesc, true);
                        return;
                    }
                    ShowPad(padDesc);
                }
            };
        }
Beispiel #16
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);
        }
Beispiel #17
0
        private void InitApplicationButton()
        {
            string notificationPath = "/Notification/StartNotification";

            if (AddInTree.ExistsTreeNode(notificationPath))
            {
                var descriptor = AddInTree.BuildItems <IReceiveNotification>(notificationPath, null);
                if (descriptor != null && descriptor.Count() > 0)
                {
                    descriptor.First().StartReceiveNotification(this);
                }
            }

            //send sys msg
            var sysMsgItem = new BarButtonItem();

            sysMsgItem.Caption = StringParser.Parse("SendSysMessage");
            sysMsgItem.Glyph   = (Bitmap)WinFormsResourceService.GetIcon("notification1").ToBitmap();
            Ribbon.Items.Add(sysMsgItem);
            sysMsgItem.ItemClick += (s, e) =>
            {
                var parameters = new ActionParameters(string.Empty, Guid.Empty, ViewShowType.Show);
                _application.Invoke("NotificationDetail", "NotificationAction", parameters);
            };

            //??CLEAR SET
            var clearSettingButton = new BarButtonItem();

            clearSettingButton.Caption = StringParser.Parse("ClearSetting");
            clearSettingButton.Glyph   = (Bitmap)WinFormsResourceService.GetBitmap("clear");

            Ribbon.Items.Add(clearSettingButton);
            clearSettingButton.ItemClick += delegate
            {
                string message = StringParser.Parse("ClearSettingConfirm");
                var    result  = XtraMessageBox.Show(message, StringParser.Parse("Katrin"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.OK)
                {
                    //restore default layout.
                    var oldParameter = PropertyService.Get <UserLoginParameter>("Document.ParameterSettingName", null);
                    this._application.ViewManager.RestoreAllViewDefaultLayout();
                    PropertyService.Clean();
                    PropertyService.Set <UserLoginParameter>("Document.ParameterSettingName", oldParameter);
                    PropertyService.Save();
                }
            };

            //set language
            BarSubItem languageSettingButton = new BarSubItem();

            languageSettingButton.Caption = StringParser.Parse("languageSetting");
            languageSettingButton.Glyph   = WinFormsResourceService.GetIcon("edit").ToBitmap();
            Ribbon.Items.Add(languageSettingButton);

            //CMP Lista de Lenguajes Hardcodeado
            List <string> languages = new List <string>();

            languages.Add("zh-CN");
            languages.Add("en-US");
            languages.Add("es-ES");

            foreach (string language in languages)
            {
                BarButtonItem itemLanguage = new BarButtonItem();
                itemLanguage.Caption    = StringParser.Parse(language);
                itemLanguage.ItemClick += itemZh_ItemClick;
                languageSettingButton.ItemLinks.Add(itemLanguage);
                itemLanguage.Tag = language;
                Ribbon.Items.Add(itemLanguage);
            }
            pmAppMain.ItemLinks.AddRange(new BarItem[] { sysMsgItem, clearSettingButton, languageSettingButton });
        }
 public Icon GetResourceServiceIcon(string resourceName)
 {
     return(WinFormsResourceService.GetIcon(resourceName));
 }