Have you guys and gals got any tips or hacks for making the most out of the JavaScript intellisense options in Visual Studio 2008?
Consider the following:
var Persons = {};
Persons.Females = {};
Persons.Females.Julie = function (_mood)
{
/// <param name="_mood">Mood of Julie</param>
/// <summary>Constructor function: Julie, a 22 year old female</summary>
/// <returns>New instance of Julie</returns>
var breasts, thighs, stomach; // Private variables
this.mood = _mood; // Public variable
function accessBodypart(_bodypart) // Private function
{
/// <param name="_bodypart">Bodypart to access</param>
}
this.access = function (_bodypart, _accessee) // Privileged function
{
/// <param name="_bodypart">Access a bodypart on Julie</param>
/// <param name="_accessee">Person accessing Julie</param>
/// <summary>If you have sufficient rights, you may use this
/// function</summary>
/// <returns>Julie's reaction</returns>
if (_accessee.status === "boyfriend")
{
accessBodypart(_bodypart);
return "Giggles";
}
return "Slap in the face";
};
};
var happyJulie = Persons.Females.Julie("happy");
Visual Studio shows me the "namespaces" and uses the documentation features (<param>
and <summary>
). I have not been able to get the <return>
documentation feature to work though.
Now, that's all well and good. But when I do:
happyJulie.access("breasts");
Visual Studio does not know about the access
function and I get no documentation on it.
Is there any way I can expose public variables and privileged functions to Visual Studios intellisense functionality, while still creating objects with private members?
Yes, using the whole car->wheels->tires
gets old at some point :)