本文整理汇总了C#中IContainer.Add方法的典型用法代码示例。如果您正苦于以下问题:C# IContainer.Add方法的具体用法?C# IContainer.Add怎么用?C# IContainer.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IContainer
的用法示例。
在下文中一共展示了IContainer.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddChildComponents
private void AddChildComponents(IComponent component, IContainer container, IDesignerHost host)
{
Control control = this.GetControl(component);
if (control != null)
{
Control control2 = control;
Control[] array = new Control[control2.Controls.Count];
control2.Controls.CopyTo(array, 0);
IContainer container2 = null;
for (int i = 0; i < array.Length; i++)
{
ISite site = array[i].Site;
if (site != null)
{
string name = site.Name;
if (container.Components[name] != null)
{
name = null;
}
container2 = site.Container;
if (container2 != null)
{
container2.Remove(array[i]);
}
if (name != null)
{
container.Add(array[i], name);
}
else
{
container.Add(array[i]);
}
if (array[i].Parent != control2)
{
control2.Controls.Add(array[i]);
}
else
{
int childIndex = control2.Controls.GetChildIndex(array[i]);
control2.Controls.Remove(array[i]);
control2.Controls.Add(array[i]);
control2.Controls.SetChildIndex(array[i], childIndex);
}
IComponentInitializer designer = host.GetDesigner(component) as IComponentInitializer;
if (designer != null)
{
designer.InitializeExistingComponent(null);
}
this.AddChildComponents(array[i], container, host);
}
}
}
}
示例2: InitializeComponent
/// <summary>
/// Set up the window
/// </summary>
private void InitializeComponent()
{
components = new Container();
this.LoadingText = new Label();
components.Add(LoadingText);
this.Progress = new ProgressBar();
components.Add(Progress);
this.SuspendLayout();
//
// LoadingText
//
this.LoadingText.AutoEllipsis = true;
this.LoadingText.BackColor = Color.Transparent;
this.LoadingText.Dock = DockStyle.Bottom;
this.LoadingText.Location = new Point(0, Picture.Height + 22);
this.LoadingText.Name = "LoadingText";
// this.LoadingText.Size = new Size(Picture.Width - 1, 20);
this.LoadingText.TabIndex = 0;
this.LoadingText.Text = "Loading...";
this.LoadingText.UseWaitCursor = true;
//
// Progress
//
this.Progress.Location = new Point(0, Picture.Height - 1);
this.Progress.Maximum = this.maximum;
this.Progress.Name = "Progress";
this.Progress.Size = new Size(Picture.Width - 1, 23);
this.Progress.Step = 1;
this.Progress.TabIndex = 1;
this.Progress.UseWaitCursor = true;
this.Progress.Style = ProgressBarStyle.Continuous;
//
// Splash
//
this.BackColor = SystemColors.Window;
this.BackgroundImage = Picture;
this.BackgroundImageLayout = ImageLayout.None;
this.ClientSize = new Size(Picture.Width, Picture.Height + 42);
this.Controls.Add(this.Progress);
this.Controls.Add(this.LoadingText);
this.DoubleBuffered = true;
this.Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.FormBorderStyle = FormBorderStyle.Fixed3D;
this.MaximizeBox = false;
this.Name = "Splash";
this.StartPosition = FormStartPosition.CenterScreen;
this.Text = "Loading Ponykart...";
this.UseWaitCursor = true;
this.ResumeLayout(false);
base.Icon = Resources.Icon_2;
}
示例3: ExtendedPictureBoxAlphaAnimator
/// <summary>
/// Creates a new instance.
/// </summary>
/// <param name="container">Container the new instance should be added to.</param>
public ExtendedPictureBoxAlphaAnimator(IContainer container)
{
container.Add(this);
InitializeComponent();
Initialize();
}
示例4: UsbDs3
public UsbDs3(IContainer container)
: base(USB_CLASS_GUID)
{
container.Add(this);
InitializeComponent();
}
示例5: OutputPanelHammersley
public OutputPanelHammersley( IContainer container )
{
container.Add( this );
InitializeComponent();
WMath.Hammersley QRNG = new WMath.Hammersley();
double[,] Sequence = QRNG.BuildSequence( SAMPLES_COUNT, 2 );
for ( int SampleIndex=0; SampleIndex < SAMPLES_COUNT; SampleIndex++ )
{
float Angle = 2.0f * (float) Math.PI * (float) Sequence[SampleIndex,0];
float Radius = (float) Math.Sqrt( Sequence[SampleIndex,1] ); // Uniform
// float Radius = (float) Sequence[SampleIndex,1];
m_Samples[SampleIndex] = new WMath.Vector2D( Radius * (float) Math.Cos( Angle ), Radius * (float) Math.Sin( Angle ) );
}
string Format = "const uint SHADOW_SAMPLES_COUNT = " + SAMPLES_COUNT + ";\r\n"
+ "const float2 SamplesOffset[SHADOW_SAMPLES_COUNT] = {\r\n";
for ( int SampleIndex=0; SampleIndex < SAMPLES_COUNT; SampleIndex++ )
{
Format += " float2( " + m_Samples[SampleIndex].x + ", " + m_Samples[SampleIndex].y + " ),\r\n";
}
Format += "};\r\n\r\n";
OnSizeChanged( EventArgs.Empty );
}
示例6: FormChrome
public FormChrome(IContainer container)
{
if (container != null)
container.Add(this);
AdjustWhenMaximized = true;
}
示例7: BusListView
public BusListView(IContainer container)
{
container.Add(this);
InitializeComponent();
initColumns();
}
示例8: BindingNavigator
public BindingNavigator(IContainer container) : this(false) {
if (container == null) {
throw new ArgumentNullException("container");
}
container.Add(this);
}
示例9: ManufacturerContactListView
public ManufacturerContactListView(IContainer container)
{
container.Add(this);
InitializeComponent();
initColumns();
}
示例10: TVKingButton
public TVKingButton(IContainer container)
{
container.Add(this);
InitializeComponent();
this.Cursor = Cursors.Hand;
}
示例11: SimpleLinkGrid
public SimpleLinkGrid(IContainer container)
{
container.Add(this);
viewComponentHelper = new ViewComponentHelper(this);
InitializeComponent();
}
示例12: CardLayoutPanel
public CardLayoutPanel(IContainer container)
{
container.Add(this);
InitializeComponent();
current = String.Empty;
}
示例13: OWindowManager
public OWindowManager(IContainer container)
{
container.Add(this);
init();
InitializeComponent();
}
示例14: TimerComponent
public TimerComponent(IContainer container)
{
container.Add(this);
this.ID = 1;
this.Name = "Timer";
InitializeComponent();
}
示例15: TableLayoutPanelEx
public TableLayoutPanelEx(IContainer container)
{
container.Add(this);
InitializeComponent();
this.DoubleBuffered = true;
}