当前位置: 首页>>代码示例>>C#>>正文


C# ErrorEventArgs类代码示例

本文整理汇总了C#中ErrorEventArgs的典型用法代码示例。如果您正苦于以下问题:C# ErrorEventArgs类的具体用法?C# ErrorEventArgs怎么用?C# ErrorEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ErrorEventArgs类属于命名空间,在下文中一共展示了ErrorEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Instance_Error

        /// <summary>
        /// Handles the Error event of the Instance control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.IO.ErrorEventArgs"/> instance containing the event data.</param>
        private void Instance_Error(object sender, ErrorEventArgs e)
        {
            _messages.Add(WebStringHelper.EncodeForWebString(e.Message));
            ErrorMessages.DataSource = _messages;
            ErrorMessages.DataBind();

            Visible = _messages != null && _messages.Count > 0;
        }
开发者ID:radulazariciu,项目名称:Internship,代码行数:13,代码来源:ErrorModule.ascx.cs

示例2: OnError

 protected void OnError(object sender, ErrorEventArgs args)
 {
     var onError = Error;
     if (onError != null)
     {
         onError(sender, args);
     }
 }
开发者ID:wafe,项目名称:System.IO.Abstractions,代码行数:8,代码来源:FileSystemWatcherBase.cs

示例3: ErrorEventArgs_ctor_Null

        public void ErrorEventArgs_ctor_Null()
        {
            ErrorEventArgs args = new ErrorEventArgs(null);

            Assert.Null(args.GetException());

            // Make sure method is consistent.
            Assert.Null(args.GetException());
        }
开发者ID:ChuangYang,项目名称:corefx,代码行数:9,代码来源:Args.ErrorEventArgs.cs

示例4: CreateErrorEvent

	/// <summary>
	/// Creates the error event.
	/// </summary>
	/// <returns>The error event.</returns>
	/// <param name="code">Code.</param>
	public static IEvent	CreateErrorEvent(int error)
	{
		ErrorEventArgs v = new ErrorEventArgs();
		v.Code = error;

		return new IEvent(
			EngineEventType.EVENT_GLOBAL, CMD_ERROR, v
			);
	}
开发者ID:oathx,项目名称:Six,代码行数:14,代码来源:CmdEvent.cs

示例5: ValidateErrorEventArgs

    private static void ValidateErrorEventArgs(Exception exception)
    {
        ErrorEventArgs args = new ErrorEventArgs(exception);

        Assert.Equal(exception, args.GetException());

        // Make sure method is consistent.
        Assert.Equal(exception, args.GetException());
    }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:9,代码来源:ErrorEventArgs.unit.cs

示例6: ErrorEventArgs_ctor

        public void ErrorEventArgs_ctor()
        {
            Exception exception = new Exception();

            ErrorEventArgs args = new ErrorEventArgs(exception);

            Assert.Equal(exception, args.GetException());

            // Make sure method is consistent.
            Assert.Equal(exception, args.GetException());
        }
开发者ID:ChuangYang,项目名称:corefx,代码行数:11,代码来源:Args.ErrorEventArgs.cs

示例7: OnError

        public void OnError(ErrorEventArgs args)
        {
            bool raised = false;
            EventHandler<ErrorEventArgs> handler = (sender, e) => raised = e == args;
            var sut = new ExperimentSteps<string, string>();
            sut.OnErrorEvent += handler;
            sut.OnError(args);

            //Verify
            Assert.True(raised);
        }
开发者ID:josheinhorn,项目名称:weird-science,代码行数:11,代码来源:ExperimentStepsFacts.cs

示例8: InitializeIfNecessary

 /// <summary>
 /// If this namespace declaration has not yet been initialized, parse the source, set the containing nodes of the result
 /// and report any scanning and parsing errors via the host environment. This method is called whenever 
 /// </summary>
 /// <remarks>Not called in incremental scenarios</remarks>
 protected override void InitializeIfNecessary() {
   if (this.isInitialized) return;
   lock (GlobalLock.LockingObject) {
     if (this.isInitialized) return;
     //^ assume this.CompilationPart is CompilationPart; //The constructor ensures this
     SmallBasicCompilationPart cp = (SmallBasicCompilationPart)this.CompilationPart;
     Parser parser = new Parser(this.Compilation.NameTable, this.SourceLocation, new SmallBasicCompilerOptions(), cp.ScannerAndParserErrors); //TODO: get options from Compilation
     this.Parse(parser);
     this.SetContainingNodes();
     ErrorEventArgs errorEventArguments = new ErrorEventArgs(ErrorReporter.Instance, this.SourceLocation, cp.ScannerAndParserErrors.AsReadOnly());
     this.Compilation.HostEnvironment.ReportErrors(errorEventArguments);
     this.isInitialized = true;
   }
 }
开发者ID:mestriga,项目名称:Microsoft.CciSamples,代码行数:19,代码来源:NamespaceDeclarations.cs

示例9: InitializeIfNecessary

 protected override void InitializeIfNecessary()
   //^^ ensures this.members != null;
 {
   if (this.isInitialized) return;
   lock (GlobalLock.LockingObject) {
     if (this.isInitialized) return;
     //^ assume this.CompilationPart is SpecSharpCompilationPart; //The constructor ensures this
     SpecSharpCompilationPart cp = (SpecSharpCompilationPart)this.CompilationPart;
     Parser parser = new Parser(this.Compilation, this.SourceLocation, cp.ScannerAndParserErrors); //TODO: get options from Compilation
     this.Parse(parser);
     this.SetContainingNodes();
     ErrorEventArgs errorEventArguments = new ErrorEventArgs(ErrorReporter.Instance, this.SourceLocation, cp.ScannerAndParserErrors.AsReadOnly());
     this.Compilation.HostEnvironment.ReportErrors(errorEventArguments);
     errorEventArguments = new ErrorEventArgs(ErrorReporter.Instance, cp.UnpreprocessedDocument.SourceLocation, cp.PreprocessorErrors);
     this.Compilation.HostEnvironment.ReportErrors(errorEventArguments);
     this.isInitialized = true;
   }
 }
开发者ID:hesam,项目名称:SketchSharp,代码行数:18,代码来源:NamespaceDeclarations.cs

示例10: DownloadFile

 public bool DownloadFile(Uri uri, String fileName)
 {
     this.fileName = fileName;
     statusCode = "Unknown";
     contentLength = 0;
     try {
         WebRequest webRequest = HttpWebRequest.Create(uri);
         webRequest.BeginGetResponse(new AsyncCallback(requestCallBack), webRequest);
         State = ConnectState.Connect;
     } catch (Exception e) {
         Console.WriteLine(e);
         State = ConnectState.Failed;
         ErrorEventArgs args = new ErrorEventArgs();
         args.Message = e.Message;
         OnErrorOccurred(args);
         return false;
     }
     return true;
 }
开发者ID:khiraiwa,项目名称:psm-avi_movie_player,代码行数:19,代码来源:HttpRequestUtil.cs

示例11: OnSymbolInfo

        void OnSymbolInfo(object sender, SymbolInfoEventArgs e)
        {
            try
            {
                var symbols = e.Information
                               .Select(o => o.Name)
                               .ToArray();

                this.feed.Server.SubscribeToQuotes(symbols, 1);
            }
            catch(Exception ex)
            {
                var eh = this.Error;
                if (eh != null)
                {
                    var errEventArgs = new ErrorEventArgs(ex);
                    eh(this, errEventArgs);
                }
            }
        }
开发者ID:ifzz,项目名称:FDK,代码行数:20,代码来源:Manager.cs

示例12: onError

 private void onError(object sender, ErrorEventArgs e)
 {
     OnError (e);
 }
开发者ID:shinyboy,项目名称:websocket-sharp,代码行数:4,代码来源:WebSocketService.cs

示例13: OnError

 /// <summary>
 /// Is called when the inner <see cref="WebSocket"/> or current <see cref="WebSocketService"/>
 /// gets an error.
 /// </summary>
 /// <param name="e">
 /// An <see cref="ErrorEventArgs"/> that contains an event data associated with
 /// an inner <see cref="WebSocket.OnError"/> event.
 /// </param>
 protected virtual void OnError(ErrorEventArgs e)
 {
 }
开发者ID:shinyboy,项目名称:websocket-sharp,代码行数:11,代码来源:WebSocketService.cs

示例14: Socket_OnError

 private void Socket_OnError(object sender, ErrorEventArgs e)
 {
     LogHelper.Info("Koala数据传输异常");
     IsConnected = false;
     reset.Set();
 }
开发者ID:ysjr-2002,项目名称:QuickDoor,代码行数:6,代码来源:KoalaSocket.cs

示例15: Monitor_ErrorOccurred

 public void Monitor_ErrorOccurred(object sender, ErrorEventArgs e)
 {
     try
     {
         this.Invoke(new EventHandler<ErrorEventArgs>(Monitor_ErrorOccurredHandler), sender, e);
     }
     catch(Exception ex)
     {
         MessageBox.Show("Monitor_Error: " + ex.Message,
                         clsUtil.TituloAviso,
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Exclamation,                   
                         MessageBoxDefaultButton.Button1);
     }
 }
开发者ID:jmallqui,项目名称:SCT_DSD_DISTRIBUIDOS,代码行数:15,代码来源:frmMonitorBase.cs


注:本文中的ErrorEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。