|
Sorry, you are correct, ^ is XOR in C++. I got it mixed up with my VB syntax, which uses ^ as the power operator.
|
|
|
|
|
Why are you using an IEnumerator variable in your VB sample? Can't you use a NodeCollection variable and do a foreach loop instead?
This blanket smells like ham
|
|
|
|
|
I could have used foreach instead, but I wanted my code to reflect the fact that I was enumerating the collection only to count it. I tend to think of using foreach as "I'm doing something to each of these items in the collection", so I thought I'd use IEnumerator to specifically call out to myself that I'm only walking the collection and not making any edits.
|
|
|
|
|
Interesting, I've never made that distinction before. I've had to avoid using foreach when I was modifying the collection (adding and removing elements), but for everything else I just use foreach. Personally I find the IEnumerator interface rather ugly and suspect it was designed to be hidden under the covers, so I'm content to leave it there. I definitely respect any conventions that make code easier to follow and understand though.
This blanket smells like ham
|
|
|
|
|
It is eerily reminiscent of COM, isn't it? Just when you thought you were free from interface coclasses...
Actually, thinking on some of the comments in this topic, I ended up going back and rewriting it as a for loop this morning anyway, which let me keep the same counter variable and get rid of the IEnumerator.
|
|
|
|
|
At one point in my life IDL actually started to make sense to me.
This blanket smells like ham
|
|
|
|
|
I'm very sorry and I hope you can find the help you need.
|
|
|
|
|
Were you just trying to delete the treeview thingy you clicked on via index?
try this:
Private Sub TreeView1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseUp
me.TreeView1.Controls.RemoveAt( me.TreeView1.Controls.GetChildIndex(me.TreeView1.GetChildAtPoint(new Drawing.Point(e.x,e.Y)))
End Sub
GaltSalt
maker of .Net thingys
|
|
|
|
|
No, actually I was just trying to access a node's index in the TreeNodeCollection in order to be able to insert another node before or after it in the collection. I just noticed the somewhat incomprehensible code in the Managed C++ section of the MSDN help for that method while I was browsing around.
Please don't bother me... I'm hacking code right now. Doesn't anybody remember what "hacking" really means?
|
|
|
|
|
Can someone please tell me what Software Development Methodology is?
Is it object oriented or struvtured and where did it originate from?
And can you please give axamples of each.
Thank you.
egionare
itsavvy
|
|
|
|
|
If you google it, you will get more results than you can shake a stick at. Also, this is the wrong forum.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
egionare wrote: Can someone please tell me what Software Development Methodology is?
A real short answer: methods for developing software. There are many different methods out there and describing just a few of them is beyond the scope of a quick message. You need to do a search online to just begin getting a grasp of it.
egionare wrote: Is it object oriented or struvtured
No, those are programming paradigms.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
That's right, this question does belong on the "Coding Horrors" board.
|
|
|
|
|
I've been frustrated the last couple of days trying to get multiple files to upload while still updating individual progress bars in a responsive WPF UI. I finished it this moring, and I came up with this oh so satisfying line:
<br />
fu.ui.UploadFile(fu.file);
I think that might be the coolest and most satisfying line of code I have ever written.
You might see this line in Coding Horrors the next time some other coder runs across it!
-- modified at 9:21 Wednesday 1st August, 2007
|
|
|
|
|
I had one the other night:
if (car is Missing) return null;
(it's valid C#!)
|
|
|
|
|
Missing? I can only find that in the Microsoft.JScript namespace, unless you have your own Missing. If the former, it's very tentatively valid C#.
|
|
|
|
|
System.Reflection.Missing
|
|
|
|
|
Just another glaring indictment of the perpetual impotence of MSDN indexing, finding only the most obscure occurrence of the Missing class.
|
|
|
|
|
|
No doubt. I always use Google to search MSDN, not their own search.
|
|
|
|
|
i didn't know it ws posssible to serach msdn with the built in search function
|
|
|
|
|
That makes for a good technical interview question:
"In the .NET Framework base class library, what is the Missing class?"
Very zen-like, a bit like the missing link...
|
|
|
|
|
else return car;
Greetings from Germany
|
|
|
|
|
else return (Missing)car;
|
|
|
|
|