本文整理汇总了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();
示例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 );
}
}