WebBrowser控件的用户界面 [英] WebBrowser control as User Interface

查看:126
本文介绍了WebBrowser控件的用户界面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一是一些定义,以保持事情说清楚。

First a few definitions to keep things clear.

网友:一个活生生的人,利用该软件

User: A live person, using the software

客户端:即支付我们的软件为他们的用户提供特定版本的公司

Client: A company that is paying for a customized version of our software for their users.

目前,我们正在将需要根据其客户端用户所属的用户界面显著改变了一些应用程序。我们目前有一个单独的构建为每个客户端,但随着客户数量的增加,它变得更加的痛苦来管理所有的独立版本的。

We currently have a few applications that are going to require significant changes in the user interface based on which client the user belongs to. We currently have a separate build for each client, but as the number of clients increase, it's becoming more of a pain to manage all of those separate releases.

我的目标是要切换到可以自定义动态的基础上是谁登录。一个通用的客户端由于我们的软件需要互联网连接反正(使用web服务广泛地)我只是在.NET中使用WebBrowser控件和考虑允许其(经由ObjectForScripting)相互作用与计算机上所需的硬件

My goal is to switch to a single generic client that can be customized dynamically based on who is logging in. Since our software requires an internet connection anyway (uses webservices extensively) I was contemplating just using a WebBrowser control in .NET and allowing it to interact (via ObjectForScripting) with the required hardware on the computer.

然后整个用户接口是用HTML / JavaScript和存储使分发和维护的新用户界面的琐碎在服务器上。通用客户端是多一点的话,它知道如何与我们的硬件设备,可以说通过JavaScript这样做,自定义Web浏览器。

Then the entire user interface is written in HTML/JavaScript and stored on the server making distribution and maintenance of new user interfaces trivial. The generic client is little more then a custom web browser that knows how to talk to our hardware devices and can be told to do so through javascript.

我看到了很多的优势,这种做法并没有太多的缺点。我在想什么?我为什么不能走这个方向?

I'm seeing a lot of advantages to this approach and not too many disadvantages. What am I missing? Why should I NOT go this direction?

推荐答案

有一些商业应用,在那里,使用这种方法成功。下面是一些注意事项要牢记。这些不应该尝试的方法反正阻止你。要问自己一个重要的问题,虽然是应用程序是否能够成为一个本地网络应用程序来代替。

There are some commercial applications out there that use this approach successfully. The following are some considerations to keep in mind. These shouldn't stop you from attempting the approach anyway. A key question to ask yourself, though, is whether the app could be a native web app instead.

  • Web浏览器控件吃卡。您可以使用Tab键将输入焦点到从托管应用程序的浏览器控件,但你不能选项卡的出路它(除非你code对于显式)

  • The web browser control "eats tabs". You can use the tab key to move the input focus into the browser control from the hosting application, but you cannot tab your way out of it (unless you code for that explicitly)

HTML / JavaScript的应用程序是单线程的。如果您需要任何后台处理,则可能需要委派任务的托管应用程序。

HTML/Javascript apps are single threaded. If you need any background processing, you may need to delegate that task to the hosting app.

如果在Web浏览器控件中出现的错误,他们被视为脚本错误,并包含在控制内。安全壳是一件好事。但是,你甚至可能没有意识到已经在构建/调试时发生错误。

If error conditions occur inside the web browser control, they are treated as script errors, and are contained inside the control. The containment is a good thing. But you might not even realize an error condition has occurred while building/debugging.

如果没有网络连接,用户能看到浏览器的失败页面。你没有得到preempt的,并显示您自己的消息。

If there's no network connectivity, users get to see the browser's failure page. You don't get to preempt that and show your own message.

根据您的应用程序,它是如何实现的,导航看起来较为低迷比在桌面应用程序常用。页面重新加载尤其如此。谨慎使用异步AJAX可以帮助减轻一些的或全部。

Depending on your application and how it is implemented, navigation may seem more sluggish than is common in desktop apps. Page reloads in particular. Careful use of asynchronous AJAX can help alleviate some or all of that.

你的用户会知道他们正在使用的网页。 UI设计本身并不能掩盖这一事实。响应性和偶发故障会披露这一事实。为您这可能会或可能不会成为一个问题。

Your users will know they are working with a web page. UI design alone will not be able to hide that fact. The responsiveness and the occasional failure will disclose that fact. This may or may not be an issue for you.

您的应用程序必须支持多个版本的浏览器。在.NET Web浏览器控件是在互联网浏览器执行用户机器上的包装。这将是IE6,7,8,等等。这取决于什么安装在那里。

Your application will have to support several browser versions. The .NET web browser control is a wrapper around the Internet Explorer implementation on the user's machine. That would be IE6, 7, 8, etc. depending on what's installed there.

这篇关于WebBrowser控件的用户界面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆