|
It is still freezing the GUI. Let me know if I am doing this how you reccomended or not.
Here is what I have:
private void LoadCompanies(object sender, EventArgs e)<br />
{<br />
pnlNavigation.ShowLoader(true);<br />
this.bgWorker.RunWorkerAsync();<br />
}<br />
<br />
private delegate object LoadCompaniesDelegate();<br />
<br />
public void LoadCompanies(DoWorkEventArgs e)<br />
{<br />
PROSOCO.Library.Companies.Criteria criteria = PROSOCO.Library.Companies.Criteria.GetCriteria();<br />
BindingSource src = new BindingSource();<br />
PROSOCO.Library.Companies.Nodes nodes = PROSOCO.Library.Companies.Nodes.GetNodes(criteria.NodeCriteria());<br />
src.DataSource = nodes;<br />
e.Result = src;<br />
}<br />
private void bgWorker_DoWork(object sender, DoWorkEventArgs e)<br />
{<br />
LoadCompanies(e);<br />
}<br />
private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) <br />
{<br />
BindingSource src = (BindingSource)e.Result;<br />
pnlNavigation.ContentTree.ParentMember = "ParentId";<br />
pnlNavigation.ContentTree.ValueMember = "Id";<br />
pnlNavigation.ContentTree.DisplayMember = "Name";<br />
pnlNavigation.ContentTree.PrefixMember = "CustomerNumber";<br />
pnlNavigation.ContentTree.PostfixMember = "CityState";<br />
pnlNavigation.ContentTree.DataSource = src;<br />
pnlNavigation.ShowLoader(false);<br />
_activeModule = "Companies"; <br />
}
|
|
|
|
|
Stick in some debug statements to see where it is slowing down on.
|
|
|
|
|
I get the (Not Responding) for a couple seconds when it gets to "pnlNavigation.ContentTree.DataSource = src;" This is a lot of data to load, however, I thought the background worker would handle that. Right?
|
|
|
|
|
To eliminate possibilities, temporarily comment all code inside RunWorkerCompleted handler. Does it still freeze?
|
|
|
|
|
Hi all,
I managed to set the forecolor of a Disabled Label by overriding the OnPiant method but how to get automatic text handling (autoelipsis = true & autosize = false) to work ?
T.I.A.
|
|
|
|
|
You took over painting of the control, so you've got to determine what conditions have to be met and what to draw for each situation. You can't do "just this piece" and expect the control to draw what you didn't. You either have to draw it all, or let the control draw itself, then you draw over the top of it. Warning! Taking the second route could result in some very unexpected results!
|
|
|
|
|
I was thinking that someone would kindly enough to share some code with me so i can get faster in my project than your answer as no answer
|
|
|
|
|
I pointed you in the right direction, it's up to you to paint the control how you want it. Check into the MeasureString method of the Graphics object you're using to draw with.
patkan wrote: someone would kindly enough to share some code with me so i can get faster in my project
That's not how CP works. YOU write the code and learn by doing. When you get stuck, you ask specific questions about the problem. You learn nothing by us writing the code for you.
|
|
|
|
|
What's a "Disabled Label"? What do Labels do that can be enabled and disabled? What's the point of setting Enabled to false on a Label? And if you did, why then would you modify what it looks like?
|
|
|
|
|
PIEBALDconsult wrote: What's a "Disabled Label"?
I was wondering that, too. He might be meaning a text box? I am not sure.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
see my reply to PIEBALDconsult
|
|
|
|
|
I've created a user control class, to make the click event for this control to function well (any lazy to set on all the other controls click event), i have to disabled all the label,textbox,images & etc controls
Sorry for poor english
Patrick
|
|
|
|
|
I still have no idea what you mean.
|
|
|
|
|
Can anyone please send me the scenarios, where will we use shadowing and overriding.
Thanks
Siva
|
|
|
|
|
Normally you don't want to shadow methods in a class, because this hides functionality in a base class. However there are situations where you rather want to shadow methods to make them protected or private.
Overriding is commonly used to extend functionality provided in the methods of the base class. This is done more often in custom controls and classes that extend the .NET framework functionality.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
Lets say I have an application called Widgets.exe which references, via the GAC, CommonLibrary.dll. This application and its commonlibrary is then deployed to 1000's of devices.
Fast forward a few months and a small bug is found inside commonlibrary. This bug can be fixed without making any changes to Widgets.exe. The relevant developer diligently applies the necessary fixes to CommonLibrary.dll and as a matter of course increases the version number of the library. This is then redeployed, however as Widgets.exe has not changed this is not redeployed.
The problem now is that although the public method interfaces on the CommonLibrary have not changed Widgets.exe is expecting to find version 1.0.0.0 of CommonLibrary in the GAC, however this has now been replaced with v1.1.0.0 (which contains the bug fix). So at runtime a not found exception is thrown by the application.
Now I perfectly understand this and can see why this occurs etc etc. However the problem I have relates to this and how to manage it in the real world. In the real world, Widgets.exe is actually a very large application framework with many executables, assemblies and common libraries. I am trying to find a way to avoid having to redeploy, uninstall, reinstall the application in its entirity should a minor change be made to one of the common libraries.
At the moment to get around this we dont actually use .NET versioning as it should be. At compile time everything in the entire project is compiled to v1.1.0.0 and then we add a revision number to the AssemblyDescription property in AssemblyInfo.cs. This then means we can redeploy single libraries without breaking the dependency/reference chain. The version number would only be increase should a fundamental change be made.
While the ghetto style solution works, it doesnt sit very comfortably with me. So the question is can anybody suggest an alternative/better solution to this issue?
-- modified at 12:39 Tuesday 31st July, 2007
|
|
|
|
|
A trick I use is to change the file version not the assembly version. This will prevent older versions of my app from going down with a patch. Of course if you develop an entire new version of the CommonLibrary and your application it's best to update the assembly version as well. This will help with the problem of having an old assembly with the new application.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
I have a still frame from a live video feed where the camera is pointed at a rectanglar form. The form is of known dimensions. I have got it to the point that my program can look at the still at recognize the four corners. I therefore have 4 2d points of that form. What I want to be able to do is translate those known points into positional data in a 3d game. That is i need to know the rotation (pitch, bank, yaw), and position of the rectangle in relation to the camera. It seems like this should be possible but I dont really have the first clue about how to approach it. Can anyone point me to an article or website that would help me work through this problem. Or at the very least give me some idea of what I should be searching for? I know this sort of thing has been done, but I dont know what it is called to look for it. Let me know if I am being unclear.
|
|
|
|
|
Hi All,
I have Some Interface in my project that some classes are inheritor from this interface.
And i have also a collection that hold objects that inheritor from this interface ( this meed that the collection will holding this interface objects ).
I define some indexer that return object from this collection ==> this meed that the return type of this indexer is this Interface.
When i compile my project i getting this error message
Inconsistent accessibility: indexer return type 'IMyInterface' is less accessible than indexer '...this[int]'.
What is the problem ?
I cant return type of IMyInterface ?
Thanks for any help.
|
|
|
|
|
Hmmmm that sounds mighty odd.
Any interface should be public and so by definition can't be less accesable than the indexer.
Can you post you Interface declaration and the indexer?
|
|
|
|
|
No, members of an interface are public by default. The interface itself can have whatever access modifiers you choose to place on it.
|
|
|
|
|
As a test, create a project in VS2005 and add an interface to it (by selecting interface in the add items dialog). You will find that the interface is not declared public. Suppose that I'd created an interface called IMyInterface, I'd get the following:
interface IMyInterface
{
void DoThis();
} In order to use this interface externally, you have to add the public access modifier before the interface keyword.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Oh it defaults to internal ... wow, I learn something new every day
I always explicitly put in my access modifiers anyway so I guess thats why I've not come across this before.
|
|
|
|
|
you probably have the Interface defined as private and the indexer defined public.
Make sure the Interface definition explicitly includes the access modifier public as by default they are private
-- modified at 11:57 Tuesday 31st July, 2007
|
|
|
|
|
Primary key for the table is (Name, Data).
How to show data like this:
Name1.....Name4
------.....------
Data11....Date41
Data12
Name2
------
Data21
Data22
Data23
Name3
------
Data31
...
|
|
|
|