Visual studio and VS Code shortcuts side by side, Daily useful command
Below is useful list keyboard short cuts of
Visual Studio and VS Code, which I am using in my daily work J
Visual Studio |
Visual Studio Code |
Description |
Ctrl + , |
Ctrl + P |
Navigation or go
to File |
Ctrl + K + D |
Shift + Alt + F |
Format Code |
Ctrl + X |
Ctrl + X |
to remove a line |
|
Ctrl + ` |
toggle terminal |
Ctrl + F5 |
|
Run/Start without
debug To reflect new
changes just build and refresh browser |
Ctrl + Shift + B |
|
Build |
|
|
|
How to debug Angular app in Visual Studio Code
To debug Angular app into Visual Studio Code Please flow below step:
Note: These are only one time activity
Lets start your Code Editor
Step 1 - Goto Extension options OR Press - Ctrl + Shift + X
Step 2 - Type on Search - "Debugger for Chrome"
Step 4 - Now Press F5 and Select Chrome from option list
"url": "http://localhost:4200"
That's it. you are ready to debug your angular app.
Remember run your app with ng serve command.
Hide Default Context menu from CefSharp Chromium Web Browser
To hide Default Context menu you need implement IContextMenuHandler.
Add below class into your project
public class MenuHandler : CefSharp.IContextMenuHandler
{
public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
{
model.Clear();
}
public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
{
return false;
}
public void OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame)
{
}
public bool RunContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)
{
return false;
}
}
Use MenuHandler into browser
ChromiumWebBrowser browser = new ChromiumWebBrowser();
browser.MenuHandler = new MenuHandler();
CefSharp web browser chromium - Context menu doesn't disappears after click besides menu
Again i am back with solution of cefSharp meue control :)
Problem : Context menu doesn't disappears after click besides menu
Solution : to solve this issue, we need to create our own custom menu and this to browser menu handler.
Step 1. Please refer this git hub class MenuHandler Add it to your project.
Step 2. Now for this you need install "MvvmLightLibs" from Nuget package.
(Please refer How to add nuget package)
Step 3 . How to use MenuHandler
ChromiumWebBrowser browser = new ChromiumWebBrowser();
browser.MenuHandler = new MenuHandler();
new menu will have white background to set gray background add below 2 line in RunContextMenu while creating menu object.
var converter = new System.Windows.Media.BrushConverter();
menu.Background = (System.Windows.Media.Brush)converter.ConvertFromString("#F2F2F2");
Happy Coding!!
How to add Nuget package into your Project/Solution
To add NuGet Package - Right Click on your project/Solution and select Manage Nuget Package, like below.
Now search package which to want to add into your project like below and select and click on install.
Subscribe to:
Posts
(
Atom
)
No comments :
Post a Comment