예제 #1
0
        ////shows context menu for program item
        /// <summary>
        /// </summary>
        /// <param name="location"></param>
        /// <param name="fileDescr"></param>
        private void ShowPopupMenu(Point location, FileDescr fileDescr)
        {
            var mainMenu = new ContextMenu();

            var menuPinProgram = new MenuItem { Text = _str_pinToStart.Localize() };
            menuPinProgram.Click += (s, e) => PinProgram(fileDescr);
            mainMenu.MenuItems.Add(menuPinProgram);

            if (ParentControl != null)
                mainMenu.Show(ParentControl, location);
        }
예제 #2
0
        /// <summary>
        /// pin selected item to start menu
        /// </summary>
        /// <param name="fileDescr"></param>
        private void PinProgram(FileDescr fileDescr)
        {
            var messenger = TinyIoCContainer.Current.Resolve<ITinyMessengerHub>();

            messenger.Publish(new PinProgramMessage { Name = fileDescr.Name, Path = fileDescr.Path} );
        }