本文整理汇总了C#中WebBrowser类的典型用法代码示例。如果您正苦于以下问题:C# WebBrowser类的具体用法?C# WebBrowser怎么用?C# WebBrowser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebBrowser类属于命名空间,在下文中一共展示了WebBrowser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WindowCollection
public WindowCollection (WebBrowser control, nsIDOMWindowCollection windowCol) : base (control)
{
if (control.platform != control.enginePlatform)
unmanagedWindows = nsDOMWindowCollection.GetProxy (control, windowCol);
else
unmanagedWindows = windowCol;
}
示例2: NativeExecution
public NativeExecution(ref WebBrowser browser)
{
this.webBrowser = browser;
this.commands = new Dictionary<string, PhoneGapCommand>
{
// TODO: These need to be included based on plugin configuration
{ "Accelerometer.GetCurrentAcceleration", new Plugins.Accelerometer.GetCurrentAccelerationCommand() },
{ "Camera.GetPicture", new Plugins.Camera.GetPictureCommand() },
{ "DebugConsole.debug", new Plugins.DebugConsole.DebugCommand() },
{ "Device.GetAll", new Plugins.Device.GetAllCommand() },
{ "Geolocation.GetCurrentPosition", new Plugins.Geolocation.GetCurrentPositionCommand() },
{ "Network.IsReachable", new Plugins.Network.IsReachableCommand() },
{ "Notification.Alert", new Plugins.Notification.AlertCommand() },
{ "Notification.Beep", new Plugins.Notification.BeepCommand() },
{ "Notification.Vibrate", new Plugins.Notification.VibrateCommand() },
{ "Orientation.GetCurrentOrientation", new Plugins.Orientation.GetCurrentOrientationCommand() },
{ "Orientation.ClearWatch", new Plugins.Orientation.ClearWatchCommmand() },
{ "Orientation.WatchOrientation", new Plugins.Orientation.WatchOrientationCommmand() },
{ "Send.Sms", new Plugins.Sms.SendCommand() },
{ "Telephony.CallNumber", new Plugins.Telephony.CallCommand() }
};
this.watchers = new Watchers();
}
示例3: AcquireToken
/// <summary>
/// Worker method to acquire, refresh a token
/// this method will show a browser as needed to
/// complete the authentication flow
/// </summary>
/// <param name="browser"></param>
/// <returns></returns>
public Task<string> AcquireToken(WebBrowser browser)
{
_Browser = browser;
_TCS = new TaskCompletionSource<string>();
//Check if existing token has expired, if so try refresh
if (_AuthContext.IsAccessTokenExpired())
{
//If expired and we have a refresh token, try that
if (_AuthContext.IsRefreshViable())
{
GetRefreshToken();
}
else
{
//Start the flow from the top with the user providing credentials
NavigateBrowserToAuthScreen();
}
}
else
{
_TCS.SetResult(_AuthContext.AccessToken);
}
return _TCS.Task;
}
示例4: btnGetBotToken_Click
private void btnGetBotToken_Click(object sender, EventArgs e)
{
WebBrowser botBrowser = new WebBrowser();
botBrowser.Show();
botBrowser.Pattern = "tmi/#access_token(\\w+)";
botBrowser.Browser.Navigate("https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id=q6batx0epp608isickayubi39itsckt&redirect_uri=http%3A%2F%2Ftwitchapps.com%2Ftmi%2F&scope=chat_login");
}
示例5: Init
public void Init(WebBrowser browser, PhoneApplicationPage appMainPage)
{
initAppUrls();
RhoLogger.InitRhoLog();
LOG.INFO("Init");
CRhoFile.recursiveCreateDir(CFilePath.join(getBlobsDirPath()," "));
m_webBrowser = browser;
m_appMainPage = appMainPage;
m_appMainPage.ApplicationBar = null;
m_httpServer = new CHttpServer(CFilePath.join(getRhoRootPath(), "apps"));
CRhoResourceMap.deployContent();
RhoRuby.Init(m_webBrowser);
DBAdapter.initAttrManager();
LOG.INFO("Starting sync engine...");
SyncThread sync = null;
try{
sync = SyncThread.Create();
}catch(Exception exc){
LOG.ERROR("Create sync failed.", exc);
}
if (sync != null) {
//sync.setStatusListener(this);
}
RhoRuby.InitApp();
RhoRuby.call_config_conflicts();
RHOCONF().conflictsResolved();
}
示例6: SetupExitAppDispatcher
private static void SetupExitAppDispatcher(WebBrowser browser) {
browser.ScriptNotify += (sender, e) => {
if(e.Value == "DevExpress.ExitApp") {
Application.Current.Terminate();
}
};
}
示例7: MainWindow
public MainWindow()
{
InitializeComponent();
// Create instances of UserControls
startScreen = new StartScreen();
newsPage = new NewsPage();
faculty = new Faculty();
events = new Events();
browser = new WebBrowser();
faculty.loadXmlDoc();
// Show the startScreen
pageTransitionControl.ShowPage(startScreen);
//pageTransitionControl.ShowPage(faculty);
//Initialize the Kinect gesture engine
GestureEngine gestEngine = new GestureEngine();
gestEngine.reset();
gestEngine.init();
//adds an event handler to the event that a new gesture is done
gestEngine.GestureChanged += new ElementFlowTest.GestureEngine.NewGestureEventHandler(gestEngine_GestureChanged);
}
示例8: NodeList
public NodeList(WebBrowser control, nsIDOMNodeList nodeList) : base (control)
{
if (control.platform != control.enginePlatform)
unmanagedNodes = nsDOMNodeList.GetProxy (control, nodeList);
else
unmanagedNodes = nodeList;
}
示例9: ChannelAPI
// CONSTRUCTOR
public ChannelAPI(CollabrifyClient c, LoadCompletedEventHandler del = null)
{
Debug.WriteLine(LOG_TAG + ": building ChannelAPI.");
mChannelClosed = true;
client = c;
// Builds the browser object
try
{
browser = new WebBrowser();
browser.IsScriptEnabled = true;
browser.ScriptNotify += ScriptCallback;
browser.LoadCompleted += delegate { };
if(del != null) browser.LoadCompleted += del;
}
catch( Exception ex)
{
Debug.WriteLine(LOG_TAG + ": " + ex.Source);
Debug.WriteLine("\t" + ex.Message);
}
string html = null;
using (var s = Assembly.GetExecutingAssembly().GetManifestResourceStream("Collabrify_wp8.Resources.home.html"))
using (var r = new StreamReader(s))
html = r.ReadToEnd();
browser.NavigateToString(html);
}
示例10: Capture
protected void Capture(object sender, EventArgs e)
{
string url = txtUrl.Text.Trim();
Thread thread = new Thread(delegate()
{
using (WebBrowser browser = new WebBrowser())
{
browser.ScrollBarsEnabled = false;
browser.AllowNavigation = false;
browser.AllowWebBrowserDrop = false;
browser.ScriptErrorsSuppressed = true;
browser.Navigate("www.cnn.com");
//browser.Navigate((url, null, <data>, "Content-Type: application/x-www-form-urlencoded");)
browser.Width = 1024;
browser.Height = 768;
browser.ClientSize = new Size(1024,768);
browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(DownloadCompleted);
while ((browser.IsBusy) | (browser.ReadyState != WebBrowserReadyState.Complete))
{
System.Windows.Forms.Application.DoEvents();
}
//Thread.Sleep(5000);
//browser.Dispose();
}
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
}
示例11: Attribute
public Attribute (WebBrowser control, nsIDOMAttr domAttribute)
: base (control, domAttribute as nsIDOMNode)
{
if (control.platform != control.enginePlatform)
this.attribute = nsDOMAttr.GetProxy (control, domAttribute);
else
this.attribute = domAttribute;
}
示例12: DOMObject
internal DOMObject (WebBrowser control)
{
this.control = control;
IntPtr p = Base.StringInit ();
storage = new HandleRef (this, p);
resources = new Hashtable ();
event_handlers = null;
}
示例13: DOMImplementation
public DOMImplementation(WebBrowser control, nsIDOMDOMImplementation domImpl) : base (control)
{
if (control.platform != control.enginePlatform)
unmanagedDomImpl = nsDOMDOMImplementation.GetProxy (control, domImpl);
else
unmanagedDomImpl = domImpl;
hashcode = unmanagedDomImpl.GetHashCode ();
}
示例14: GetAppLinkFromUrlInBackground
public void GetAppLinkFromUrlInBackground(Uri uri)
{
appLinkCrawlerBrowser = new WebBrowser();
appLinkCrawlerBrowser.IsScriptEnabled = true;
appLinkCrawlerBrowser.ScriptNotify += AppLinkCrawlerBrowserOnScriptNotify;
appLinkCrawlerBrowser.LoadCompleted += AppLinkCrawlerBrowserOnLoadCompleted;
appLinkCrawlerBrowser.Navigate(uri);
}
示例15: Stylesheet
public Stylesheet(WebBrowser control, nsIDOMStyleSheet stylesheet) : base (control)
{
if (control.platform != control.enginePlatform)
unmanagedStyle = nsDOMStyleSheet.GetProxy (control, stylesheet);
else
unmanagedStyle = stylesheet;
hashcode = unmanagedStyle.GetHashCode ();
}