|
Hi all,
I am working on an application that is ever growing in functionality. I have started writing it a couple of years ago. To simplify coding, I have also created several small classes that allow me to manipulate strings and such, which I can then call from the rest of the code.
When calling a standard .NET class in the code editor, you usually get a short explanation of what a certain property does, when you leave it selected.
Can anyone tell me whether it is at all possible to mimic this with self made classes, and if yes, then how?
A simplified example:
Public Class DateString<br />
Inherits System.ComponentModel.Component<br />
Public Shared ReadOnly Property ToDayLong() As String<br />
Get<br />
Return LongNumber(Now.Day)<br />
End Get<br />
End Property<br />
Public Shared Function LongNumber(ByVal value As String) As String<br />
If Len(value) < 2 Then<br />
LongNumber = "0" & value<br />
Else<br />
LongNumber = value<br />
End If<br />
End Function<br />
End Class
Where / how should I write the explanation?
All suggestions appreciated.
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
In C#, you put three / for a comment, so instead of //, it's ///, then it autopopulates with all the stuff you can fill out for auto generated docs and also the intellisense. I'm not sure what it is for VB.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian,
Thanks for the suggestion. I had forgotten that it is called intellisense. I just looked it up, and unfortunately it apparently is not supported in VB at all. I guess I'll just rely on the good old gray matter.
Thanks anyway though,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi friend,
We can write comments by using single quotes. For example : -
Public sub getMax()
'This is to get maximum number
Useful codes.
End Sub
OK. Waiting for next question.
|
|
|
|
|
Okay friend...
I am sure your IQ is twice as high as mine, but I am also sure that my question was not that unclear.
My advice is free, and you may get what you paid for.
|
|
|
|
|
If this is VB 2005, type the comment character three times and then press enter in front of the class or method. It will produce an XML comment block. The stuff you type in the summary element is what appears
VB 2003 does not support XML comments unless you install the VB Commenter add-in.
Here's a VB 2005 example from a method I wrote:
''' <summary>
''' Converts a database column value to a nullable type instance.
''' </summary>
''' <typeparam name="T">A generic value Type. See generic constraint in function signature.</typeparam>
''' <param name="dbValue">The database column value.</param>
''' <returns>An instance of a nullable type containing the underlying database column value.</returns>
''' <exception cref="System.ArgumentException"></exception>
''' <remarks>A database null (DBNull) is converted to null (Nothing in VB).</remarks>
Kevin
|
|
|
|
|
Hi Kevin,
Nice one, thanks. I am indeed still on 2003, so I am going to go and play around with the VB Commenter, and switch to 2005 asap.
Cheers,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
BTW, you might also find this tool handy.
http://visualstudiohacks.com/CRDocumentor[^]
It works with both VS 2003 and 2005 for both C# and VB (with VB Documenter add-in for VB 2003). It's handy for checking that you're comments look right, as reading the raw XML in the editor is. It's also dynamic, i.e., updates the display as you write the comments.
I was using VB 2003 for some months recently and I can confirm that it works fine.
The DXCore library referred to in the article is a free download. But if you already have one Dev Express's Refactor! tools then it's already on the system. Once there then plug-ins like CR_Documentor are just DLLs that you manually place in the relevant folder.
Kevin
|
|
|
|
|
Hi Kevin,
Thanks for this suggestion also. I got the VB Documenter, you suggested first, to work very nicely. I will definitely check out this link too though. Creating some documentation for my app is long overdue.
Cheers,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
hi everyone,
how can i determine the extension of any file.
what is the method to get the extension of any file.
Rupesh Kumar Swami
Integrated Solution,
Bikaner (India)
|
|
|
|
|
dim str as string = path.GetExtension("Rupesh Kumar Swami.extention")
|
|
|
|
|
Thanks sonia
by the way argument for GetExtension method is good
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
|
Hi All,
I have build a window service with timer in it and i want to enter log after every 5 minutes,so I have written code in Timer_tick function , but It's not working ,Can I do that way , Or there is another way of doing it.
Thanks & Wishes
Navneet Hegde
Nashik(City Of Pilgrimage)
Develop2Program & Program2Develop
|
|
|
|
|
send me the code ....I will ty to rectify it.
|
|
|
|
|
Hi Sonia,
Namespace AlertService
{
public partial class AlertService : ServiceBase
{
public AlertService()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
// TODO: Add code here to start your service.
timer1.Enabled = true;
}
protected override void OnStop()
{
// TODO: Add code here to perform any tear-down necessary to stop your service.
timer1.Enabled = false ;
}
protected override void OnPause()
{
timer1.Enabled = false;
//base.OnPause();
}
protected override void OnContinue()
{
timer1.Enabled = true;
//base.OnContinue();
}
private void timer1_Tick(object sender, EventArgs e)
{
eventLog1.WriteEntry("Hai it's now " + DateTime.Now.ToString());
}
}
}
This is what i have coded , Installation is working well with custom Event log , Start , Stop Pause , Continue is Logged but Only the Timer is not working
Regards & Wishes
Navneet Hegde
Nashik(City Of Pilgrimage)
Develop2Program & Program2Develop
|
|
|
|
|
You are using Window based Timer. User System.Threading.Timer instead...
|
|
|
|
|
Hi A
I will try this and let you know
Regards & Wishes
Navneet Hegde
Nashik(City Of Pilgrimage)
Develop2Program & Program2Develop
|
|
|
|
|
Next time, use the C# forum if you're working in C# code.
|
|
|
|
|
hello frnds,
can i change/append the text in footer of word document using vb.net
if any one knows then plzzz...help.
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
|
Hai!
we have 8 of modules in our project(Visual Basic 6.0)!
And we already completed 6 of that modules!
we need to work with one more module! that module have similar functionality like one more previous module! so we just copied the earlier one! The problem is, the new module
doesnt respond properly as like the previous one!
How can i compare those two Visual basic sources?
Is there any option for that? or Is there any tools available for compare sources?
Help me plz! That will really helpful to me!
|
|
|
|
|
Hi ,
try Googling the Tool 'ExamDiff'
Regards & Wishes
Navneet Hegde
Nashik(City Of Pilgrimage)
Develop2Program & Program2Develop
|
|
|
|
|
|
Araxis Merge is an awesome diffing tool.
One also comes with Visual Studio, but it kind of sucks.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|