本文整理汇总了C#中nsIRequest类的典型用法代码示例。如果您正苦于以下问题:C# nsIRequest类的具体用法?C# nsIRequest怎么用?C# nsIRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
nsIRequest类属于命名空间,在下文中一共展示了nsIRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WrapRequest
/// <summary>
/// Creates nsIRequest wrapper
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public static Request WrapRequest(nsIRequest request)
{
if (request is nsIChannel)
{
return Channel.WrapChannel((nsIChannel)request);
}
if (request is nsIAsyncStreamCopier)
{
return new AsyncStreamCopier((nsIAsyncStreamCopier)request);
}
if (request is nsILoadGroup)
{
return new LoadGroup((nsILoadGroup)request);
}
if (request is nsIIncrementalDownload)
{
return new IncrementalDownload((nsIIncrementalDownload)request);
}
if (request is imgIRequest)
{
return new ImgRequest((imgIRequest)request);
}
if (request is nsIInputStreamPump)
{
}
if (request is nsIURIChecker)
{
return new UriChecker((nsIURIChecker)request);
}
return new Request(request);
}
示例2:
Boolean nsIURIContentListener.DoContent(String aContentType, Boolean aIsContentPreferred, nsIRequest aRequest, out nsIStreamListener aContentHandler)
{
Trace.TraceInformation("nsIURIContentListener.DoContent: \"{0}\"", aContentType);
aContentHandler = null;
return false;
}
示例3:
bool nsIURIContentListener.doContent (string aContentType,
bool aIsContentPreferred,
nsIRequest aRequest,
out nsIStreamListener aContentHandler)
{
aContentHandler = null;
return true;
}
示例4:
void nsIRequestObserver.OnStopRequest( nsIRequest aRequest, nsISupports aContext, int aStatusCode )
{
var stopped = Stopped;
if (stopped != null)
{
stopped( this, EventArgs.Empty );
}
}
示例5: LocationChangeEventArgs
void nsIWebProgressListener.OnLocationChange(nsIWebProgress aWebProgress, nsIRequest aRequest, nsIURI aLocation)
{
Trace.TraceInformation("nsIWebProgressListener.OnLocationChange");
var e = new LocationChangeEventArgs(aLocation.ToUri());
Events.Raise(EventKey.LocationChange, e);
if (e.Cancel && (aRequest != null))
{
aRequest.Cancel(nsResult.NS_BINDING_ABORTED);
}
}
示例6: RequestProgressChangeEventArgs
void nsIWebProgressListener.OnProgressChange(nsIWebProgress aWebProgress, nsIRequest aRequest, Int32 aCurSelfProgress, Int32 aMaxSelfProgress, Int32 aCurTotalProgress, Int32 aMaxTotalProgress)
{
Trace.TraceInformation("nsIWebProgressListener.OnProgressChange");
var e = new RequestProgressChangeEventArgs(aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress);
Events.Raise(EventKey.RequestProgressChange, e);
if (e.Cancel && (aRequest != null))
{
aRequest.Cancel(nsResult.NS_BINDING_ABORTED);
}
}
示例7: RequestStatusChangeEventArgs
void nsIWebProgressListener.OnStatusChange(nsIWebProgress aWebProgress, nsIRequest aRequest, UInt32 aStatus, String aMessage)
{
Trace.TraceInformation("nsIWebProgressListener.OnStatusChange");
var e = new RequestStatusChangeEventArgs(aStatus, aMessage);
Events.Raise(EventKey.RequestStatusChange, e);
if (e.Cancel && (aRequest != null))
{
aRequest.Cancel(nsResult.NS_BINDING_ABORTED);
}
}
示例8: GeckoResponse
internal GeckoResponse(nsIRequest request)
{
// we use only one wrapper
_request = Request.WrapRequest( request );
if ( _request is Channel )
{
_channel = ( Channel ) _request;
if ( _channel is HttpChannel )
{
_httpChannel = ( HttpChannel ) _channel;
}
}
}
示例9: OnProgressChange
public void OnProgressChange(nsIWebProgress webProgress, nsIRequest request, int currentSelfProgress,
int maxSelfProgress,
int currentTotalProgress, int maxTotalProgress)
{
if (maxTotalProgress == 0)
return;
// if we use the maxTotalProgress, the problem is that it starts off below 100, the jumps to 100 at the end
// so it looks a lot better to just always scale, to 100, the current progress by the max at that point
RaiseStatusChanged(new PdfMakingStatus()
{
percentage = (int) (100.0*(currentTotalProgress)/maxTotalProgress),
statusLabel = Status
});
}
示例10: OnStateChange
public void OnStateChange(nsIWebProgress aWebProgress, nsIRequest aRequest, uint aStateFlags, int aStatus)
{
_finished = (aStateFlags & nsIWebProgressListenerConstants.STATE_STOP) != 0;
}
示例11: OnSecurityChange
public void OnSecurityChange(nsIWebProgress aWebProgress, nsIRequest aRequest, uint aState)
{
}
示例12: OnLocationChange
public void OnLocationChange(nsIWebProgress aWebProgress, nsIRequest aRequest, nsIURI aLocation, uint aFlags)
{
}
示例13: OnStatusChange
public void OnStatusChange(nsIWebProgress aWebProgress, nsIRequest aRequest, int aStatus, string aMessage)
{
}
示例14: OnProgressChange
public void OnProgressChange(nsIWebProgress aWebProgress, nsIRequest aRequest, int aCurSelfProgress, int aMaxSelfProgress, int aCurTotalProgress, int aMaxTotalProgress)
{
}
示例15: OnStatusChange
private void OnStatusChange( nsIWebProgress aWebProgress, nsIRequest aRequest, int aStatus, string aMessage )
{
if (!_isListening) return;
var evnt = _onStatusChangeCallback;
if ( evnt != null ) evnt( aMessage );
}