Hello There, Guest!
View New Posts  |  View Today's Posts
[C#] Printer Monitor

  • 0 Vote(s) - 0 Average


01-28-2014, 04:11 PM #11
Lee Stevens
Senior Member
***
Posts: 345 Threads:54 Joined: Feb 2012 Reputation: 12

RE: Printer Monitor
What happens with these unregistered events?

Thank you KoBE. I've added this, lets see what happens :)

01-29-2014, 10:33 PM #12
KoBE
¯\_(ツ)_/¯
******
Global Moderators
Posts: 4,862 Threads:494 Joined: Jun 2011 Reputation: 67

RE: Printer Monitor
Quote:Until you unsubscribe from an event, the multicast delegate that underlies the event in the publishing object has a reference to the delegate that encapsulates the subscriber's event handler. As long as the publishing object holds that reference, garbage collection will not delete your subscriber object.
Source: http://msdn.microsoft.com/en-us/library/ms366768.aspx

Looks as though it just keeps the object reference alive. Not sure how the ManagementEventWatcher class handles the event itself so I'm not sure how much of an impact unregistering will make.

How did it go when you tested it?
This post was last modified: 01-29-2014, 10:34 PM by KoBE.

01-30-2014, 02:25 AM #13
Lee Stevens
Senior Member
***
Posts: 345 Threads:54 Joined: Feb 2012 Reputation: 12

RE: Printer Monitor
It still stops after a certain amount of hours i leave it open all day/night at work and it randomly stops so i just restart the application but its rather annoying because it's meant to monitor when im not there also :P

01-30-2014, 06:59 AM #14
AceInfinity
Developer
*******
Administrators
Posts: 9,733 Threads:1,026 Joined: Jun 2011 Reputation: 76

RE: Printer Monitor
Is there any event logs that can indicate a reason that may help you debug the issue?


Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer

Development Site: aceinfinity.net

 ▲
 ▲ ▲

01-30-2014, 07:17 PM #15
Lee Stevens
Senior Member
***
Posts: 345 Threads:54 Joined: Feb 2012 Reputation: 12

RE: Printer Monitor
Nothing is fired while debugging via VS

07-26-2014, 11:26 PM #16
AliGh66
Junior Member
**
Posts: 1 Threads:0 Joined: Jul 2014 Reputation: 0

RE: Printer Monitor
hi guys , can i have source code of this ?

im so confused in same project

THNX ;)

07-27-2014, 05:39 AM #17
Lee Stevens
Senior Member
***
Posts: 345 Threads:54 Joined: Feb 2012 Reputation: 12

RE: Printer Monitor
Hi Ali,

All the code you need is in this thread. Why don't you start a new thread with what you have and i'm sure we can help you out.

-Lee.




Forum Jump:


Possibly Related Threads...
Thread Author Replies Views Last Post
  Wireless Network Monitor KoBE 3 1,905 06-15-2015, 07:40 PM
Last Post: AceInfinity
  Print directly to printer on LX 300 dot matrix t0kneneng 9 6,382 06-12-2013, 05:01 PM
Last Post: AceInfinity
  Sending Raw Data to a printer in C# KoBE 2 4,000 06-06-2013, 10:58 PM
Last Post: KoBE


Users browsing this thread: 1 Guest(s)