|
OOPS, it's a typing mistake. Thanks for pointing that.
|
|
|
|
|
Thanks N a v a n e e t h,
Sorry I have to use .NET 2.0 in current application.
My purpose is, I want the thread which holds the read lock, continue to hold the write lock after lock upgrade. I think ReaderWriterLock class is not suitable, since when we upgrade the read lock, the current thread will be appended to the last of the writer queue, and reader will proceed to acquire the lock, and then read will proceed to run, right?
regards,
George
|
|
|
|
|
George_George wrote: then read will proceed to run, right?
Yes. If there is no pending read requests, immediately write lock will be granted. ReaderWriterLock class alternates between read and write lock.
George_George wrote: I want the thread which holds the read lock, continue to hold the write lock after lock upgrade
I think you should go with a manual locking using the lock keyword. It would be tough to implement, but you are not limited to something like ReaderWriter.
|
|
|
|
|
Thanks N a v a n e e t h,
The only two cases when exception will be thrown in all operations of ReaderWriterLock are, right?
http://msdn2.microsoft.com/en-us/library/system.threading.readerwriterlock(VS.80).aspx[^]
1.
If the time-out interval expires and the lock request has not been granted, the method returns control to the calling thread by throwing an ApplicationException. A thread can catch this exception and determine what action to take next.
2.
If you specify a TimeSpan that represents a negative number of milliseconds other than -1, ArgumentOutOfRangeException is thrown.
regards,
George
|
|
|
|
|
The window consists of 5 buttons. When the window loads, it checks the .key file whether the buttons to be visible. The form start position is defaulted to center screen.
Let's take the scenario:
3 buttons would not be visible,
the window shrinks by 169 (pixels?) horizontally.
This has resulted that the form window to be off center on the screen.
Now the question is:
How the heck do I refresh its position after the form size has changed?
|
|
|
|
|
Oh never mind... I've got it.
Gotta do this BEFORE the form becomes visible (loaded) so it would be centered as it should.
|
|
|
|
|
Use System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height/Width and do the math.
like (screen width/2) - (window.width/2) and do the same for the vertical dimension...
Hey, thanks for sharing your answer when you found it mate!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hey guys, I am writing a windows c# services that monitors servers and determines if the server is up or down based on whether or not it checks in. If one of the servers doesn't check in, the service needs to place a call to the tech on duty. What would I need to use to make a call in c#?
Thanks in advance,
Travis
|
|
|
|
|
tcombs07 wrote: What would I need to use to make a call in c#?
You can use TAPI.
|
|
|
|
|
I have doubt from ur TAPI?
how can u use the normal .net framework application TAPI?
|
|
|
|
|
You could buy a gprs wavecom modem. Wavecom Fastrack Supreme StarterKit[^]
Stick yourself a mobile SIM card in it, and then send out SMS messages to whoever the tech guy on call.
Then it would just be a case of using: "System.IO.Ports.SerialPort" to write the sms command to it.
Failing that you could just buy this activesms toolkit: http://www.activexperts.com/activsms/[^]. The instruction on how to send a sms message using c# look easy enough. http://www.activexperts.com/xmstoolkit/howto/mm1/vcnet/[^]
This will allow you to send/recieve sms messages to your wavecom, so you could get your tech guy to reply to the sms message to acknowledge he has recieved it.
|
|
|
|
|
If the tech uses a cell phone and the server has internet access, you can just send an sms message or email. If that's the case, then check out the API's that the service provider has.
|
|
|
|
|
tcombs07 wrote: How to make a phone call?
First, pick up the phone....
(sorry, couldn't resist)
|
|
|
|
|
lol
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Yes
i have mananged dll for that
|
|
|
|
|
I would be very interested in getting that dll you have to do this? would that be at all possible?
Thanks,
Travis
|
|
|
|
|
I'm also would like give free,but it's have some probs.
if want to any information email me to vrrave@yahoo.com
|
|
|
|
|
Hiya all,
I was wondering if someone could tell me whether i can define the maximum number of rows for a ListView. I am using the ListView in detail mode and would like a maximum of 1000 rows. When i insert the 1001 row i would like the first row inserted to be deleted.
thanks in advance
|
|
|
|
|
ahh i think i got it!
When i add a new row to the list control i have also added some code that checks the number of rows currently in the list. If its = to a 1000 then i delete the 1000th row!
Code looks something similar to this:
if (UpdateList.Items.Count > 10)
UpdateList.Items.RemoveAt(10);
|
|
|
|
|
|
Hello everyone,
For the Dispose pattern, here is what MSDN mentioned,
http://msdn2.microsoft.com/en-us/library/b1yfkh5e(VS.80).aspx
--------------------
Implement the dispose design pattern on a base type that commonly has derived types that hold onto resources, even if the base type does not.
--------------------
Could anyone let me know what means "on a base type that commonly has derived types that hold onto resources" and "the base type does not"? Could anyone show some pseudo code please?
thanks in advance,
George
|
|
|
|
|
George_George wrote: Implement the dispose design pattern on a base type that commonly has derived types that hold onto resources, even if the base type does not.
You will be implementing the IDisposable on the base class and allowing all child classes to override the Dispose(bool disposing) method.
Assume you are creating a windows form that has extra functionalities than the classical windows form. So you will create a new class which inherits from "Form" class. Here you won't implement IDisposable again because the base class already implemented it. You can override the dispose method in your class and clan up the resources created by your class. Call base classes dispose to release it's resources at last.
|
|
|
|
|
Thanks N a v a n e e t h,
I want to confirm with you, the Dispose() method from IDisposable interface is not virtual, and the customized method Dispose (bool) is virtual and we should override Dispose (bool) in Dispose pattern, right?
regards,
George
|
|
|
|
|
Yes. Dispose(bool) can be overridden in the subclass.
|
|
|
|
|
Thanks N a v a n e e t h,
But why "do not implement a Finalize method on the base type" as mentioned in MSDN? Any issues if we implement Finalize on both base, derived and most derived types?
regards,
George
|
|
|
|