Hi all, i have an application with a menu, and each time i click on the menu a different userControle is loaded in the main view. Some of those user controls takes time to load and the display is quite ugly when loading. So i thought i could display a specific user control with something like "please wait loading" while the real user control is loading in background, and when its done display the real one. I searched all over google but couldn't find what i need, so i ask here if someone know how to do that Thanks
Scarsymmetry
Posts
-
GUI optimization -
XML serialization with GZipHi, in my project i use .Net 2.0 Xml serialization, ie something like that :
XmlSerializer xmls = new XmlSerializer(typeof(Class1)); StreamWriter sw = new StreamWriter(path, false, Encoding.UTF8); xmls.Serialize(sw, c1); sw.Close();
It works perfectly, but i need to implement a zip compression after the xml serialization. So i decided to create an XmlZipSerializer, which implements Serialize and Deserialize methods, but with Gzip compression. So i did something like this :public class XmlGZipSerializer : XmlSerializer { public new void Serialize(Stream s, object o) { GZipStream gzs = new GZipStream(s, CompressionMode.Compress); StreamWriter first = new StreamWriter(gzs, Encoding.UTF8); base.Serialize(first, o); } public new object Deserialize(Stream s) { GZipStream gzs = new GZipStream(s, CompressionMode.Decompress); StreamReader second = new StreamReader(gzs, Encoding.UTF8); object o = base.Deserialize(second); return o; } ... }
And use it like this :XmlGZipSerializer xmls = new XmlGZipSerializer(typeof(Class1)); using (StreamWriter sw = new StreamWriter(path+".gz", false)) { xmls.Serialize(sw, c1); }
But there's a problem (cause if there wasn't i wouldn't have posted ;)) : when doing this i get a problem when unzipping (manually with winzip or when deserializing), saying that the XML document is not well formed. Example :instead of : But if in the Serialize method i add 'gzs.Close()' after 'base.Serialize(first, o);', the document is well formed. But i can't use this solution with 'using', cause when getting out of the using block i get an exception like : cant close a file already closed. The thing is i really need to use using blocks in my project, plus closing the stream in the serialize method is not "good". I tried to use the Flush() methods
-
VS2005: problem adding own controls to toolboxHi all, i'm currently working on a project in VS2005 : the solution contains many projects it is managed with sourcesafe, and we are many developpers working on it I developped some components for the project, and i have some problems with adding them to the toolbox. I tried the "choose toolbox items" window, that's okay to add controls from a dll, but i can't add controls contained within my main project because i get an error message like "conflict between reference xxx.exe imported file and xxx using directive" or something like that. Moreover i'd like that the other developpers could see my controls in their toolbox when they load the project from the source control. How can i do that ?