|
I like to use N-Doc for internal documentation (turns your three-backslash xml comments into html documentation). It is a free download, so just search online for it.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
NDoc only really works on .NET 1 and .NET 1.1. If you're using higher versions of the framework, you should look at using Sandcastle.
|
|
|
|
|
i have 2 forms called "A" and "b" .when the button in the form "A" clicks the form "b" loads and thorugh the form "b" i want to add a listitem to a listview in form "A". i made the listview public though can't access the listview without creating a new form.
How can i do this without creating new form object?? in my application i have a win.. form and
|
|
|
|
|
One of the better methods for doing this is to implement the Model View Controller (MVC) pattern. Have a read of this pattern and then see how it helps to solve this issue. (Alternatively, you could use an Observer pattern, but the MVC is probably going to be a bit easier for you to get your head round).
|
|
|
|
|
could you please tell me links where i can read about model view controls..
|
|
|
|
|
You could always read this[^] article from our very own Marc Clifton.
|
|
|
|
|
I agree with the other answer however I initially interpreted the question slightly different. (I probably read it wrong) So just to check as this is the way i initially read your query.
Were you saying:
1. you create an instance of FormB from FormA
2. FormB creates a list item that you want to add to form A.
3. However when FormB closes you no longer have a reference to formB so cannot add this item to formA's list view?
|
|
|
|
|
In the B form you need a reference to the instance of the A form. Send a reference to the A form in the constructor for the B form, and in the constructor put the reference in a variable declared in the B form.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
I think all these anwers depend on the actual question as Im not 100% clear on the situation. (apologies if its just me)
If formB just returns to formA eventually anyway, just expose a property on FormB to return the listViewItem like so... (+ with better naming conventions)
using (FormB b = new FormB())
{
if (b.DialogResult == DialogResult.OK)
{
AddItemToListView(b.ListViewItem);
}
}
Obviously the above assumes formB's role is to create a an object which will be displayed in formA's list view. As i said before i think the question was open to different interpretations as seen with the answers.
|
|
|
|
|
i tied this way . it works but the problem is in the form b i' m having severel selections and i want to make the cahnges as soon as the user did it .
|
|
|
|
|
I'd agree with implementing something like the MVC then if you want to add multiple items. Apologies for sending you down the wrong track then.
|
|
|
|
|
with out the .Net framework does c# have the garbage colllector and the built in data stuctures i9 the language itself..
|
|
|
|
|
No. They are part of the .NET framework which C# needs to run. If you don't have the framework somewhere in the equation, then you can't get C# to run. Hence, C# uses features of the .NET framework.
|
|
|
|
|
As Pete already mentioned...C# is simply the programming language; the .NET Framework is the actual runtime environment and implements the features (like garbage collection) and the data structures. You don't really have one without the other.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
Let's see if I can explain my small doubt. I can go around this, but as I was coding something, I got curious if something wasn't possible to do in c#.
In C++, you could have something like this:
<br />
class A<br />
{<br />
public virtual void method()<br />
{<br />
}<br />
}<br />
<br />
class AA : public A<br />
{<br />
public void method()<br />
{<br />
}<br />
}<br />
<br />
class AB : public B<br />
{<br />
public void method()<br />
{<br />
}<br />
}<br />
<br />
A *obj;<br />
<br />
if ( something )<br />
{<br />
obj = (A)( new AA() );<br />
}<br />
else<br />
{<br />
obj = (A)( new AB() );<br />
}<br />
<br />
obj->method();<br />
<br />
What happens here is that when you invoke the method function, you'll be executing the implementation from AA or from AB and not from A. Though, in C#, if I try to do something like this, you'll be executing the implementation from A. That fact to me, is a shame... I liked this behavior. And as pointers in C# only exist for values, I suppose this is not possible with C#.
Best regards
Gonçalo A.
|
|
|
|
|
Why dont you try it and see what happens?
using System;
using System.Collections.Generic;
using System.Text;
namespace VirtualMethods
{
class Program
{
static void Main(string[] args)
{
A a = new A();
A aa = new AA();
A ab = new AB();
A ac = new AC();
Console.WriteLine(a.GetValue());
Console.WriteLine(aa.GetValue());
Console.WriteLine(ab.GetValue());
Console.WriteLine(ac.GetValue());
Console.ReadLine();
}
}
}
class A
{
public virtual string GetValue()
{
return "A";
}
}
class AA : A
{
public override string GetValue()
{
return "AA";
}
}
class AB : A
{
public override string GetValue()
{
return "AB";
}
}
class AC : A
{
public override string GetValue()
{
return base.GetValue();
}
}
|
|
|
|
|
override.... right.
I feel like a newbie, but I guess these things happen when moving on to a new language :p
Thank you for the quick reply, you helped a lot.
Gonçalo A.
|
|
|
|
|
no problem You can only override a virtual or abstract method, but you can "new" a method over any old one.
i.e.
class AA : A
{
public new string GetValue()
{
return "NEW";
}
}
But this will behave how you originally described ... if cast as 'A' it'll call the original method on the A class. It'll only call the 'new' method if cast as an AA.
|
|
|
|
|
Yes, that was how I was doing it. The original was a virtual method, but I expected him to override automatically. Though, it does make more sense this way, and offers more possibilities.
Thank you, once again, for the explanation.
Gonçalo A.
|
|
|
|
|
Hi,
you should pay attention to the messages the compiler emits. If you try and redefine a
virtual method without either "new" or "override", a warning is issued.
Don't lower the warning level (a project setting, 4 is a good value) to get rid of
(some of) the messages, study the messages and adapt your code instead.
|
|
|
|
|
Yes, I noticed that already.
Thanks.
Gonçalo A.
|
|
|
|
|
hi,
In my webapplication in some pages they following error is showing but i don't know how to solve this problem.please solve my problem.error is like this.
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find server 'WINHOSTING02' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.
/backoffice/entrysubmit.asp, line 76
please help me .
obalesu
|
|
|
|
|
obalesu wrote: please solve my problem.
No.
And why are you using ODBC to access SQL Server in the first place?
|
|
|
|
|
hi all,
how can we show a progress bar to the user while loading data in dataset from sql server database.please help me .
Thanks For Any Body Hellp me
|
|
|
|
|
I tried to do a similar thing a long time ago, at that time I was thinking abt getting some sort of progress from SQL server but in theend I came to know that it wasnt possible. probably u can show some other graphic while the data is being loaded and hide that when ur done.
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|