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


C# ISupportInitialize.BeginInit方法代码示例

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


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

示例1:

((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar3)).BeginInit();
this.SuspendLayout();
// 
// trackBar1
// 
this.trackBar1.Location = new System.Drawing.Point(160, 400);
this.trackBar1.Name = "trackBar1";
this.trackBar1.TabIndex = 1;
this.trackBar1.Scroll += new System.EventHandler(this.trackBar_Scroll);
// 
// trackBar2
// 
this.trackBar2.Location = new System.Drawing.Point(608, 40);
this.trackBar2.Name = "trackBar2";
this.trackBar2.TabIndex = 2;
this.trackBar2.Scroll += new System.EventHandler(this.trackBar_Scroll);
// 
// trackBar3
// 
this.trackBar3.Location = new System.Drawing.Point(56, 40);
this.trackBar3.Name = "trackBar3";
this.trackBar3.TabIndex = 3;
this.trackBar3.Scroll += new System.EventHandler(this.trackBar_Scroll);
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar3)).EndInit();
开发者ID:.NET开发者,项目名称:System.ComponentModel,代码行数:28,代码来源:ISupportInitialize.BeginInit

示例2: Service1

//引入命名空间
using System;        
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;

public class Service1 : System.ServiceProcess.ServiceBase
{
  private System.Diagnostics.EventLog eventLog1;


  public Service1()
  {
    this.eventLog1 = new System.Diagnostics.EventLog();
    ((System.ComponentModel.ISupportInitialize)(this.eventLog1)).BeginInit();

    this.eventLog1.Log = "MyCustomLog";
    this.eventLog1.Source = "CustomEventService2";

    this.AutoLog = false;
    this.ServiceName = "CustomEventService";
    ((System.ComponentModel.ISupportInitialize)(this.eventLog1)).EndInit();
  }

  static void Main()
  {
    System.ServiceProcess.ServiceBase[] ServicesToRun;
    ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Service1() };
    System.ServiceProcess.ServiceBase.Run(ServicesToRun);
  }

  protected override void OnStart(string[] args)
  {
    eventLog1.WriteEntry( "Hello", EventLogEntryType.Information );
  }

  protected override void OnStop()
  {
    eventLog1.WriteEntry( "Goodbye", EventLogEntryType.Warning );
  }
}
开发者ID:C#程序员,项目名称:System.ComponentModel,代码行数:43,代码来源:ISupportInitialize.BeginInit


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