Alright darn it, I'm admitting defeat again.
The windows forms designer will call BeginInit on controls while initializing them, but it casts to ISupportInitialize first.
(Control1 as ISupportInitialize).BeginInit();
However, there is no BeginInit on Control1, calling Control1.BeginInit fails.
I was under the impression that for Control1 to be able to support the interface ISupportInitialize, it would have to have the BeginInit method.
Discussions
-
-
WHAT THE HELL!!!
-x? That's it. I can't believe I've been using C# this long and haven't caught on to that.
-sigh-
C# just became the Mc Donalds of programming languages. -
Brilliant.
This link helped me out a lot: http://msdn2.microsoft.com/en-us/library/3s8xdz5c(vs.71).aspx
LINQ did need to be taken out of the equation so I could focus on getting a good model for updating the list box with data. Additionally, calling .ToArray off of LINQ worked perfect to get the query to happen on the seperate thread.
I imagine my work can all be improved but at least I have a frame of reference now. Thanks all! -
OWW, mybrain hurts. Alright. All very valuable, I need to go dive into the code again. See ya on the flip side!
-
I'm not even sure how to pose this question but it has to do with finding out the correct way of doing multi-threaded programming in a windows desktop application. Yes, I know, too big of a topic for a single post.
Here's what I'm wondering about.
I have a keywords textbox, a search button, and a list for results. When the user enters a value and clicks the search button, I'm using LINQ to query for results but the application freezes until I'm finished listing the results. Yes Lame!
So I was thinking that I would kick up a thread to do the query and then return the result back to the primary thread and list the results. Except that LINQ doesn't actually fire off the query until you're using it, like a databound operation.
So what are my options? <- I apologize for the very non-specific question here.
Also, in general, if listing out results in a list box takes a long time itself, how are you supposed to multi-thread that operation if the list box was created on the primary application thread. -
hehe, oh sure. Break out the IL and kill the thread!
-
This is purely a language design feature. There's no issue involved in the IL to create an object, initialize it and toss it.
Microsoft says it best:
http://msdn2.microsoft.com/en-us/library/k626bk8b(VS.80).aspx
The compiler generates an error when it encounters a meaningless statement.public static void Main()
{
2 * 3; // CS0201
}
-
odujosh wrote:Yea Switch statements are evil anyways. Basically your doing a manual table look up in the example and setting temp based off the value of the switch parameter.
I think the code would be better off if it called some data access pulled it from a source (hash table, database table, xml file, whatever) and then operate on it using a work flow. With XAML adding a branch isn't a code change. You can bring down a process push in the new XAML and bring it back up. Depending on how populaur the work flow and the eventing infrastructure you have in place you may even be able to do it in process.
Call me a snob
God, I'm glad you were joking! -
DesignMail wrote: so I created an ErrorHanlder that would handle the Regex

I wasn't sure what the error handler was actually trying to catch. That's all. Glad to hear you got it worked out.
-
huh?
try
{
...
}
catch (Exception e)
{
foreach (String s in YourArrayList)
{
RegEx.Match(s, blah)
}
}
Something like that. Assuming you have Strings in your array list.