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


C# ErrorReporter.Report方法代码示例

本文整理汇总了C#中ErrorReporter.Report方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorReporter.Report方法的具体用法?C# ErrorReporter.Report怎么用?C# ErrorReporter.Report使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ErrorReporter的用法示例。


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

示例1: Main

		static int Main(string[] args)
		{
			CommandLineParser parser = new CommandLineParser( args );

			if (parser.RegistrationPath.Length == 0)
					parser.RegistrationPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(typeof(RegistrarApp)).Location);

			try
			{
				AssemblyRegistrar registrar = new AssemblyRegistrar( parser );

				if( parser.RegisterMode == CommandLineParser.InstallMode.Register )
					registrar.Register();
				else
				{
					try
					{
						registrar.UnRegister();
					}
					catch
					{
						// ignore the exception
					}
				}
				return (int) ReturnValue.Success;
			}
			catch( Exception ex )
			{
				System.Diagnostics.Debug.Assert(false, ex.Message);
				ErrorReporter reporter = new ErrorReporter(parser.RegistrationPath, parser.SilentMode);
				reporter.Report(ex.Message);
				return (int) ReturnValue.Failure;
			}
		}
开发者ID:killbug2004,项目名称:WSProf,代码行数:34,代码来源:RegistrarApp.cs

示例2: Report

 public void Report()
 {
     ExceptionForm form = new ExceptionForm(message, ex);
     if (form.ShowDialog(owner) == DialogResult.OK) {
         ErrorReporter reporter = new ErrorReporter();
         reporter.Report(ex);
     }
 }
开发者ID:xwiz,项目名称:WixEdit,代码行数:8,代码来源:ErrorReportHandler.cs

示例3: ImportFilesInComponent

        private void ImportFilesInComponent(TreeNode node, XmlNode componentNode, string[] files)
        {
            if (componentNode.Name == "Component")
            {
                bool mustExpand = (node.Nodes.Count == 0);

                CurrentTreeView.SuspendLayout();

                bool foundReg = false;
                foreach (string file in files)
                {
                    if (Path.GetExtension(file).ToLower() == ".reg")
                    {
                        foundReg = true;
                        break;
                    }
                }

                bool importRegistryFiles = false;
                if (foundReg == true)
                {
                    DialogResult result = MessageBox.Show(this, "Import Registry (*.reg) files to Registry elements?", "Import?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                    if (result == DialogResult.Cancel)
                    {
                        return;
                    }
                    else if (result == DialogResult.Yes)
                    {
                        importRegistryFiles = true;
                    }
                }

                WixFiles.UndoManager.BeginNewCommandRange();
                StringBuilder errorMessageBuilder = new StringBuilder();

                foreach (string file in files)
                {
                    FileInfo fileInfo = new FileInfo(file);
                    try
                    {
                        if (fileInfo.Extension.ToLower() == ".reg" && importRegistryFiles)
                        {
                            RegistryImport regImport = new RegistryImport(WixFiles, fileInfo, componentNode);
                            regImport.Import(node);
                        }
                        else
                        {
                            FileImport fileImport = new FileImport(WixFiles, fileInfo, componentNode);
                            fileImport.Import(node);
                        }
                    }
                    catch (WixEditException ex)
                    {
                        errorMessageBuilder.AppendFormat("{0} ({1})\r\n", fileInfo.Name, ex.Message);
                    }
                    catch (Exception ex)
                    {
                        string message = String.Format("An exception occured during the import of \"{0}\"! Please press OK to report this error to the WixEdit website, so this error can be fixed.", fileInfo.Name);
                        ExceptionForm form = new ExceptionForm(message, ex);
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            ErrorReporter reporter = new ErrorReporter();
                            reporter.Report(ex);
                        }
                    }
                }

                if (errorMessageBuilder.Length > 0)
                {
                    MessageBox.Show(this, "Import failed for the following files:\r\n\r\n" + errorMessageBuilder.ToString(), "Import failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                ShowNode(componentNode);

                if (mustExpand)
                {
                    node.Expand();
                }

                CurrentTreeView.ResumeLayout();
            }
        }
开发者ID:xwiz,项目名称:WixEdit,代码行数:82,代码来源:EditFilesPanel.cs

示例4: ReportError

		private void ReportError(string message)
		{
			ErrorReporter reporter = new ErrorReporter(m_parser.RegistrationPath, m_parser.SilentMode);
			reporter.Report(message);
		}
开发者ID:killbug2004,项目名称:WSProf,代码行数:5,代码来源:AssemblyRegistrar.cs


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