Display information as gadget or winform NotifyIcon? - winforms

I am going to develop an application which will periodically query against an database and display the most updated scheduler/queue information for their product process.
My initial thought is that a gadget could do that, as the main function is to display information, and that information should be readily available most of the time without user intervention. But it seems that Microsoft discontinued gadget from a little bit reading. Should I worry about that and using winform NotifyIcon instead? It just occur to me that something like gadget is more simple and probably more user friendly due to its simplicity?
Or are there any other options I am not aware of? It will be a simple application to simplify business process, and I think it is safe to assume that the machine will be Windows 7.

I'd focus on the current desktop. Since your current target is Windows 7, I wouldn't worry too much about it. It seems quite unlikely that businesses would switch to Windows 8 en masse.
Besides, for Windows 8, you'd presumably want to make some kind of Metro app instead.

Related

Show windows form over locked screen

I'm developing an application to run in background. This application is used to capture user’s activity on their system. Application is working very fine.
Now, I need to display a windows form over locked screen. Just like this:
Can any one help me! How can I show any windows form over locked screen?
Not possible, for security reasons no application should be shown when the screen is locked.
The only thing remotely similiar might be a Kiosk App:
Is the Windows.ApplicationModel.LockScreen namespace available for non-kiosk use?
There are a few different things here that are probably confusing things. unfortunately they are not very common scenarios so documentation is lacking.
You can use the Windows.ApplicationModel.LockScreen namespace for customising the display of the lock screen. This can be used to change the wallpaper or notification counts. It is probably the most common form of lock screen customization as it can be done by any app.
You can also use the functionality in this namespace to create an alternative lock screen. This could have different behaviour to the process of swipe up and enter password/PIN or Microsoft Hello face detection.
Creating such an app and distributing through the store requires extra permissions than 3rd party developers typically have.
"Kiosk mode" apps are created as apps that run above the lock screen. Such apps have no real connection to lock screen replacements but are related in their use of similar underlying elements of the OS.
In terms of what you are trying to achieve, it sounds like you should be able to do this by declaring the windows.lockScreen extension and then using LockApplicationHost to do the actual unlocking. As mentioned above the lack of a way for 3rd parties to distribute such apps through the store means there is a lack of documentation in this area but it should be possible.
One thing to take note of in such an app is an under even greater memory/resource constraints than a typical app and so you should keep this in mind during your planning and development.
I know this is an old question but for anyone still looking:
It is a security risk don't do it.
If you still want to do it this could help: SampleHardwareEventCredentialprovider
You will have to play with WinAPI and CredentialProviders but it is working demo and will show simple windows dialog with a button at lockscreen

Global Settings & Commands - OO Design Patterns

I am currently building a WPF application and have some system wide settings. Where is the best place to store these settings? App.Config file, Database or some other sort of XML file? (need to read and write).
My other issue is the application has two states (i.e. Admin Mode, Client Mode) and depending on the state the application behaves differently i.e. (Shut Down, Restart, Lock, Unlock etc.) This seems like a good case to implement the State design pattern... but the issue I am facing is that the running application is itself the context class. I am a bit confused... should I be implementing the Singleton Pattern? How is this best implemented?
In general it is often easiest to store application settings using the Settings page of the Project Designer in Visual Studio. These settings can either be stored per user or per application. Either way, they can be saved easily by calling:
Properties.Settings.Default.Save();
They can be accessed similarly:
Properties.Settings.Default.FirstUserSetting = "abc";
You can find out full details by taking a look at the Managing Application Settings page on MSDN.
Regarding your second question, I would recommend using the State Design Pattern. Unfortunately, I didn't understand your problem with that, so please let me know what your issue is and I will try to address it.

Silverlight 4, Out of browser, Printing, Automatic updates

I have a very critial business application presently running using Winforms.
The application is a very core UI shell. It accepts input data, calls a webservice on my server to do the computation, displays the results on the winforms app and finally send a print stream to the printer.
Presently the application is deployed using Click-once.
Moving forward, I am trying to contemplate wheather I should move the application into a Silverlight application. Couple of reasons I am thinking silverlight.
Gives clients the feel that it is a cloud based solution.
Can be accessed from any PC. While the clickonce app is able to do this as well, they have to install an app, and when updates are available they have to click "Yes" to update.
The application presently has a drop down list of customers, this list has expanded to over 3000 records. Scrolling through the list is very painful. With Silverlight I am thinking of the auto complete ability.
Out of the browser - this will be handy for those users who use the app daily.
I haven't used Silverlight previous hence looking for some expert advice on a few things:
Printing - does silverlight allow sending raw print data to the printer. The application prints to a Zebra Thermal label printer. I have to send raw bytes to the printer with the commands. Can this be done with SL, or will it always prompt the "Print" dialog?
Out of browser - when SL apps are installed as out of browser, how to updates come through, does the app update automatically or is the user prompted to opt for update?
Printing -- using the PrintDocument API your user will be prompted for a print dialog. Currently using that API there is no way to suppress this. It isn't ideal for high-volume thermal situations (like pharmacies, shipping warehouses, etc.). You could use the trusted application mode and peek out into COM and do whatever you want with the printer.
The update happens when the application asks for it. There is an API to use and, once called, if an update exists it is downloaded -- no prompt to the user as an option. If an update is found you can alert the user to restart or that on the next restart they will have the updated application.
Autocomplete is not something that can only be done in Silverlight. Your ClickOnce app is already out-of-browser. And printing via raw bytes to a thermal printer is something that would not be easily engineered in Silverlight.
Not trying to sound negative, but in sum it sounds like you're better off simply working on enhancing the app that you already have.

How to switch users in a smooth way in a Point-Of-Sale system?

I am designing a Point-Of-Sale system for a small shop. The shop just have one Point-Of-Sale but often they are one to three users (sellers) in the shop. Each user have their own user account in the system so they login and logout very often. How should I design the login/logout system in a good way?
For the moment the users don't use passwords, because it takes so long time to type the password each time they login.
The Platform is Windows Vista but I would like to support Windows 7 too. We use Active Directory on the Network. The system is developed in Java/Swing for the moment, but I'm thinking about to change to C#.NET/WPF.
I am thinking about an SmartCard solution, but I don't know if that fits my situation. It would be more secure (which I like) but I don't know if it will be easy to implement and smooth to use, i.e. can I have the POS-system running in the background or started very quickly when the users switch? Are SmartCard solutions very expensive? (My customers are small shops) Is it preferred to use .NET or Java in a SmartCard solution?
What other solutions do I have other than passwords/no passwords/smartcards?
How should I design the login/logout system in a good way?
Is there any good solution using SmartCards for this purpose?
I would like suggested solutions both for C#.NET/WPF and Java/Swing platforms.
I would like suggested solutions both for Active Directory solutions and solutions that only use one user profile in Windows.
How is this problem solved in similar products? I have only seen password-solutions, but they are clumsy.
An interesting solution is to use "Fast User Switching", i.e. the capability to have multiple user sessions open on the same PC. The POS software could be launched through the Startup folder of each seller account and would stay active in each seller session.
I thought that being in a domain (i.e. using Active Directory) disables Fast User Switching, but according to The old new thing, this was true on XP only. I just checked with my Win7 machine at work: it is in a domain but still has the "switch user" menu item.
The main advantage is that if your software is already multi-user aware, you don't need to change it.
I should have made the Fast User Switching check before writing what is below, because this seems to be the simplest solution. Here are other ideas, anyway.
Another solution is what you mention of having a single Windows user but several "virtual users" that your application manages. A smart card is a good way to implement a pseudo-login. In C++, the API allows detecting the removal or insertion of a card, so the application could detect this and read the card after insertion to know who's currently in front of the computer. .NET can easily call this API through P/Invoke; I don't know much of Java, except that JNI could be a solution to call the native API if there is no managed library that publishes this capability.
What should be done is researching the different types of card and how to talk to them, as your app should use a card that does not require a PIN to be accessed (or you are back to the slow login system, except if tying a 4-digit number is not considered too slow).
I've seen restaurants where waiters insert a key into the cash register in order to be identified. I googled "cash registers" but could only find a complete solution package, rather than the components like a key reader.
An almost idiotic question is: how much security do you need ? Does it make sense to have big buttons on the first screen of the app, where people click in order to tell the system who they are ? When they are done, they click on a "Finish" button and the app goes back to the "identify" screen. I've put this at the end because it is so simplistic that it has a low probability of being useful.
I'm not familiar with a broad range of smart card provider solutions, but I know Gemalto has a .Net friendly setup. Most others are geared to Java, but support is widening.
With regards to switching user sessions and your application, it depends on how "heavy" your application is. If your app requires quite a bit of start-up time / resources then you might consider creating the basic application as a service on the machine which can run in the background continuously and then you can load a light-weight UI to interact with the service with each user session (maybe launch via Startup menu).
There is a C# project on CodeProject which provides a framework for interacting with smart card services in windows - might be interesting reading.
I had a chance to work with the Open Source Computer Vision library (OpenCV)
in one of my past projects and its "Face-Recognition" is what you're after. It is written using native code, but can be easily used with Java, .NET, Android, iOS. All you need is a webcam and a button "Switch User" with the onClickListener that will take a picture and compare it with the images of your employees. Advantage? Once the picture's taken, it gets processed in less than 10ms. And as Timores mentioned earlier, once the face is recognised, you simply switch the session. Simple yet effective solution. Good luck!
maybe you want to think about using barcode scanner... probably you already have this device on POS ... my software for bars and restaurants use barcode scanner to recognize users. You have 2 options for using: first, user must log in with own barcode card, then he can use the application ... the second is better, everyone can use application, but to print the receipt user must use barcode card. After then he is responsible for that amount on this receipt.

Silverlight printing

What are my options for printing in Silverlight 3? Assume I have this awesome Silverlight application/control that creates a graphical display of some data. Now the user wants to print it.
I have considered a few options but I have yet to test any of these. Before I do that I would like to get some feedback on how it can be done.
Use the browser printing capabilites. In my experience this is does not provide a useful print, but perhaps with some interaction between the Silverlight host and the browser it can be done?
Use WriteableBitmap. The image can either be written locally, but this requires interaction from the user, or sent to the server where a suitable file (e.g. PDF file) can be generated and then sent back to the browser. Unfortunately you now get the overhead of sending the image twice across the network and increased complexity on the server side.
Send XAML back to the server that is then rendered in a WPF application running on the server. The result is the sent back to the client. I'm not sure if this is possible at all however, but if it is the network overhead is less than in option 2. Unfortunately, the complexity on the server side is even higher.
Wait for Silverlight 4?
One thing I have considered is that my awesome control probably will have a ScrollViewer at the highest level, but the user will want to print the entire content of the control, not just whatever is visible inside the bounds of the ScrollViewer. How can I handle this added complexity?
In all seriousness, I think your best option is to wait until Silverlight 4 if your client can wait that long. I've seen a good bit of buzz about SL 4 supporting printing on twitter, though it's not official. I'd wait until PDC in a few weeks and see if any Silverlight bits trickle out to support printing.
Take a look at SmartPrint for Silverlight 3: http://www.smartwebcontrols.com/SmartPrintDetails.aspx
TBH I wouldn't use any of those options:-
Printing from the browser. Fine if you are printing say a chart or something else that scales well on a single sheet of paper. Rubbish for anything else especially where you have scrolled content.
WriteableBitmap. I can't see a client-side only solution being acceptable to the user "Please save this and then print it" message. It could be made to work bouncing off the server but would be bad for bandwidth use (bandwidth is import right? because in a well-connect intranet you wouldn't using Silverlight?).
Sending XAML to server for rendering. Really awkward it would be WPF XAML not SL XAML, where and how would you do the binding, why send XAML at all, since the server needs to be pretty much clued in on this so why can't it hold the XAML needed as well. Or were you thinking of sending just pure XAML with all the data needed? Still its a lot of plumbing needed in the SL that isn't actually related to SL.
Use Silverlight 4, its possible that in the not to distant future this would be the correct no-brainer choice (personally I wouldn't hold my breath) but right now SL4 doesn't exist.
A 5th option
Place report generating code on the server and have the Silverlight app inform the server of the data set required (not necessarily posting the data merely the criteria needed to access the correct set). In my experience direct prints of GUIs aren't particularly satisfactory when the user really needs a good printed form of the data.
Its true that at times the user just wants to quickly get some offline access to a grid of data as it looks there and then. In that situation users often find an export to spreadsheet compatible file preferable to printing, which would be possible from SL.
Something akin to number two is pretty much your best bet and is what I've seen done for printing in most Silverlight apps so far.
You can have the app send content for printing back to the web server (i.e. a new handler or query string parameters to a printing page) and pop up another page for the user to print web content from, or you could allow the user to download a file and have them print that.
Sliverlight 3 does not support printing.
If you can wait for silverlight 4, they have given it "high priority"
If not use Writeablebitmap: http://www.andybeaulieu.com/Home/tabid/67/EntryID/161/Default.aspx

Resources