Esempio n. 1
0
        public ProjectNode(IProject project)
        {
            sortOrder = 1;

            this.ContextmenuAddinTreePath = "/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ProjectNode";
            this.project = project;

            Text           = project.Name;
            autoClearNodes = false;

            if (project is MissingProject)
            {
                OpenedImage = ClosedImage = "ProjectBrowser.MissingProject";
                this.ContextmenuAddinTreePath = "/SharpDevelop/Pads/ProjectBrowser/ContextMenu/MissingProjectNode";
            }
            else if (project is UnknownProject)
            {
                OpenedImage = ClosedImage = "ProjectBrowser.ProjectWarning";
                this.ContextmenuAddinTreePath = "/SharpDevelop/Pads/ProjectBrowser/ContextMenu/UnknownProjectNode";
            }
            else
            {
                OpenedImage = ClosedImage = IconService.GetImageForProjectType(project.Language);
            }
            Tag = project;

            if (project.ParentSolution != null)
            {
                project.ParentSolution.Preferences.StartupProjectChanged += OnStartupProjectChanged;
                OnStartupProjectChanged(null, null);
            }
        }
Esempio n. 2
0
    private string GeneratedTooltip(ApiModel current)
    {
        var iconUrl = IconService.GetIcon(current.Kind);

        var sb = new StringBuilder();

        sb.Append($"<img src=\"{iconUrl}\" heigth=\"16\" width=\"16\" /> ");

        var isFirst = true;

        foreach (var api in current.AncestorsAndSelf().Reverse())
        {
            if (isFirst)
            {
                isFirst = false;
            }
            else
            {
                sb.Append(".");
            }

            sb.Append(HtmlEncoder.Encode(api.Name));
        }

        return(sb.ToString());
    }
Esempio n. 3
0
 public void UpdateTrayIcon(bool noDevice = false, bool isMuted = false, int currentVolume = 100)
 {
     if (noDevice)
     {
         _trayIcon.Icon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.NoDevice);
         return;
     }
     if (isMuted)
     {
         _trayIcon.Icon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.Muted);
         return;
     }
     if (currentVolume == 0)
     {
         _trayIcon.Icon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerZeroBars);
         return;
     }
     if (currentVolume >= 1 && currentVolume <= 33)
     {
         _trayIcon.Icon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerOneBar);
         return;
     }
     if (currentVolume >= 34 && currentVolume <= 66)
     {
         _trayIcon.Icon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerTwoBars);
         return;
     }
     if (currentVolume >= 67 && currentVolume <= 100)
     {
         _trayIcon.Icon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerThreeBars);
         return;
     }
 }
Esempio n. 4
0
        public TrayIcon()
        {
            _trayIcon             = new System.Windows.Forms.NotifyIcon();
            _trayIcon.ContextMenu = new System.Windows.Forms.ContextMenu();
            _audioDeviceService   = new EarTrumpetAudioDeviceService();

            var aboutString = Properties.Resources.ContextMenuAboutTitle;
            var version     = Assembly.GetEntryAssembly().GetName().Version;

            var deviceSep = _trayIcon.ContextMenu.MenuItems.Add("-");

            deviceSep.Name = _deviceSeparatorName;

            var feedbackItem = _trayIcon.ContextMenu.MenuItems.Add(EarTrumpet.Properties.Resources.ContextMenuSendFeedback);

            feedbackItem.Click += Feedback_Click;

            var aboutItem = _trayIcon.ContextMenu.MenuItems.Add(String.Format("{0} Ear Trumpet {1} ...", aboutString, version));

            aboutItem.Click += About_Click;

            var exitItem = _trayIcon.ContextMenu.MenuItems.Add(EarTrumpet.Properties.Resources.ContextMenuExitTitle);

            exitItem.Click += Exit_Click;

            _trayIcon.MouseClick        += TrayIcon_MouseClick;
            _trayIcon.ContextMenu.Popup += ContextMenu_Popup;

            _trayIcon.Icon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerThreeBars);
            _trayIcon.Text = string.Concat("Ear Trumpet - ", EarTrumpet.Properties.Resources.TrayIconTooltipText);

            _trayIcon.Visible = true;
        }
Esempio n. 5
0
 public SearchFolderNode(string fileName)
 {
     drawDefault   = false;
     this.fileName = fileName;
     icon          = IconService.GetBitmap(IconService.GetImageForFile(fileName));
     Nodes.Add(new TreeNode());
 }
Esempio n. 6
0
        public ScrollBox()
        {
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            Image = IconService.GetBitmap("Icons.AboutImage");

            Font = WinFormsResourceService.LoadFont("Tahoma", 10);
            text = new string[] {
                "\"The most successful method of programming is to begin a program as simply as possible, test it, and then add to the program until it performs the required job.\"\n    -- PDP8 handbook, Pg 9-64",
                "\"The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every\n appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.\"\n    -- FORTRAN manual for Xerox computers",
                "\"No proper program contains an indication which as an operator-applied occurrence identifies an operator-defining occurrence which as an indication-applied occurrence identifies an indication-defining occurrence different from the one identified by the given indication as an indication- applied occurrence.\"\n   -- ALGOL 68 Report",
                "\"The '#pragma' command is specified in the ANSI standard to have an arbitrary implementation-defined effect. In the GNU C preprocessor, `#pragma' first attempts to run the game rogue; if that fails, it tries to run the game hack; if that fails, it tries to run GNU Emacs displaying the Tower of Hanoi; if that fails, it reports a fatal error. In any case, preprocessing does not continue.\"\n   --From an old GNU C Preprocessor document",
                "\"There are two ways of constructing a software design: one way is to make it so simple that there are obviously no deficiencies; the other is to make it so complicated that there are no obvious deficiencies.\"\n    -- C.A.R. Hoare",
                "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question.\"\n   -- Charles Babbage (1791-1871)"
            };

            // randomize the order in which the texts are displayed
            Random rnd = new Random();

            for (int i = 0; i < text.Length; i++)
            {
                Swap(ref text[i], ref text[rnd.Next(i, text.Length)]);
            }

            timer          = new Timer();
            timer.Interval = 40;
            timer.Tick    += new EventHandler(ScrollDown);
            timer.Start();
        }
Esempio n. 7
0
        public void TestIconServiceInit()
        {
            var provider    = GetMockProvider();
            var iconService = new IconService(provider.Object);

            Assert.NotNull(iconService);
        }
Esempio n. 8
0
        public AppContext(ILogger logger)
        {
            _logger      = logger;
            _iconService = new IconService(_logger);

            trayIcon = new NotifyIcon()
            {
                ContextMenuStrip = new ContextMenuStrip(new Container()),
                Visible          = true
            };

            if (!string.IsNullOrWhiteSpace(Constants.NightscoutUrl))
            {
                _logger.LogDebug("Nightscout url supplied, adding option to context menu.");

                var process = new Process();
                process.StartInfo.UseShellExecute = true;
                process.StartInfo.FileName        = Constants.NightscoutUrl;

                trayIcon.ContextMenuStrip.Items.Add(new ToolStripMenuItem("Nightscout", null, (obj, e) => process.Start()));
            }
            trayIcon.ContextMenuStrip.Items.Add(new ToolStripMenuItem(nameof(Exit), null, new EventHandler(Exit)));
            trayIcon.DoubleClick += ShowBalloon;
            BeginCycle();
        }
Esempio n. 9
0
        ///<summary>
        /// Create a SharpQueryTree objec
        ///</summary>
        public SharpQueryTree()
            : base()
        {
            this.pNodeImages                  = new ImageList();
            this.pNodeImages.ColorDepth       = System.Windows.Forms.ColorDepth.Depth24Bit;
            this.pNodeImages.ImageSize        = new System.Drawing.Size(16, 16);
            this.pNodeImages.TransparentColor = System.Drawing.Color.DarkCyan;

            this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.DataBaseRoot"));
            this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.DatabaseConnectionClose"));
            this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.DatabaseConnection"));
            this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.TablesRoot"));
            this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.ViewsRoot"));
            this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.ProceduresRoot"));
            this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Table"));
            this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.View"));
            this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Procedure"));
            this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Column"));
            this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.NodeError"));

            this.ImageList = this.pNodeImages;

            SchemaClassDict = new SharpQueryStringDictionary();

            LoadSharpQueryConnectionCodon();

            //Add the Root Node.
            this.Nodes.Add(new SharpQueryNodeDatabaseRoot());
        }
Esempio n. 10
0
        /// <summary>
        /// Creates an image list that will be used for the XmlTreeViewControl.
        /// </summary>
        void InitImages()
        {
            if (components == null)
            {
                components = new Container();
            }
            ImageList images = new ImageList(components);

            // Add xml element tree node images.
            Image xmlElementImage = Image.FromStream(typeof(XmlTreeViewContainerControl).Assembly.GetManifestResourceStream("ICSharpCode.XmlEditor.Resources.XmlElementTreeNodeIcon.png"));

            images.Images.Add(XmlElementTreeNode.XmlElementTreeNodeImageKey, xmlElementImage);
            images.Images.Add(XmlElementTreeNode.XmlElementTreeNodeGhostImageKey, IconService.GetGhostBitmap(new Bitmap(xmlElementImage)));

            // Add text tree node images.
            Image xmlTextImage = Image.FromStream(typeof(XmlTreeViewContainerControl).Assembly.GetManifestResourceStream("ICSharpCode.XmlEditor.Resources.XmlTextTreeNodeIcon.png"));

            images.Images.Add(XmlTextTreeNode.XmlTextTreeNodeImageKey, xmlTextImage);
            images.Images.Add(XmlTextTreeNode.XmlTextTreeNodeGhostImageKey, IconService.GetGhostBitmap(new Bitmap(xmlTextImage)));

            // Add comment tree node images.
            Image xmlCommentImage = Image.FromStream(typeof(XmlTreeViewContainerControl).Assembly.GetManifestResourceStream("ICSharpCode.XmlEditor.Resources.XmlCommentTreeNodeIcon.png"));

            images.Images.Add(XmlCommentTreeNode.XmlCommentTreeNodeImageKey, xmlCommentImage);
            images.Images.Add(XmlCommentTreeNode.XmlCommentTreeNodeGhostImageKey, IconService.GetGhostBitmap(new Bitmap(xmlCommentImage)));

            xmlElementTreeView.ImageList = images;
        }
Esempio n. 11
0
        public void LoadIconPack(ContentType saveType)
        {
            IconService.IconPack iconPack;
            switch (saveType)
            {
            case ContentType.Unload:
                return;

            case ContentType.KingdomHearts:
            case ContentType.KingdomHearts2:
            case ContentType.KingdomHeartsRecom:
            case ContentType.KingdomHearts02:
            case ContentType.KingdomHearts3:
                iconPack = IconService.IconPack.KingdomHearts2;
                break;

            case ContentType.FinalFantasy7Remake:
                iconPack = IconService.IconPack.FF7Remake;
                break;

            default: throw new Exception($"IconPack for {saveType} not yet implemented.");
            }

            IconService.UseIconPack(iconPack);
        }
Esempio n. 12
0
 public EquipmentModel(
     Presets.IItem item, int baseId, string iconType)
 {
     Value = (ushort)(item.Id | baseId);
     Name  = item.Name;
     Icon  = IconService.Icon(iconType);
 }
Esempio n. 13
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;
        }
Esempio n. 14
0
        public async Task TestSendIcxTransaction()
        {
            var provider    = GetMockProvider <Bytes>();
            var fromAddress = new Address("hxbe258ceb872e08851f1f59694dac2558708ece11");
            var toAddress   = new Address("hx5bfdb090f43a808005ffc27c25b213145e80b7cd");

            var transaction = TransactionBuilder.CreateBuilder()
                              .Nid(NetworkId.Main)
                              .From(fromAddress)
                              .To(toAddress)
                              .Value(BigInteger.Parse("0de0b6b3a7640000", NumberStyles.AllowHexSpecifier))
                              .StepLimit(BigInteger.Parse("012345", NumberStyles.AllowHexSpecifier))
                              .Timestamp(BigInteger.Parse("0563a6cf330136", NumberStyles.AllowHexSpecifier))
                              .Nonce(BigInteger.Parse("1"))
                              .Build();
            IWallet wallet            = KeyWallet.Load(new Bytes(SampleKeys.PrivateKeyString));
            var     signedTransaction = new SignedTransaction(transaction, wallet);

            var iconService = new IconService(provider.Object);
            await iconService.SendTransaction(signedTransaction);

            var expected = "xR6wKs+IA+7E91bT8966jFKlK5mayutXCvayuSMCrx9KB7670CsWa0B7LQzgsxU0GLXaovlAT2MLs1XuDiSaZQE=";

            provider.Verify(x =>
                            x.SendRequestAsync(It.Is <Request>(request => RequestCheckTestSendIcxTransaction(request, expected)),
                                               It.IsAny <IRpcConverter <Bytes> >()), Times.Once);
        }
Esempio n. 15
0
        public async Task TestQuery()
        {
            var provider = GetMockProvider <PersonResponse>();

            var iconService = new IconService(provider.Object);

            iconService.AddConverterFactory <PersonResponse>(new TestQueryRpcConverterFactory());

            var person = new Person
            {
                Name          = "gold bug",
                Age           = BigInteger.Parse("20"),
                HasPermission = false
            };

            var call = new Call.Builder()
                       .From(new Address("hxbe258ceb872e08851f1f59694dac2558708ece11"))
                       .To(new Address("cx5bfdb090f43a808005ffc27c25b213145e80b7cd"))
                       .Method("addUser")
                       .Params(person)
                       .BuildWith <PersonResponse>();

            // ReSharper disable once UnusedVariable
            var query = await iconService.CallAsync(call);

            provider.Verify(x =>
                            x.SendRequestAsync(It.Is <Request>(request => TestQueryRequestCheck(request, person)),
                                               It.IsAny <IRpcConverter <PersonResponse> >()), Times.Once);
        }
Esempio n. 16
0
        void SetIcon()
        {
            switch (fileNodeStatus)
            {
            case FileNodeStatus.None:
                SetIcon("ProjectBrowser.GhostFile");
                break;

            case FileNodeStatus.InProject:
                if (IsLink)
                {
                    SetIcon("ProjectBrowser.CodeBehind");
                }
                else
                {
                    SetIcon(IconService.GetImageForFile(FileName));
                }
                break;

            case FileNodeStatus.Missing:
                SetIcon("ProjectBrowser.MissingFile");
                break;

            case FileNodeStatus.BehindFile:
                SetIcon("ProjectBrowser.CodeBehind");
                break;
            }
        }
Esempio n. 17
0
        [ValidateSearcher] // if searcher name valid, then sets routeData value 'searcher'
        public IHttpActionResult GetViewDataForSearcher([FromUri] string searcherName)
        {
            var viewData = new SearcherViewData();

            var searcher = (BaseSearchProvider)this.RequestContext.RouteData.Values["searcher"]; //ExamineManager.Instance.SearchProviderCollection[searcherName];

            viewData.SearcherName        = searcher.Name;
            viewData.SearcherDescription = searcher.Description;
            viewData.SearcherType        = searcher is LookSearcher ? "Look" : "Examine";
            viewData.Icon = IconService.GetSearcherIcon(searcher);
            viewData.LookIndexingEnabled  = searcher is LookSearcher || LookConfiguration.ExamineIndexers.Contains(searcher.Name.TrimEnd("Searcher") + "Indexer");
            viewData.NameIndexerIsSet     = viewData.LookIndexingEnabled && LookConfiguration.NameIndexerIsSet;
            viewData.DateIndexerIsSet     = viewData.LookIndexingEnabled && LookConfiguration.DateIndexerIsSet;
            viewData.TextIndexerIsSet     = viewData.LookIndexingEnabled && LookConfiguration.TextIndexerIsSet;
            viewData.TagIndexerIsSet      = viewData.LookIndexingEnabled && LookConfiguration.TagIndexerIsSet;
            viewData.LocationIndexerIsSet = viewData.LookIndexingEnabled && LookConfiguration.LocationIndexerIsSet;

            // TODO:
            //number of documents in index
            //fields in index
            //text analyzer
            //lucene index folder

            return(this.Ok(viewData));
        }
Esempio n. 18
0
 public BookmarkFolderNode(string fileName)
 {
     drawDefault   = false;
     this.fileName = fileName;
     fileNameText  = Path.GetFileName(fileName) + StringParser.Parse(" ${res:MainWindow.Windows.SearchResultPanel.In} ") + Path.GetDirectoryName(fileName);
     icon          = IconService.GetBitmap(IconService.GetImageForFile(fileName));
     Nodes.Add(new TreeNode());
 }
Esempio n. 19
0
        public ProjectNode(IProject project) : base(project)
        {
            sortOrder = 0;

            Text = Project.Name;
            SetIcon(IconService.GetImageForProjectType(Project.Language));
            Nodes.Add(new TreeNode(StringParser.Parse("${res:ICSharpCode.SharpDevelop.Gui.Pads.ClassScout.LoadingNode}")));
        }
Esempio n. 20
0
 public HomeSettingsViewModel(IChatState chatState, IAutomateThings automationService, IconService iconService,
     ICharacterManager characterManager)
     : base(chatState)
 {
     automation = automationService;
     this.iconService = iconService;
     this.characterManager = characterManager;
 }
        protected virtual void InitializeView()
        {
            ImageList smalllist = new ImageList();
            ImageList imglist   = new ImageList();

            smalllist.ColorDepth = ColorDepth.Depth32Bit;
            imglist.ColorDepth   = ColorDepth.Depth32Bit;
            imglist.ImageSize    = new Size(32, 32);
            smalllist.ImageSize  = new Size(16, 16);

            smalllist.Images.Add(WinFormsResourceService.GetBitmap("Icons.32x32.EmptyProjectIcon"));

            imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.32x32.EmptyProjectIcon"));

            // load the icons and set their index from the image list in the hashtable
            int i = 0;
            Dictionary <string, int> tmp = new Dictionary <string, int>(icons);

            foreach (KeyValuePair <string, int> entry in icons)
            {
                Bitmap bitmap = IconService.GetBitmap(entry.Key);
                if (bitmap != null)
                {
                    smalllist.Images.Add(bitmap);
                    imglist.Images.Add(bitmap);
                    tmp[entry.Key] = ++i;
                }
                else
                {
                    LoggingService.Warn("NewProjectDialog: can't load bitmap " + entry.Key.ToString() + " using default");
                }
            }

            // set the correct imageindex for all templates
            icons = tmp;
            foreach (TemplateItem item in alltemplates)
            {
                if (item.Template.Icon == null)
                {
                    item.ImageIndex = 0;
                }
                else
                {
                    item.ImageIndex = icons[item.Template.Icon];
                }
            }

            templateListView.LargeImageList = imglist;
            templateListView.SmallImageList = smalllist;

            InsertCategories(null, categories);
            categoryTreeView.TreeViewNodeSorter = new TemplateCategoryComparer();
            categoryTreeView.Sort();
            string initialSelectedCategory = StringParser.Parse("C#\\${res:Templates.File.Categories.WindowsApplications}");

            TreeViewHelper.ApplyViewStateString(PropertyService.Get("Dialogs.NewProjectDialog.CategoryTreeState", ""), categoryTreeView);
            categoryTreeView.SelectedNode = TreeViewHelper.GetNodeByPath(categoryTreeView, PropertyService.Get("Dialogs.NewProjectDialog.LastSelectedCategory", initialSelectedCategory));
        }
Esempio n. 22
0
        ///<summary>create a default tabitem : a pointer icon with an empty toolboxitem</summary>
        public WpfSideTabItem() : base("Pointer")
        {
            CanBeRenamed = false;
            CanBeDeleted = false;
            Bitmap pointerBitmap = new Bitmap(IconService.GetBitmap("Icons.16x16.FormsDesigner.PointerIcon"), 16, 16);

            this.Icon = pointerBitmap;
            this.Tag  = null;
        }
        private void PopulateCombo()
        {
            IconService service = (IconService)ServiceManager.GetService(typeof(IconService));
            Combine     cmb     = IdeApp.ProjectOperations.CurrentOpenCombine;

            if (cmb != null)
            {
                CombineEntry selected   = IdeApp.ProjectOperations.CurrentSelectedCombineEntry;
                TreeIter     activeIter = TreeIter.Zero;

                foreach (Project proj in cmb.Entries)
                {
                    Gdk.Pixbuf pixbuf = null;

                    if (proj is DotNetProject && (proj as DotNetProject).LanguageBinding == null)
                    {
                        pixbuf = MonoDevelop.Core.Gui.Services.Resources.GetIcon(Stock.DialogError);
                    }
                    else
                    {
                        string icon = service.GetImageForProjectType(proj.ProjectType);
                        pixbuf = MonoDevelop.Core.Gui.Services.Resources.GetIcon(icon);
                    }

                    TreeIter iter = store.AppendValues(pixbuf, "<b>" + proj.Name + "</b>", proj, null);

                    foreach (ProjectFile file in proj.ProjectFiles)
                    {
                        if (file.Subtype != Subtype.Directory)
                        {
                            continue;
                        }

                        pixbuf = MonoDevelop.Core.Gui.Services.Resources.GetIcon(Stock.Directory);
                        store.AppendValues(iter, pixbuf, file.Name, proj, file);
                    }

                    if (proj == selected)
                    {
                        activeIter = iter;
                    }
                }

                if (activeIter.Equals(TreeIter.Zero))
                {
                    if (store.GetIterFirst(out activeIter))
                    {
                        this.SetActiveIter(activeIter);
                    }
                }
                else
                {
                    this.SetActiveIter(activeIter);
                }
            }
        }
Esempio n. 24
0
        void InitializeView()
        {
            ImageList smalllist = new ImageList();
            ImageList imglist   = new ImageList();

            smalllist.ColorDepth = ColorDepth.Depth32Bit;
            imglist.ColorDepth   = ColorDepth.Depth32Bit;

            imglist.ImageSize   = new Size(32, 32);
            smalllist.ImageSize = new Size(16, 16);

            smalllist.Images.Add(IconService.GetBitmap("Icons.32x32.EmptyFileIcon"));
            imglist.Images.Add(IconService.GetBitmap("Icons.32x32.EmptyFileIcon"));

            int       i   = 0;
            Hashtable tmp = new Hashtable(icons);

            foreach (DictionaryEntry entry in icons)
            {
                Bitmap bitmap = IconService.GetBitmap(entry.Key.ToString());
                if (bitmap != null)
                {
                    smalllist.Images.Add(bitmap);
                    imglist.Images.Add(bitmap);
                    tmp[entry.Key] = ++i;
                }
                else
                {
                    LoggingService.Warn("NewFileDialog: can't load bitmap " + entry.Key.ToString() + " using default");
                }
            }

            icons = tmp;
            foreach (TemplateItem item in alltemplates)
            {
                if (item.Template.Icon == null)
                {
                    item.ImageIndex = 0;
                }
                else
                {
                    item.ImageIndex = (int)icons[item.Template.Icon];
                }
            }

            templateListView.LargeImageList = imglist;
            templateListView.SmallImageList = smalllist;

            InsertCategories(null, categories);

            categoryTreeView.TreeViewNodeSorter = new TemplateCategoryComparer();
            categoryTreeView.Sort();

            TreeViewHelper.ApplyViewStateString(PropertyService.Get("Dialogs.NewFileDialog.CategoryViewState", ""), categoryTreeView);
            categoryTreeView.SelectedNode = TreeViewHelper.GetNodeByPath(categoryTreeView, PropertyService.Get("Dialogs.NewFileDialog.LastSelectedCategory", "C#"));
        }
        ///<summary>create a default tabitem : a pointer icon with an empty toolboxitem</summary>
        public SideTabItemDesigner() : base("Pointer")
        {
            CanBeRenamed = false;
            CanBeDeleted = false;
            var pointerBitmap = new Bitmap(IconService.GetBitmap("Icons.16x16.FormsDesigner.PointerIcon"), 16, 16);

            this.Icon = pointerBitmap;
            this.Tag  = null;
            ReloadToolBox();
        }
Esempio n. 26
0
        protected virtual void InitializeView()
        {
            ImageList smalllist = new ImageList();
            ImageList imglist   = new ImageList();

            smalllist.ColorDepth = ColorDepth.Depth32Bit;
            imglist.ColorDepth   = ColorDepth.Depth32Bit;
            imglist.ImageSize    = new Size(32, 32);
            smalllist.ImageSize  = new Size(16, 16);

            smalllist.Images.Add(ResourceService.GetBitmap("Icons.32x32.EmptyProjectIcon"));

            imglist.Images.Add(ResourceService.GetBitmap("Icons.32x32.EmptyProjectIcon"));

            // load the icons and set their index from the image list in the hashtable
            int i = 0;
            Dictionary <string, int> tmp = new Dictionary <string, int>(icons);

            foreach (KeyValuePair <string, int> entry in icons)
            {
                Bitmap bitmap = IconService.GetBitmap(entry.Key);
                if (bitmap != null)
                {
                    smalllist.Images.Add(bitmap);
                    imglist.Images.Add(bitmap);
                    tmp[entry.Key] = ++i;
                }
                else
                {
                    LoggingService.Warn("NewProjectDialog: can't load bitmap " + entry.Key.ToString() + " using default");
                }
            }

            // set the correct imageindex for all templates
            icons = tmp;
            foreach (TemplateItem item in alltemplates)
            {
                if (item.Template.Icon == null)
                {
                    item.ImageIndex = 0;
                }
                else
                {
                    item.ImageIndex = icons[item.Template.Icon];
                }
            }

            ((ListView)ControlDictionary["templateListView"]).LargeImageList = imglist;
            ((ListView)ControlDictionary["templateListView"]).SmallImageList = smalllist;

            InsertCategories(null, categories);
            ((TreeView)ControlDictionary["categoryTreeView"]).TreeViewNodeSorter = new TemplateCategoryComparer();
            ((TreeView)ControlDictionary["categoryTreeView"]).Sort();
            SelectLastSelectedCategoryNode(((TreeView)ControlDictionary["categoryTreeView"]).Nodes, PropertyService.Get("Dialogs.NewProjectDialog.LastSelectedCategory", "C#"));
        }
Esempio n. 27
0
        private async Task LoadImage()
        {
            if (!isImage)
            {
                return;
            }

            var xdoc = await IconService.GetVectorGraphicTemplateAsync(DetermineIconType());

            svgImage = (MarkupString)xdoc.ToString();
        }
Esempio n. 28
0
        private async void HandleValidSubmitAsync()
        {
            Expense.DateAdded = DateTime.UtcNow;
            Expense.Icon      = IconService.GuessExpenseIcon(Expense.Name);

            await ExpenseService.CreateExpenseAsync(Expense);

            ToastService.ShowSuccess($"The '{ Expense.Name }' expense has been added successfully.", "Expense Added");

            NavigationManager.NavigateTo("expenses");
        }
 void SetIcon()
 {
     if (this.WorkbenchWindow != null)
     {
         System.Drawing.Icon icon = WinFormsResourceService.GetIcon(IconService.GetImageForFile(this.PrimaryFileName));
         if (icon != null)
         {
             this.WorkbenchWindow.Icon = icon;
         }
     }
 }
Esempio n. 30
0
        public IconServiceVCRTest(ITestOutputHelper testOutputHelper)
        {
            _testOutputHelper = testOutputHelper;
            //var pk1 = Environment.GetEnvironmentVariable("PK1");
            _scoreAddress = new Address("cxcc7ef86cdae93a89b6c08206a7962bcb9abb7bf4");
            var httpClient = new HttpClient();

            _iconService  = new IconService(new HttpProvider(httpClient, Url));
            _wallet       = KeyWallet.Load(new Bytes(PrivateKeyString));
            _secretWallet = null; //KeyWallet.Load(new Bytes(pk1));
        }
Esempio n. 31
0
        void InitializeComponents()
        {
            if (allowUntitledFiles)
            {
                SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.NewFileDialog.xfrm"));
            }
            else
            {
                SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.NewFileWithNameDialog.xfrm"));
                ControlDictionary["fileNameTextBox"].TextChanged += new EventHandler(FileNameChanged);
            }

            ImageList imglist = new ImageList();

            imglist.ColorDepth = ColorDepth.Depth32Bit;
            imglist.Images.Add(IconService.GetBitmap("Icons.16x16.OpenFolderBitmap"));
            imglist.Images.Add(IconService.GetBitmap("Icons.16x16.ClosedFolderBitmap"));

            templateListView = ((ListView)ControlDictionary["templateListView"]);
            categoryTreeView = ((TreeView)ControlDictionary["categoryTreeView"]);

            categoryTreeView.ImageList = imglist;

            categoryTreeView.AfterSelect    += new TreeViewEventHandler(CategoryChange);
            categoryTreeView.BeforeSelect   += new TreeViewCancelEventHandler(OnBeforeExpand);
            categoryTreeView.BeforeExpand   += new TreeViewCancelEventHandler(OnBeforeExpand);
            categoryTreeView.BeforeCollapse += new TreeViewCancelEventHandler(OnBeforeCollapse);

            templateListView.SelectedIndexChanged += new EventHandler(SelectedIndexChange);
            templateListView.DoubleClick          += new EventHandler(OpenEvent);

            ControlDictionary["openButton"].Click += new EventHandler(OpenEvent);

            ((RadioButton)ControlDictionary["largeIconsRadioButton"]).Checked         = PropertyService.Get("Dialogs.NewProjectDialog.LargeImages", true);
            ((RadioButton)ControlDictionary["largeIconsRadioButton"]).CheckedChanged += new EventHandler(CheckedChange);
            ((RadioButton)ControlDictionary["largeIconsRadioButton"]).FlatStyle       = FlatStyle.Standard;
            ((RadioButton)ControlDictionary["largeIconsRadioButton"]).Image           = IconService.GetBitmap("Icons.16x16.LargeIconsIcon");

            ((RadioButton)ControlDictionary["smallIconsRadioButton"]).Checked         = !PropertyService.Get("Dialogs.NewProjectDialog.LargeImages", true);
            ((RadioButton)ControlDictionary["smallIconsRadioButton"]).CheckedChanged += new EventHandler(CheckedChange);
            ((RadioButton)ControlDictionary["smallIconsRadioButton"]).FlatStyle       = FlatStyle.Standard;
            ((RadioButton)ControlDictionary["smallIconsRadioButton"]).Image           = IconService.GetBitmap("Icons.16x16.SmallIconsIcon");

            ToolTip tooltip = new ToolTip();

            tooltip.SetToolTip(ControlDictionary["largeIconsRadioButton"], StringParser.Parse("${res:Global.LargeIconToolTip}"));
            tooltip.SetToolTip(ControlDictionary["smallIconsRadioButton"], StringParser.Parse("${res:Global.SmallIconToolTip}"));
            tooltip.Active = true;
            Owner          = WorkbenchSingleton.MainForm;
            StartPosition  = FormStartPosition.CenterParent;
            Icon           = null;

            CheckedChange(this, EventArgs.Empty);
        }