|
That's not really an answer as apparently SO can't agree!
Personally I'd say that it is almost 100% OO, everything in C# is an object, even primitive types ... except methods and classes, which can easily be manipulated into object types (Delegate and Type respectively), but which are not actually objects in and of themselves.
|
|
|
|
|
Yes.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Well, I think that all depends on how you define what an OO Language is. If you met someone at Xerox Parc in the 1970's who programmed in SmallTalk, and showed them the C# Language specification, they might say C# is not a full OO Language because it doesn't support "true" multiple-inheritance, and it distinguishes value Types from reference Types. But, that same person would probably also say that Java, Ruby, and Python, are not OO Languages.
But, if you ask the question as: "Is C# an object-oriented language ?:" then, I would say: "yes," because you can't do squat in C# without creating and using objects; and, yes, because C# supports the key-features of object-oriented languages, including classes, and inheritance.
“The best hope is that one of these days the Ground will get disgusted enough just to walk away ~ leaving people with nothing more to stand ON than what they have so bloody well stood FOR up to now.” Kenneth Patchen, Poet
|
|
|
|
|
What exactly do you mean by "fully object oriented"? That doesn't seem to be a well-defined term.
|
|
|
|
|
Please can you define what you mean by well-defined term .
Everyone dies - but not everyone lives
|
|
|
|
|
Oh you
|
|
|
|
|
See recursion.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
|
Not fully recoursive.
This is.
Ciao,
luker
|
|
|
|
|
Ok - you win!
Everyone dies - but not everyone lives
|
|
|
|
|
|
As Bill points out, just how OO is it? Does the fact that it allows static methods and objects adhere to OO tenets?
|
|
|
|
|
You have several excellent answers here, but I will throw a one into the mix - is a language that supports static methods and objects fully object oriented? Does that fit into a classical definition of OO?
|
|
|
|
|
Below is the two hyperlinks, when i click one of them the following events must take place:
-set a focus to the active link
-change the background color of the clicked link
I tried to use CSS and JScript but it does not work.
please anyone with the solution there ...HELP
Home About Us
|
|
|
|
|
And what does this have to do with C#?
|
|
|
|
|
It can be done with CSS or JavaScript. Ask a new question in the respective forum, showing us what you tried (i.e. your code) and what it caused. Then we could find out what you did wrong, and show you the solution.
|
|
|
|
|
Hi All,
I have a windows application (Form1) in form one I have 150 Label
and I want to remove this labels using
foreach(Label lbl in this.Controls)
this.controls.remove(lbl);
I need to stop refresh the form, also I use suspendLayout() before removing and resumeLayout after removing but it is still refreshing.
Please help me how to stop the form refresh until remove all controls.
Thank you very much
|
|
|
|
|
zead wrote: I use suspendLayout() before removing and resumeLayout after removing but it is still refreshing. The Form should not be updating if you have used 'SuspendLayout properly.
Are you executing 'SuspendLayout outside the loop in which the Labels are being removed ?
Please describe in detail exactly how the Form appears to be updating: what do you see ? Are all the Labels on the Form; or, are some of the Labels inside some Container Control, like a Panel ?
“The best hope is that one of these days the Ground will get disgusted enough just to walk away ~ leaving people with nothing more to stand ON than what they have so bloody well stood FOR up to now.” Kenneth Patchen, Poet
|
|
|
|
|
Hi,
This is the code:
private Void RemoveLabels()
{
SuspendLayout();
try
{
for(int i=0;i
|
|
|
|
|
That is a lot of labels to remove from a form.
Can you describe the refreshing issue that you are having?
one thing to try is to enable the double buffering on the form[^].
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Hi,
I mean by refresh you can see the form redraw the controls and you can see the Labels when it is removed, I want the label to still shown until last label deleted and empty the form.
Thanks
|
|
|
|
|
To add to what the others said, you can't do that anyway.
You cannot modify a collection which is being used as the target of a foreach loop.
You should consider a for loop instead - and work backwards through it, not forwards - or construct a separate list of "removable" controls and remove them afterwards.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Quote: work backwards through it, not forwards
Thank you, Thank you, Thank you!
This is definitely my lesson for the day - I never figured that iterating through the list in reverse was the way to do this.
I always used to amend the index and bounds when I removed an item from a collection
Embarrassed for missing this and glad that I have learnt the correct way - sometimes the simplest things slip by us
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
You're welcome!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
A side-note: trying to delete items in collections in a 'foreach enumeration of the collection does, in many cases, throw an actual error at run-time. In the case of removing Controls using 'foreach, an error is not thrown, however, not all the Controls targeted are removed. Another "strange but true" artifact of .NET (still valid in .NET 4.5, 4.5.1).
“The best hope is that one of these days the Ground will get disgusted enough just to walk away ~ leaving people with nothing more to stand ON than what they have so bloody well stood FOR up to now.” Kenneth Patchen, Poet
|
|
|
|