|
|
Ok, so I have a number of ‘modes’ for a control I wrote (List View: Detail, Large Icon, and so on). In the designer it is convenient to have an enumerator drop down, consisting of these modes, which a user can select. However, each mode is actually a subclass. So, I was wondering if there is some cool and/or strange way to have an enumerator that contains all subclasses found in the assembly/dlls. This would allow someone to add a new subclass with out also editing the enumerator containing the names of all the subclasses. Yes/No/Thoughts?
|
|
|
|
|
It is possible to do this using Reflection. Use the GetTypes() method on the Assembly class, iterate through the types and filter subclasses using the Type.IsSubClassOf() function.
Regards
Senthil
|
|
|
|
|
Does anyone know if it's possible to provide a command line switch to make the .NET framework install silently ? Also, does anyone know where ( presumably in the registry ) to check what versions are already installed ?
Thanks
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
if it's possible to provide a command line switch to make the .NET framework install silently
No it's not (as far as I know, but I already researched this before.)
Christian Graus wrote:
where ( presumably in the registry ) to check what versions are already installed
Check the folders in C:\Windows\Microsoft .NET\Framkework\v1.xx.xxxx . 1.1.4322 is 1.1 SP1, for example... and 1.0.3705 is 1.0 SP1 (not really sure on that one, but Heath mentioned it in this same forum some days ago.)
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Please suggest how to convert DateTime.Now to FILETIME structure format?
Sandeep Naik
|
|
|
|
|
Hi Sandeep
Guess you can use DateTime.Now.ToFileTime(); method.
Thanks
SGS
|
|
|
|
|
DateTime.Now.ToFileTime() returns long.. FILETIME is structure. Pls let me if you have someother idea
Sandeep Naik
|
|
|
|
|
Hello there, I have code that's something like
lock ( this )<br />
{<br />
bKeepTrying = true;<br />
while ( bKeepTrying && watcher.EnableRaisingEvents )<br />
{<br />
try<br />
{<br />
ReadAndProcessFiles(...);<br />
<br />
bKeepTrying = false;<br />
}<br />
catch( IOException )<br />
{<br />
myLog.Info( "Waiting for files to finish copying... retrying in 5 seconds..." );<br />
Thread.Sleep( 5000 );<br />
}<br />
catch ( Exception e )<br />
{<br />
myLog.Error( "Error processing files.", e );<br />
}<br />
}<br />
}
And it's weird because I suddenly encountered an error with this stack trace:
The process cannot access the file "\\data\data1.raf" because it is being used by another process.<br />
at System.IO.__Error.WinIOError(Int32 errorCode, String str)<br />
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy)<br />
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)<br />
at System.IO.File.OpenRead(String path)<br />
at MyProject.ParseFile(String sFile)
It's my first time encountering an error that is could not be handled by exception handlers. Any idea how this happened and how to fix/avoid this?
Thanks so much!
~Rafferty
|
|
|
|
|
There are two way to avoid this error.
1) Close your file imeediatly once your worjk get finish.
2) Use StreamWriter instead of File object
Hope issue resolved.
Thanks
Nadir Riyani
|
|
|
|
|
Hi,
How to get familiarize with VisualC#/.Net classes and functions?
Are there any Hierarchy charts like MFC?
Thanks
Vinay.
|
|
|
|
|
Here's[^] a listing of all the namespaces in the library. I couldn't find a hierarchy chart -- perhaps it would be way too large to show.
I would start with becoming very familiar with the .NET language you want to use. Then choose a specific type of app you want to develop (Windows or web) and begin looking at online tutorials for those. Books may also help.
Regards,
Alvaro
You know what they say about arguing over the Internet...
|
|
|
|
|
Is swithching from winforms to webforms and viceversa is a simple task or does it have it's own learning curve?
Let us say, I have a simple GUI like calculator in Winforms. Can I convert the GUI of calculator into webform(assume the logic is provided by some server).
Thanks
Vinay
|
|
|
|
|
No way. Windows Forms concepts don't map directly to Web Forms. Yes, Web Forms has it's own learning curve.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
If you buy VS.NET, you get posters with class heirarchies on them
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
|
I have a user control that consists of a panel and one label. I am doing custom drawing on the panel. I basically want the user control to be able to return key information when ever the app that is using it requests it (such as on mouse events). My problem is, when I add the user control to my application form, the mouse events are never fired. I'm guessing this is because the events are actually happening on the panel which is on the control, instead of the control itself.
Is there any way to pass along events to the parent control so that my app can catch them?
I'm completely at a loss at the moment
|
|
|
|
|
Declare the events you need (and the delegate signatures, argument classes for them) in your user control. call a method to fire these events from your user control from the usercontrols handler for the panel events (or its events).
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
I have a System.Web.UI.HtmlTable . When I set the border color to black, everything appears as I would have expected. However, when I set the width or height, the bottom border disappears. Any ideas?
Cheers,
Jim
|
|
|
|
|
How make a program in C# which connect any URL(like www.google.com)and when user click on button(whatever enter on the textbox like(www.google.com))it open the page.
|
|
|
|
|
<br />
System.Diagnostics.ProcessStartInfo pi =new System.Diagnostics.ProcessStartInfo(this.website.Text);<br />
System.Diagnostics.Process p = new System.Diagnostics.Process();<br />
p.StartInfo = pi;<br />
p.Start();<br />
This works as long as it starts with www or http://. However, this is open to exploitation, so filtering may be in order.
Also, website is a textbox.
|
|
|
|
|
Use ShellExecute to open the page, You need to pass which application to open the page and the url
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
put this code in button click or under menu click
System.Diagnostics.Process.Start("http://www.google.ba");
|
|
|
|
|
Thanks to everyone.
I also did in another way.
|
|
|
|