![visual studio shortcuts to create public method visual studio shortcuts to create public method](https://www.codegrepper.com/codeimages/visual-studio-code-html-template-shortcut.png)
- #Visual studio shortcuts to create public method how to#
- #Visual studio shortcuts to create public method code#
- #Visual studio shortcuts to create public method windows#
This class provides the entry point to all EA Extensions and is where the developer will define:
![visual studio shortcuts to create public method visual studio shortcuts to create public method](https://gdm-catalog-fmapi-prod.imgix.net/ProductScreenshot/246af6d7-258a-4bd9-9baf-57df39151823.png)
![visual studio shortcuts to create public method visual studio shortcuts to create public method](https://abhijitjana.files.wordpress.com/2010/08/9_thumb.png)
#Visual studio shortcuts to create public method code#
The following class diagram illustrates the design of the example:ĭetail & Code of the Classes Main Description KeyPressedEventArgs – a C# class that encapsulates the event after the keyboard shortcut keys have been pressed.KeyBoardHook – a C# class which registers the keyboard shortcuts, and raises the keyboard event when the keyboard shortcut keys are pressed.
#Visual studio shortcuts to create public method windows#
#Visual studio shortcuts to create public method how to#
In this article I will explain through a simple example how to use this work-around in your EA Extension. Yep, this time Roslynalso did everything for us and returned the number “6” (which is a sum of even numbers in the list myList) as a result in the Console.Using Keyboard Shortcuts with Enterprise Architect Extension Menus by Phil Chudley, Principal Consultant at Dunstan Thomas Consulting BackgroundĮxtensions written for Enterprise Architect often define menus to invoke functionality, and although a short cut of the form Alt+character can be defined by prefixing the character in the menu option with &, this does not work as a keyboard shortcut.Īfter digging around a bit, I have discovered a work-around so that defined keyboard shortcuts can invoke menu options. Var sum = myList.Where(x => x % 2 = 0).Sum() We also can reference the used assembly just in the middle of our code! Like in the following example: using We will see the result now! Wow, it works! ? Select the code we want to run and press Ctrl + E + E.In ‘ C# Interactive‘ pane type #r directive with the absolute path to the library.Without the ‘ #r…’ directive we will receive the following error: And we want to run this method in another project, without compiling anything. net library: #r ""Įxample needed? Here we go! Let’s assume I have a class library ‘ Helpers‘ with a class ‘ Cast‘ and a method ‘ StringToInt()’. That’s even easier when we want to use a. Not a problem, we just use #r directive! For example, for our custom assembly, we just type the following code in the C# Interactive tab : #r "path/MyVeryImportandLib.dll" Ok, but what if I want to run the code that requires some assembly? FileInfo file = new we check the c: drive. Ooook, why don’t we create a text file? Let’s write the following C# code: using Īnd let’s test the lines that create the file so we select the below lines and press Ctrl + E, E. What is going on here? Well, the Roslyn(known as a ‘ Compiler as A Service’) takes your C# code and runs it! Amazing, isn’t it? Show me something usefull! We will see the ‘ C# interactive’ pane activate in the bottom of the Visual Studio window. Press Ctrl + E, E and wait for the magic to happen! Depending on the Visual Studio version, we need to type only class names or the class names with namespaces.Ģ. This has to be a fully compilable fragment so make sure that if you copy the code to the separate project, it would compile. Select the fragment of code we want to run. Ok, so if we want to run just the fragment of our code – this is what we do:ġ. I can’t be the only person who hates waiting for the code to compile and run… Especially when I want to test only a small part of it! That’s a total waste of time! But good news everyone, I found a way to run a part of my C# code without building the whole project! Ctrl + E, E – the magical shortcut!