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


C# EventLog.EndInit方法代码示例

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


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

示例1: SystemEventLogging

 public SystemEventLogging()
 {
     _eventLog = new EventLog();
     _eventLog.BeginInit();
     _eventLog.Log = "ВИРД";
     _eventLog.Source = "ВИРД";
     _eventLog.EndInit();
 }
开发者ID:AlexSneg,项目名称:VIRD-1.0,代码行数:8,代码来源:SystemEventLogging.cs

示例2: EventLogWriter

 private EventLogWriter( )
 {
     evLog = new EventLog();
     evLog.BeginInit();
     evLog.Log = "Application";
     evLog.Source = "ShareIndexService";
     evLog.EndInit();
 }
开发者ID:BackupTheBerlios,项目名称:shareindex,代码行数:8,代码来源:Log.cs

示例3: LoadConfig

        public void LoadConfig(TailFileConfig tailConfig, string configPath)
        {
            try
            {
                _eventLog = new EventLog(tailConfig.FilePath);
                _eventLog.EntryWritten += new EntryWrittenEventHandler(_eventLog_EntryWritten);
                _eventLog.EndInit();
                if (_eventLog.Entries.Count == -1)
                    return; // Crazy check just to ensure we have permissions to read the log
            }
            catch (System.Security.SecurityException ex)
            {
                MessageBox.Show(this, "Access denied when opening log: " + tailConfig.FilePath + "\n\n" + ex.Message);
                Close();
                return;
            }

            _messageLookup = new EventLogMesageLookup(_eventLog);

            if (tailConfig.FormBackColor != null)
                _eventListView.BackColor = tailConfig.FormBackColor.Value;
            if (tailConfig.FormTextColor != null)
                _eventListView.ForeColor = tailConfig.FormTextColor.Value;

            if (tailConfig.FormFont != null)
            {
                _eventListView.Font = tailConfig.FormFont;
                _eventMessageText.Font = tailConfig.FormFont;
            }

            if (tailConfig.Title != null)
                _formTitle = tailConfig.Title;
            else
                _formTitle = "EventLog - " + _eventLog.LogDisplayName;

            TabPage parentTab = this.Tag as TabPage;
            if (parentTab != null)
                parentTab.Text = _formTitle;

            if (tailConfig.ColumnFilters != null)
            {
                foreach (List<string> filter in tailConfig.ColumnFilters)
                {
                    List<Regex> columnFilter = new List<Regex>();
                    foreach (string regexPattern in filter)
                    {
                        if (!string.IsNullOrEmpty(regexPattern))
                            columnFilter.Add(new Regex(regexPattern));
                        else
                            columnFilter.Add(null);
                    }
                    _columnFilters.Add(columnFilter);
                }
            }

            _filterActive = tailConfig.ColumnFilterActive;
            _displayTabIcon = tailConfig.DisplayTabIcon;

            if (Visible)
            {
                ConfigureColumnFilter(_filterActive);
            }
        }
开发者ID:efvb,项目名称:snaketail-net,代码行数:63,代码来源:EventLogForm.cs


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