示例#1
0
        private void editControl1_MenuFill(object sender, System.EventArgs e)
        {
            ContextMenuManager contextMenu = (ContextMenuManager)sender;

            // Add a separator
            contextMenu.AddSeparator();

            // Add custom custom context menu items and their Click eventhandlers
            contextMenu.AddMenuItem("Launch Configuration Editor", new EventHandler(ConfigurationEditorLaunch));
            contextMenu.AddMenuItem("Launch Configuration Display Utility", new EventHandler(ConfigurationDisplayLaunch));
        }
示例#2
0
        /// <summary>
        /// Creates a new instance of <c>RadContextMenu with default style value</c>
        /// </summary>
        /// <returns>The created RadContextMenu </returns>
        public static ContextMenuManager CreateNewContextMenuWithDefaults()
        {
            var contextMenu = new ContextMenuManager
            {
                ContextMenu = new XamContextMenu
                {
                    FontStyle = FontStyles.Normal,
                    FontSize  = SystemFonts.MessageFontSize
                }
            };

            return(contextMenu);
        }
示例#3
0
        /// <summary>
        ///     Removes the attached context menu from the grid
        /// </summary>
        void DetachContextMenu()
        {
            if (_contextMenuMgr != null)
            {
                if (_contextMenuMgr.ContextMenu != null)
                {
                    _contextMenuMgr.ContextMenu.Opening -= ContextMenuOpening;
                }

                ContextMenuService.SetManager(Grid, null);
            }

            _contextMenuMgr = null;
        }
示例#4
0
文件: fMain.cs 项目: stlcours/FTPbox
        private void chkShellMenus_CheckedChanged(object sender, EventArgs e)
        {
            Settings.General.AddContextMenu = chkShellMenus.Checked;
            Settings.SaveGeneral();

            if (chkShellMenus.Checked)
            {
                ContextMenuManager.AddContextMenu();
            }
            else
            {
                ContextMenuManager.RemoveContextMenu();
            }
        }
示例#5
0
        /// <summary>
        ///     Sets up and attached the context menu to the grid
        /// </summary>
        void AttachContextMenu()
        {
            //create a ContextMenuManager if we need to
            if (_contextMenuMgr == null)
            {
                _contextMenuMgr                      = new ContextMenuManager();
                _contextMenuMgr.ContextMenu          = ContextMenu;
                _contextMenuMgr.ContextMenu.Opening += ContextMenuOpening;
                _contextMenuMgr.ModifierKeys         = ModifierKeys.None;
                _contextMenuMgr.OpenMode             = OpenMode.RightClick;

                ContextMenuService.SetManager(Grid, _contextMenuMgr);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            // ExStart:HideContextMenuItem
            // Get the ContextMenuManager
            ContextMenuManager cmm = this.grdDataEntry.ContextMenuManager;

            // Hide the Copy option in the context menu
            cmm.MenuItemAvailable_Copy = false;

            // Hide the InsertRow option in the context menu
            cmm.MenuItemAvailable_InsertRow = false;

            // Hide the Format Cell dialog box
            cmm.MenuItemAvailable_FormatCells = false;
            // ExEnd:HideContextMenuItem
        }
示例#7
0
        private void SetupMenu()
        {
            _menuManager = new ContextMenuManager <ChadderMessage>(this, _listView);

            _menuManager.InsertItem("ConversationMessageDelete".t(),
                                    async(ChadderMessage msg) => await ChadderUI.DeleteMessage(msg, _conversation));

            _menuManager.InsertItem("ConversationMessageDeleteRemote".t(),
                                    async(ChadderMessage msg) => await ChadderUI.TakeBack(msg, _conversation),
                                    msg => msg.MyMessage == true && (msg.Status == ChadderMessage.MESSAGE_STATUS.SENT));

            _menuManager.InsertItem("ConversationMessageCopy".t(), (ChadderMessage msg) =>
            {
                ClipboardManager clipboard = (ClipboardManager)Activity.GetSystemService(Context.ClipboardService);
                ClipData clip         = ClipData.NewPlainText("Chadder Message", msg.Body);
                clipboard.PrimaryClip = clip;
                DisplayToast("Copied");
            }, msg => msg.Type == ChadderMessage.MESSAGE_TYPE.TEXT);
        }
        private void SetupMenu()
        {
            _menuManager = new ContextMenuManager <ChadderUserDevice>(this, grid);

            _menuManager.InsertItem("Rename", (ChadderUserDevice device) =>
            {
                ChadderUI.ChangeDeviceName(device);
            });


            _menuManager.InsertItem(GetString(Resource.String.DevicePair), (ChadderUserDevice device) =>
            {
                ChadderUI.PairDevice(device);
            }, (d) => ChadderUI.Source.HasUserKey && d.HasUserKey == false);

            _menuManager.InsertItem("Delete", (ChadderUserDevice device) =>
            {
                ChadderUI.DeleteDevice(device);
            }, (d) => d.CurrentDevice == false);
        }
示例#9
0
文件: fMain.cs 项目: stlcours/FTPbox
        /// <summary>
        ///     Kills the current process. Called from the tray menu.
        /// </summary>
        public void KillTheProcess()
        {
            if (!Settings.IsNoMenusMode)
            {
                ContextMenuManager.RemoveContextMenu();
            }

            ExitedFromTray = true;
            Log.Write(l.Info, "Killing the process...");

            try
            {
                tray.Visible = false;
                Process.GetCurrentProcess().Kill();
            }
            catch
            {
                Application.Exit();
            }
        }
示例#10
0
        public virtual void Process()
        {
            // Fires lifetime events: Exit, Become visible, config changed.
            LifecycleObserver.Initialize();

            // Register settings in global AdvancedSettings dialog
            TrayPluginSettingsManager.Initialize();

            // Here we define behavior. It subscribes to different events and perform necessary actions (e.g. application exit).
            AppBehaviorManager.Initialize();

            // Subscribes to OnVisible event to patch main window properties.
            WindowWorks.Initialize();

            // Provides context menu, visible thorough the Notify Icon
            ContextMenuManager.Initialize();

            // Adds Notify Icon
            IconManager.Initialize();
        }
示例#11
0
        public IAsyncContextMenu ShowContextMenu(string header, bool async, params ContextMenuItem[] contextMenuItems)
        {
            var         contextMenuManager = new ContextMenuManager(UiResourceProvider.Instance);
            ContextMenu contextMenu        = contextMenuManager.CreateContextMenu(header, contextMenuItems);
            var         caretPosition      = VsUtils.GetCaretPosition(IdeScope.ServiceProvider);

            if (caretPosition != null)
            {
                Logger.LogVerbose($"Caret screen position: {caretPosition.Value.X}:{caretPosition.Value.Y}");
                contextMenuManager.ShowContextMenu(contextMenu, caretPosition.Value);
            }
            else
            {
                contextMenuManager.ShowContextMenu(contextMenu);
            }
            if (async)
            {
                return(new AsyncContextMenu(contextMenu, IdeScope, contextMenuManager));
            }
            return(null);
        }
示例#12
0
        /// <summary>
        /// NotifyIconWrapper クラス を生成、初期化します。
        /// </summary>
        public NotifyIconWrapper()
        {
            // コンポーネントの初期化
            this.InitializeComponent();

            // コンテキストメニューのイベントを設定
            this.toolStripMenuItem_Open.Click += this.toolStripMenuItem_Open_Click;
            this.toolStripMenuItem_Exit.Click += this.toolStripMenuItem_Exit_Click;
            SystemEvents.SessionEnding        += new SessionEndingEventHandler(SystemEvents_SessionEnding);
            SystemEvents.PowerModeChanged     += SystemEvents_PowerModeChanged;

            RefreshBridge.RefreshEvent += RefreshBridge_RefreshEvent;

            EnableManagers.Add(KukuluManager.GetInstance());
            EnableManagers.Add(CavetubeManager.GetInstance());
            EnableManagers.Add(Fc2Manager.GetInstance());
            EnableManagers.Add(TwitchManager.GetInstance());

            BalloonManager     = new BalloonManager(myNotifyIcon);
            ContextMenuManager = new ContextMenuManager(myContextMenuStrip);

            var t = RefreshNotifyIconAsync();   //警告を消すために変数に代入
        }
示例#13
0
        /// <summary>
        /// Initializes a new instance of the WebKitBrowser control.
        /// </summary>
        public WebKitBrowser()
        {
            InitializeComponent();

            CheckForIllegalCrossThreadCalls = false; // this will prevent exceptions that occur when you use the favicon event 
            
            PageSettings = new PageSettings();
            if (LicenseManager.UsageMode != LicenseUsageMode.Designtime)
            {
                LanguageLoader.Initialize();
                // Control Events
                this.Load += new EventHandler(WebKitBrowser_Load);
                this.Resize += new EventHandler(WebKitBrowser_Resize);
                // If this is the first time the library has been loaded,
                // initialize the activation context required to load the
                // WebKit COM component registration free
                if ((actCtxRefCount++) == 0)
                {
                    activationContext = new ActivationContext(GlobalPreferences.WebKitPath + "\\OpenWebKitSharp.manifest"); 
                    activationContext.Initialize();
                    // TODO: more error handling here
                    if (activationContext.Initialized != true)
                    {
                        return;
                    }
                    // Enable OLE for drag and drop functionality - WebKit
                    // will throw an OutOfMemory exception if we don't...
                    Application.OleRequired();
                }

                // If this control is brought to focus, focus our webkit child window
                this.GotFocus += (s, e) =>
                {
                    NativeMethods.SetFocus(webViewHWND);
                };
                activationContext.Activate();

                webView = new WebViewClass();

                contextmenumanager = new ContextMenuManager(this);
                Marshal.AddRef(Marshal.GetIUnknownForObject(contextmenumanager));
                
                activationContext.Deactivate();
            }
        }
 public MultiViewStub(CapabilitiesCollection globalCapabitities)
 {
     ContextManager = new ContextMenuManager(globalCapabitities);
 }
示例#15
0
 private void OnEnable()
 {
     activeShrine = null;
     activeDemon  = null;
     activeMenu   = null;
 }
示例#16
0
 public void SetActiveMenu(ContextMenuManager menu)
 {
     activeMenu = menu;
 }
示例#17
0
        private void xmlViewer_MenuFill(object sender, EventArgs e)
        {
            cm = (ContextMenuManager)sender;

            // To clear default context menu items.
            //cm.ClearMenu();

            // Add a separator.
            cm.AddSeparator();

            // Add custom context menu items and their Click eventhandlers.
            //cm.AddMenuItem("&Save To File", new EventHandler(onSaveToFile),false);
            //cm.AddMenuItem("&Save To Database", new EventHandler(onSaveToDatabase),false);

            // If you need to get access to the underlying menu provider you can access it using the below given code.
            //Syncfusion.Windows.Forms.IContextMenuProvider contextMenuProvider = this.editControl1.ContextMenuManager.ContextMenuProvider;
        }
示例#18
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.fragment_contact_list, container, false);

            try
            {
                _contactListView = view.FindViewById <Android.Widget.ListView>(Resource.Id.contact_list);

                searchText = view.FindViewById <EditText>(Resource.Id.contact_list_searchview);

                _noEntryText = view.FindViewById <TextView>(Resource.Id.no_friends_textview);
                _noEntryText.TextFormatted = Html.FromHtml("To add friends you can type their name in the search bar and if they have enabled </br>\"Public Name\" they will appear here");

                searchText.TextChanged += (s, e) =>
                {
                    _adapter.Collection.SetSearch(searchText.Text);
                };

                _adapter = new FindFriendAdapter(this.Activity, _noEntryText, new UIHelper.FindContactObservableCollection(ChadderApp.UIHelper.Source));
                _contactListView.Adapter    = _adapter;
                _contactListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
                {
                    var contact = _adapter[e.Position];
                    if (contact == null)
                    {
                        return;
                    }
                    if (contact.IsTemporary)
                    {
                        SupportFragmentManager.BeginTransaction()
                        .Replace(Resource.Id.content_frame, ViewProfileFragment.ViewProfile(contact))
                        .AddToBackStack(null)
                        .Commit();
                    }
                    else
                    {
                        SupportFragmentManager.PopBackStack();
                        SupportFragmentManager.BeginTransaction()
                        .Replace(Resource.Id.content_frame, ChatFragment.OpenChat(contact))
                        .AddToBackStack(null)
                        .Commit();
                    }
                };

                _menuManager = new ContextMenuManager <ChadderContact>(this, _contactListView);

                _menuManager.InsertItem("View profile", (ChadderContact contact) =>
                {
                    Android.Support.V4.App.FragmentTransaction transaction = this.Activity.SupportFragmentManager.BeginTransaction();
                    transaction.Replace(Resource.Id.content_frame, ViewProfileFragment.ViewProfile(contact));
                    transaction.AddToBackStack(null);
                    transaction.Commit();
                });

                _menuManager.InsertItem(c => c.Type == Chadder.Data.RelationshipType.BLOCKED ? "Unblock" : "Block",
                                        (ChadderContact contact) => ChadderUI.ToggleBlock(contact));

                _menuManager.InsertItem("Report",
                                        (ChadderContact contact) => ChadderUI.ReportContact(contact));
            }
            catch (Exception e)
            {
                Insight.Report(e);
            }

            return(view);
        }
示例#19
0
 public void setActionItem(GameObject crObj)
 {
     Creator            cr    = crObj.GetComponent <Creator>();
     GameObject         cmObj = cr.getMenuObject();
     ContextMenuManager cm    = cr.getMenuManager();
 }
示例#20
0
 private void Awake()
 {
     Debug.Assert(Instance == null, "ContextMenuManager instance already set.");
     Instance = this;
 }
示例#21
0
 private void InitializeContextMenu(ContextMenu contextMenu, ContextMenuManager manager)
 {
     manager.Fill(contextMenu, DataContext);
 }
示例#22
0
 void Awake()
 {
     Instance = this;
 }
        protected virtual void UpdateContextMenuForIcon()
        {
            ContextMenuStrip menuStrip = ContextMenuManager.GetContextMenu();

            this.ActualNotifyIcon.ContextMenuStrip = menuStrip;
        }
示例#24
0
文件: fMain.cs 项目: stlcours/FTPbox
        private async void fMain_Load(object sender, EventArgs e)
        {
            NetworkChange.NetworkAddressChanged += OnNetworkChange;

            //TODO: Should this stay?
            Program.Account.LoadLocalFolders();

            if (!Log.DebugEnabled && Settings.General.EnableLogging)
            {
                Log.DebugEnabled = true;
            }

            Notifications.NotificationReady += (o, n) =>
            {
                Link = Program.Account.LinkToRecent();
                tray.ShowBalloonTip(100, n.Title, n.Text, ToolTipIcon.Info);
            };

            Program.Account.WebInterface.UpdateFound += async(o, n) =>
            {
                const string msg = "A new version of the web interface is available, do you want to upgrade to it?";
                if (
                    MessageBox.Show(msg, "FTPbox - WebUI Update", MessageBoxButtons.YesNo, MessageBoxIcon.Information) ==
                    DialogResult.Yes)
                {
                    Program.Account.WebInterface.UpdatePending = true;
                    await Program.Account.WebInterface.Update();
                }
            };
            Program.Account.WebInterface.InterfaceRemoved += (o, n) =>
            {
                chkWebInt.Enabled        = true;
                labViewInBrowser.Enabled = false;
                Link = string.Empty;
            };
            Program.Account.WebInterface.InterfaceUploaded += (o, n) =>
            {
                chkWebInt.Enabled        = true;
                labViewInBrowser.Enabled = true;
                Link = Program.Account.WebInterfaceLink;
            };

            Notifications.TrayTextNotification += (o, n) => SetTray(o, n);

            _fSetup = new Setup {
                Tag = this
            };
            _ftranslate = new Translate {
                Tag = this
            };
            _fSelective = new fSelectiveSync();

            if (!string.IsNullOrEmpty(Settings.General.Language))
            {
                Set_Language(Settings.General.Language);
            }

            await StartUpWork();

            while (OfflineMode)
            {
                // wait 30 seconds before retrying to connect
                await Task.Delay(30000);

                // retry
                await StartUpWork();
            }

            _fTrayForm = new fTrayForm {
                Tag = this
            };

            CheckForUpdate();

            // Check local folder for changes
            var cpath = Program.Account.GetCommonPath(Program.Account.Paths.Local, true);
            await Program.Account.SyncQueue.Add(
                new SyncQueueItem(Program.Account)
            {
                Item       = new ClientItem(Common._name(cpath), Program.Account.Paths.Local, ClientItemType.Folder),
                ActionType = ChangeAction.changed,
                SyncTo     = SyncTo.Remote
            });

            await ContextMenuManager.RunServer();
        }