Chose a color for a particular method in VS2012 - visual-studio-2012

Pretty dumb question I know,
I want to know if there is a way to assign a particular color to a method of my choice in .cs file.
So that i donot even accidently go and write or change anything there.

No, Visual Studio does not support this behavior natively (though someone could write an extension that did it).
Some ideas, though...
My first suggestion is to use version control so that any changes you make can be reviewed and reverted.
My second is, in C# you could use a partial class to keep all the code that should never change in one file and the code you can change in another file. You could even go further and set the readonly flag on the file you never want to change (though check how this affects your source control system).
But use version control either way.

Related

Is there a way to get Keyboard change reflect on Appimage?

I am using ibus keyboard layout and I can change the language globally, However this change is not reflected on Appimages (I am using Inkscape). Is there a solution to this problem or are Appimages supposed to be like this?
This needs to be addressed by the Inskape AppImage authors. They are the ones who decide whether the bundle will use the system settings or a fixed language/keyboard preferences.

prevent resharper from automatically fixing issues

I noticed that Resharper automatically applies fixes (e.g. removing unnecessary namespace prefixes) in methods that I am not working on within the file I'm working on. How do I turn this off? (I only want to fix things if I take specific action).
After reading your question, I'm not sure whether it is about disabling automatic fixes, or just make them more local.
What you're talking about, is called Code Cleanup. You can disable parts of that in the ReSharper options, including the "Optimize Using directives", which you were talking about.
If you just want to cleanup/format a part of a file, you have the option to first select the method/code part, and then hit the shortcut to cleanup. Then, all modifications will just apply to the selected area, not the file.

About scopes in Sublime Text 3: text.something vs source.something, and their features

So I'm contributing, for the sake of learning a bit more of the innards of ST3, to a repository making a new package for Laravel's Blade templating.
In the .sublime-syntax file, the scope is currently set as scope: text.blade, which works fine except for that fact that I cannot make the autocompletion popup appear for my snippets. For that, I need to change the scope to source.blade. But doing to kills the ability of using div.foo+ tab to expand it to <div class="foo"></div>.
I know I could change auto_complete_selectorin my preference to include text, but that's just a solution for me. We wouldn't want to have a package that asks you to change your preferences, we'd want it to just work.
Would there be a way, in my syntax file, to have the autocomplete popup activate while still in the textscope and keeping both features (popup for autocomplete and the tab to expand)?
I'm not sure which is the best solution. It maybe makes sense that the default setting for auto_complete_selector doesn't work in the text scope, but I don't understand why it's not working in text.html. Anyway, the way I see it, you have two options, each of them having their cons.
Don't mess with the user's setting, but communicate the need to adjust the auto_complete_selector, e.g. by using the Messaging system provided by Package Control. Con: users might ignore READMEs or install messages.
Override the user's setting by including a .sublime-settings that adds text.blade to the auto_complete_selector (I've seen packages doing just that!) Con: interferes with user settings.
On a side note, I'm wondering whether it wouldn't be more appropriate to use text.html.blade as a scope.

Can you configure the Visual Studio Find Options?

Is it possible to get the VS 2012 find dialog to always use Current Document and reset case & whole-word when I press Ctrl+F? Currently it remembers my last options and I often forget to turn them off.
Also it sometimes switches to All open documents on its own which totally throws me off. I haven't yet figured out why or when this happens.
I've searched for registry keys and extensions but so far nothing useful has turned up.
It's not possible to get the dialog or the quick find UI to always choose a specific scope out of the box. During beta of VS 2012, this behavior was implemented where CTRL+F would always set the scope to Current Document and Ctrl+Shift+F would set the scope Entire Solution upon invocation of the commands. A lot of users were unhappy with this behavior, so it was reverted. There are no registry keys that you can set to alter this behavior.
Visual Studio always tries to reuse the last used scope. There are circumstances at which that scope is not available, and that'll cause the IDE to change the scope on you. Let's suppose you do a search in "Current Project", after that you close the entire solution and then invoke the dialog. The scope will have to change to something else.
You probably know about this, but Ctrl+F3 will search for the word that is under the caret and it'll always perform that search with the Whole Word option on in the current document. Perhaps that'll suit your needs.
I've published a Visual Studio "SmartFind" extension to fix this issue.
http://visualstudiogallery.msdn.microsoft.com/015611c4-b357-4672-8977-f3ec92f0b808

ReSharper - Is there a disable command I can add to a file that will not allow reorder of type members?

Much like
// ReSharper disable ConvertToAutoProperty
I would like to know what, if existing, I can add to particular files (and only particular files) so that fields are not sorted on code cleanup.
For more information:
I know there are settings one can set in R# itself. This needs to work even where I don't control settings (like on other people's computers)
I know I can make a setting to disable sorting for particular types in TypeMembersLayout. This also will not work due to the same reason.
I only want this to happen on files I care that it doesn't happen with, not a global setting.
I've been using Resharper for years, and can say with confidence this option doesn't exist. Good idea though..
Maybe Generated Code options can help you. But I didn't try it.
Go to ReSharper->Options->Code Inspection->Generated Code and add your files.
I think ReSharper leaves such files untouched.

Resources