本文整理汇总了C#中SessionEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SessionEventArgs类的具体用法?C# SessionEventArgs怎么用?C# SessionEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SessionEventArgs类属于命名空间,在下文中一共展示了SessionEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRequest
//Test On Request, intecept requests
//Read browser URL send back to proxy by the injection script in OnResponse event
public void OnRequest(object sender, SessionEventArgs e)
{
Console.WriteLine(e.ProxySession.Request.Url);
////read request headers
//var requestHeaders = e.ProxySession.Request.RequestHeaders;
//if ((e.RequestMethod.ToUpper() == "POST" || e.RequestMethod.ToUpper() == "PUT"))
//{
// //Get/Set request body bytes
// byte[] bodyBytes = e.GetRequestBody();
// e.SetRequestBody(bodyBytes);
// //Get/Set request body as string
// string bodyString = e.GetRequestBodyAsString();
// e.SetRequestBodyString(bodyString);
//}
////To cancel a request with a custom HTML content
////Filter URL
//if (e.ProxySession.Request.RequestUrl.Contains("google.com"))
//{
// e.Ok("<!DOCTYPE html><html><body><h1>Website Blocked</h1><p>Blocked by titanium web proxy.</p></body></html>");
//}
}
示例2: session_PlayTokenLost
void session_PlayTokenLost(ISession sender, SessionEventArgs e)
{
this.ParentForm.BeginInvoke(new MethodInvoker(delegate()
{
CF_displayMessage("Play token lost! What do we do???" + Environment.NewLine + e.Status.ToString() + Environment.NewLine + e.Message);
}));
}
示例3: session_MessageToUser
void session_MessageToUser(ISession sender, SessionEventArgs e)
{
this.ParentForm.BeginInvoke(new MethodInvoker(delegate()
{
CF_displayMessage(e.Message);
}));
}
示例4: session_Exception
void session_Exception(ISession sender, SessionEventArgs e)
{
this.ParentForm.BeginInvoke(new MethodInvoker(delegate()
{
WriteError(e.Message);
CF_displayMessage(e.Status.ToString() + Environment.NewLine + e.Message);
}));
}
示例5: Session
public void Session()
{
Mocks mocks = new Mocks();
SessionEventArgs s = new SessionEventArgs(mocks.Session.Object);
Assert.Equal(s.Session, mocks.Session.Object);
}
示例6: OnConnectionError
private void OnConnectionError(object sender, SessionEventArgs e)
{
if (e.Status != Error.OK)
{
_logger.Log("Connection error " + e.Message + "[" + e.Status + "]", Category.Exception, Priority.High);
}
else
{
_logger.Log("Connected", Category.Info, Priority.Low);
}
}
示例7: session_LoginComplete
void session_LoginComplete(ISession sender, SessionEventArgs e)
{
this.ParentForm.BeginInvoke(new MethodInvoker(() =>
{
if (e.Status != sp_error.OK)
{
CF_displayMessage("Login Failed: " + e.Status + Environment.NewLine + e.Message);
}
else
{
OnLoginComplete();
}
}));
}
示例8: OnResponse
//Test script injection
//Insert script to read the Browser URL and send it back to proxy
public void OnResponse(object sender, SessionEventArgs e)
{
////read response headers
// var responseHeaders = e.ProxySession.Response.ResponseHeaders;
//if (!e.ProxySession.Request.Hostname.Equals("medeczane.sgk.gov.tr")) return;
//if (e.RequestMethod == "GET" || e.RequestMethod == "POST")
//{
// if (e.ProxySession.Response.ResponseStatusCode == "200")
// {
// if (e.ProxySession.Response.ContentType.Trim().ToLower().Contains("text/html"))
// {
// string body = e.GetResponseBodyAsString();
// }
// }
//}
}
示例9: Dispose
private static void Dispose(TcpClient client, Stream clientStream, CustomBinaryReader clientStreamReader, StreamWriter clientStreamWriter, SessionEventArgs args)
{
if (args != null)
args.Dispose();
if (clientStreamReader != null)
clientStreamReader.Dispose();
if (clientStreamWriter != null)
clientStreamWriter.Dispose();
if (clientStream != null)
clientStream.Dispose();
if (client != null)
client.Close();
}
示例10: OnSessionStopPlayback
private void OnSessionStopPlayback(object sender, SessionEventArgs e)
{
_logger.Log("Session - Stop playback recevied", Category.Info, Priority.Low);
}
示例11: session_ConnectionError
void session_ConnectionError(ISession sender, SessionEventArgs e)
{
}
示例12: OnSessionEndOfTrack
private void OnSessionEndOfTrack(object sender, SessionEventArgs e)
{
if (Playlist.CanGoNext)
{
Playlist.Next();
}
}
示例13: OnSessionPlayerTokenLost
private void OnSessionPlayerTokenLost(object sender, SessionEventArgs e)
{
Pause();
_eventAggregator
.GetEvent<NotificationEvent>()
.Publish(new NotificationMessage("torshify has been paused because your account is used somewhere else"));
}
示例14: sessionClosed
public virtual void sessionClosed(SessionEventArgs e)
{
}
示例15: UserLoggedOut
private void UserLoggedOut(object sender, SessionEventArgs e)
{
ConsoleEx.WriteLine("Logged out..", ConsoleColor.Yellow);
}