Search Results

Search found 2 results on 1 pages for 'lurkerbelow'.

Page 1/1 | 1 

  • Single Responsibility Principle: Responsibility unknown

    - by lurkerbelow
    I store sessions in a SessionManager. The session manager has a dependency to ISessionPersister. SessionManager private readonly ISessionPersister sessionPersister; public SessionManager(ISessionPersister sessionPersister) { this.sessionPersister = sessionPersister; } ISessionPersister public interface ISessionPersister : IDisposable { void PersistSessions(Dictionary<string, ISession> sessions); } Q: If my application shuts down how / where do I call PersistSessions? Who is responsible? First Approach: Use Dispose in SessionManager protected virtual void Dispose(bool disposing) { if (disposing) { if (this.sessionPersister != null && this.sessionMap != null && this.sessionMap.Count > 0) { this.sessionPersister.PersistSessions(this.sessionMap); } } } Is that the way to go or are there any better solutions?

    Read the article

  • Is it possible to install and use a printer in Azure Worker Roles?

    - by lurkerbelow
    I'd like to know if it's possible to create and use a printer in Azure Worker Roles. I do know that I can install printers with basic batch commands. So I could define a batch script that would run as a startup task. something like: rundll32 printui.dll,PrintUIEntry /if /b "printer" /f %windir%\inf\ntprint.inf /r "file:" /m "printername") Question: Can I use a printer to print to file, maybe to local storage? I do need the function to print to file or atleast to have a printer installed, because I have to get the PCL output from different installed printers. Sadly I can not test it by myself. I do not have a CC to join the 90 days trial.

    Read the article

1