Where is the acronym menu in Visual Studio 2010? - visual-studio-2010

With the following code Visual Studio + Resharper notifies me that the following example Class does not meet the naming convention:
public class AB2CManager {
// TODO: Write some code
}
When I put my cursor on the class name and press Alt+Enter it gave me the option to add the acronym AB to my acronyms list. However, in my case AB2C is the full acronym.
How can I manually edit this list of acronyms? I would like to add the full acronym so that hypothetical class ABManager is still not accepted by the IDE.

http://www.jetbrains.com/resharper/webhelp50/Coding_Assistance__Naming_Style.html#To_create_a_list_of_abbreviations
If you just want to edit the list of abbreviations, use only the lower part of the form; where you can enter, delete or update any entry there.
For example, on my current project I have a field called NIFEmisor, NIF being a spanish ID number. I've added 'NIF' to that box and no more trouble.

Related

XCode: Additional localization of only one button

After a long long time, I added another button to my apps dialog. I had localized strings implemented. So I found a similar one like
/* Class = "NSButtonCell"; title = "Keep number"; ObjectID = "2yE-rM-5Sn"; */
"2yE-rM-5Sn.title" = "Nicht umnumerieren";
in file "Main.strings (German)". Unfortunately I forget, how I got there. I did the entire translation in one step in one night. Now I only need to get one new translation for the newly added button.
Any hint how to do this?
Select your project name (1.), in my case Timebooking. Maybe the application is selected instead in Targets and you have more options but not localization. Then select Use Base Localization (2.). It should create the English Main.strings file when you add English. There you can add the proper translation. HTH.

How to show content of method inside another method?

I want to split one method to many little methods, but I want my code to still be simple to read. Is it possible to display content of methods in place, the way it was before the split? I want to display them in the same way explorer displays folders: you see files and folders, click on the triangle left to a folder to show what's inside.
No, you can't. However you can use the "Peek Definition" feature of Visual Studio (since VS 2013, not in Express Versions however).
If you have your newly refactored method like:
public void RefactoredMethod()
{
DoStuff();
SomeMore();
Validate();
Save();
}
you can right-click any of the smaller methods and choose "Peek Definition" to show the method inline at the current place. You can also bind it to a shortcut.

How to add a user defined control to a form in VFP

Hi: I have created a very simple user defined control (a container) with the visual IDE of Visual Foxpro 9 and stored it into a VCX file (sisweb.vcx)
After that I've created (visually) a form and in the INIT event I've tried to instantiate the previous container control and add to the form:
oContainer=newobject("xContainer","sisweb.vcx")
ThisForm.AddObject("Contx","oContainer")
ThisForm.Contx.Width=230
Unfortunatelly, when trying to ADD the container object, it rises an error saying that oContainer doesn't exists.
Can you help me please?
When you want to add an object dynamically at run-time, you could do something like
Thisform.NewObject("Contx", "xContainer", "sisweb.vcx")
Thisform.Contx.Width = 230
Thisform.Contx.Visible = .T.
Where assigning the Visible property explicitly is important.
On the other hand, you could also add it "visually" in the Designer by dragging it from the Project Manager's "Classes" tab, or by using the bookshelf icon of the Form / Class Designer's "Controls" toolbar, or the "Toolbox" in the "Tools" menu

Name property of UserControl or Control

What is special about the Name property of a Control or UserControl that causes it to be displayed as "(Name)" inside the property grid within Visual Studio?
Check out this article about design-time attributes in .NET. Specifically, I think you are looking for the Browsable attribute, which enables properties in Visual Studio's design-time properties dialogue.
If you have a property called Name, you'd declare it like this:
[Browsable(true)]
public string Name { /*...*/ }
You can set a lot more attributes, like Description, DefaultValue and Category, which will come in handy if you're planning on presenting your controls to other developers.
EDIT: To get the effect that you want, use both the Browsable and ParenthesizePropertyName attributes:
[Browsable(true)]
[ParenthesizePropertyName(true)]
public string Name { /*...*/ }
(Thanks to Ksempac from the comments for this.)
Since you didn't specify if you're using VB or C#, here's the same thing in VB:
<Browsable(true)> _
<ParenthesizePropertyName(true)> _
Public Property Name(Value As String) As String
' ...
End Property
EDIT 2:
I think you're wondering about why you would want to surround your property with parentheses in the first place, or perhaps what it means for a property's name to have parentheses around it.
You can find the answer to that here:
Parenthesized properties are shown at the top of the window — or at the top of their category if the list is grouped by category
Basically, if a property is important, you want it to appear at the top of a sorted list, so you surround it with parentheses to indicate this.

TYPO3: Change plugin from USER to USER_INT type

I have a working TYPO3 extension. It is attached this wiki page. How can I change the code of this extension so it is of the USER_INT type? I.e. I don't want TYPO3 to cache the output of this plugin, and want TYPO3 to invoke the extension ever time a page that uses the extension, i.e. disable the caching for this extension.
To disable caching for your extension go to your piX/class.tx_XXX_piX.php file and remove the following line (below your class declaration):
var $pi_checkCHash = true;
You also need to add the following line in the main method (below $this->pi_loadLL();):
$this->pi_USER_INT_obj=1; // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
grunwalski it's the opposite you have to change this:
t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',1);
to this:
t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',0);
The simpliest way to solve your problem is to go back to Extension Maganer, select your extension, choose "Edit in Kickstarter" from the dropdown menu, and then select the corresponding Frontend plugin to edit it's properties.
Check the first checkbox which means that you want your plugins to be rendered as USER_INT cObjects. After that click the View result button, uncheck all custom PHP files (your own code, like modules and plugins) on the right side and click the WRITE button. Please be careful. If you don't uncheck the checkboxes of your own files, they will be overwritten with dummy files.
The correct and comlete way to do this is a combination of the answers of #arturh and #Mehdi Guermazi:
change the last parameter in the addPItoST43() call in ext_localconf.php from 1 to 0
remove the var $pi_checkCHash = true; line from the property definitions in the head of the pi1 class.
add the $this->pi_USER_INT_obj=1; line to the start of the main() function in pi1.
These changes are identical to what you will get when you use the kickstarter method explained in the solution of #bencuss.
When you have created your extension with Kickstarter you also have to go to the file [yourextension]/ext_localconf.php and change this line
t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',0);
to this:
t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',1);
Edit the file setup.txt of your extension "myext". Change "USER" into "USER_INT".
plugin.tx_myext = USER_INT
plugin.tx_myxt {
This extension will never be cached.

Resources