Posts

Showing posts from March, 2009

Infragistics.Win.ToolTip - determining whether or not the close button was clicked

Infragistics offers a nice-looking desktop alert control (more info here ). However, it is slightly lacking in terms of functionality, namely the ability to notify us when the close button was clicked, i.e. when the user is not interested in this particular announcement for whatever reason. Wanted: An event: DesktopAlertCloseButtonClicked. ... but since it's missing, here's how you do it: private Rectangle desktopAlertCloseRect; ... desktopAlert.DesktopAlertClosed += desktopAlert_DesktopAlertClosed; desktopAlertCloseRect = new Rectangle(   Screen.PrimaryScreen.Bounds.Width - 19,   Screen.PrimaryScreen.Bounds.Height - 110,   17, 17 ); ... private void desktopAlert_DesktopAlertClosed(object sender, DesktopAlertClosedEventArgs e) {   if(desktopAlertCloseRect.Contains(Cursor.Position))     //Close button was clicked } To resolve whether or not the alert closed due to the user clicking your link, simply attach an event handler to DesktopAlertLinkClicked where y

Managed Extensibility Framework

I'd say it took me about an hour to implement MEF, and then I spent most of it making my loadable modules look good in my form (I'm not an Art Designer...). Verdict: Love. A colleague and I are writing a Business Administration Application that will be shipped with one piece of functionality, but that we expect will grow over time. Thusly, I have converted it from a Main-Form-with-a-Child-Form piece of work (very tightly coupled) to a ... Main-form-that-can-load-"any"-module-into-its-UI solution. Changes: Added a reference to System.ComponentModel.Composition to my project Created a new Class Library ("Modules") with a single interface: "IModule" Referenced my Class Library project from my main project Revamped the Main(string[]) code:   Application.EnableVisualStyles();   Application.SetCompatibleTextRenderingDefault(false);   var mainForm = new ApplicationWindow();   var container = new CompositionContainer(new DirectoryCatalog(&qu

The danger in ALMOST working [agile|any methodology]

If you are to endaveour on a journey from a, say, waterfall-style project model to an agile one, it's EXTREMELY IMPORTANT that the people in your team - even if you have a big team - are with you on that journey. If not, individual team members can easilly just take the terms - "agile" - for example, apply their own logic and then presume that everyone else view the world like they do. Practical example: Today, a colleague of mine was working on a sprint backlog item when his project manager rushed in, saying "stop what you're doing! I have a production issue that you have to take care of". Said and done, my colleague dropped what he was doing and started working on the production issue. Moments later, a tester from anothter team came rushing to my colleague, and told him to help the tester with an issue; it was extremely important! My colleague, trying to follow scrum practices, asked the tester to talk to the project manager, so that they could weigh

An existing connection was forcibly closed by the remote host

... can be caused by the fact that your WCF service cannot receive more connections at the moment. As a default, a WCF service can receive 10 concurrent (session based) requests. If you are writing an internal WCF service (intranet, not internet) that has more than 10 constant consumers (consumers-with-a-session), you need to configure it accordingly: In system.serviceModel, add: <behaviors> <serviceBehaviors> <behavior name="ThrottleBehavior"> <serviceThrottling maxConcurrentCalls="6" maxConcurrentInstances="200" maxConcurrentSessions="200"/> </behavior> </serviceBehaviors> </behaviors> ... where maxConcurrentInstances/maxConcurrentSessions are the expected number of clients and maxConcurrentCalls are clients/100. On your service, add the attribute: behaviorConfiguration="ThrottleBehavior" I hope this saves you 6 hour