Git Product home page Git Product logo

easyprogressdialog_old's Introduction

(Original) Introduction

When developing Windows Forms applications, you (or at least I) typically implement your business classes, hook them up to your forms / UI classes, and only afterwards start thinking about the timing of your program and user experience - which processes are going to take a fraction of a second, which processes 5-10 seconds, and which processes are going to take a couple of minutes.

If you find that you do have processes that run longer than a second or two, you rapidly need to start thinking about threading (dedicated thread, threadpool, backgroundworker?), progress bars, the consequences to the rest of your UI while some thread is doing stuff and you display progress / status somewhere, etc.

Then, as you start to hook it all up, you (or at least I) realize that you will need to put all sorts of checks in the classes actually doing the work, and your code starts to feel "dirty" as your "work" code contains more and more concessions to progress display...

None of that should be required with a simple effective progress dialog solution. You should be able to just call a work method in your UI handler, and have your progress dialog automatically block the UI from the user, giving them an idea of what is going on and hopefully some control. This should be as little disruptive as possible to your existing code, and not require it to be aware of multiple UI classes.

You do a quick search for a simple-to-implement progress dialog solution in .Net, and find... nothing? Well, hopefully no longer! The simple dialog presented here should enable you to do just that - pass in a method, and the progress dialog will display until the method completes. Add some checkpoints in your work method, and your user can potentially cancel partway and/or see what is happening!

Here's an example "Action Shot":

Disclaimer / Caveat

These days, Microsoft is pushing asynchronous UI development pretty hard, and there are all sorts of frameworks and tutorials out there to help you make better UIs. The latest Outlook, for example, is a pleasure to use compared to its predecessors, primarily because of its higher responsiveness resulting from many minor async-handling additions. I must sadly admit that I simply haven't looked into this stuff at all yet. I'll update this area with better advice at some later time (although this looks promising). For now, I need to publih this to at a minimum support other projects that I'm checking in!

easyprogressdialog_old's People

Contributors

taok avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.