⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dependentcomponent.cs

📁 中文名:Windows Forms 程序设计 英文名:Windows Forms Programming in c# 作者: Chris Sells 翻译: 荣耀 蒋贤哲 出版社:人民
💻 CS
字号:
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;

namespace AlarmClockControlLibrary {

  internal partial class DependentComponent : Component, ISupportInitialize {
    public DependentComponent() {
      InitializeComponent();
    }

    public DependentComponent(IContainer container) {
      container.Add(this);

      InitializeComponent();
    }

    private AlarmClockControl alarmClockControl;
    public AlarmClockControl AlarmClockControl {
      get { return alarmClockControl; }
      set { alarmClockControl = value; }
    }


    #region ISupportInitialize Members

    public void BeginInit() {}
    public void EndInit() {
      ISupportInitializeNotification notifier = this.alarmClockControl as ISupportInitializeNotification;
      // Is design-time component we抮e depending on intialized?
      if( (notifier != null) && !notifier.IsInitialized ) {
        // If not, ask it to let us know when it does, so we
        // can complete our own initialization as per normal
      }
      else {
        // Initialize as per normal
      }
    }

    #endregion

    void notifier_Initialized(object sender, EventArgs e) {
      if( sender == this.alarmClockControl ) {
        // Initialize as per normal
      }
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -