it is very common for extensions to use settings either as a mechanism for storing data internally or for allowing users to change some of these settings to better meet their needs either way the implementation is the same so let's take a look at how to add settings to an extension we're going to start by right-clicking the project node and select add new item from here we're going to navigate to the extensibility category and select options page and we're going to give it a name in this case general which is the default that will create general.cs inside a folder called options it contains two classes the second of which is called general and that is our options class so for this sample we're going to create an option to determine whether or not to use uppercase when we insert the good as part of our extension so i'm just going to update the text and the type as if it was any other property i'm also going to change some of the metadata and the metadata is contained within attributes on top of each property so i'm going to give it a display name and then a description that explains to people what this property is for and you can be very precise here and that will help out people better understand we're going to set a default value and make sure that that default value is also accurate reflected on the property itself like it is right here it's now time for us to consume this new setting in our code so we're going to navigate to our command class and start by getting an instance of the general settings class so those apis are async so i'm going to await general dot get live instance async and now i can simply query my properties located on the options class like right here so i'm testing for whether use upper case is set to true and if it is i'm going to change the guide here to be uppercase we now have settings that we can use internally in our extension to persist between instances of visual studio but now we need to make sure that the user can also modify those settings so if we go back to general.cs we can see that we get a few lines of code here that we can copy and paste into our package class these are two attributes that registers our settings class as tools options pages all i have to do is to modify the names to match that of my extension so now that we're done implementing our settings it's time to build and run our extension in the experimental instance of visual studio let's open a code file and just insert a good just to make sure that everything still works as it did before and we can see we get a lowercase good now let's open tools options and find our newly created options page called insert good here you can see the category the display text and the description all coming in and i can now as a user change the value to true and if we go back and run the command again to insert a good we can see that the changes have taken effect the settings are applied and we get an uppercase good inserted you can have as many options classes as you'd like in your extension and you decide which ones to expose to the user through the tools options menu by only copying those attributes over to the package class that you want there's a lot more to explore when it comes to settings and options how to dynamically update the values and save them or listen to events on when they change it's all exposed through the api and very simple to get started with so go try it out enjoy
Monday, 21 October 2024
Abbey Road RED is hacking the future of the music industry
>> Welcome to the very first Abbey Road Hackathon. >> We're trying to look at nascent technologies, the cognitive APIs which we're using in partnership with Microsoft, for example, to put down a bridge into the future of music technology. >> Hackathon is all about a creative environment that allows people to come up with brand new ideas, things that we've never seen before. >> The amount of innovation history that is in this building that we're surrounded by, is astounding to the point of overwhelming. >> You're looking at music tech history, the patenting of stereo, the creation of the Red 17. It was the first recording studios complex. >> We are building the Microsoft Vision API. It takes emotions of people's faces and then generates music recommendations based on their emotion. >> The ideas that someone was going to rap, the algorithm is going to understand it and it's going to rap back a punchline. >> So, we use the 3D from Microsoft API. We got them really into the flow of what we wanted to do. >> Sometime around midnight, two O'clock, they just have to go to sleep. So, they'll pass out on a beanbag, short nap, get back up and start the process all over again. >> Hey, guys [inaudible] >> We are all turned up, here's the facial recognition software capturing the mood of the crowd. >> We hope you enjoy our products. >> Now, I have the pleasure to present record to you. We'll use the Microsoft API to understand the speech. It was trained to generate appropriate response. >> Impress with some rhymes. >> My homies' in Abbey Road. Check it out. >> We are really glad to present to you, LYRA. With LYRA, you just input a word, to be viewed a LYRA suggestion. >> The price goes to. >> Team Rocket. >> Can we do it tomorrow again?
Building Bots Part 1
it's about time we did a toolbox episode on BOTS hi welcome to visual studio toolbox I'm your host Robert green and jo...
-
hey everyone welcome to Microsoft Connect my name is Nina Zakharchenko I'm a senior cloud developer advocate at Microsoft ...
-
It's lunchtime, and this is Brad Anderson's lunch break. Here in Redmond we're visited by some of the smartest peo...
-
[MUSIC]