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


C# IContainer.Add方法代码示例

本文整理汇总了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);
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:53,代码来源:ParentControlDesigner.cs

示例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;
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:55,代码来源:Splash.cs

示例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();
        }
开发者ID:Egoily,项目名称:CSharp-EAlbum,代码行数:11,代码来源:ExtendedPictureBoxAlphaAnimator.cs

示例4: UsbDs3

        public UsbDs3(IContainer container)
            : base(USB_CLASS_GUID)
        {
            container.Add(this);

            InitializeComponent();
        }
开发者ID:metaxis,项目名称:ScpServer,代码行数:7,代码来源:UsbDs3.cs

示例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 );
        }
开发者ID:Patapom,项目名称:GodComplex,代码行数:29,代码来源:OutputPanelHammersley.cs

示例6: FormChrome

        public FormChrome(IContainer container)
        {
            if (container != null)
                container.Add(this);

            AdjustWhenMaximized = true;
        }
开发者ID:arleyschrock,项目名称:CustomChrome,代码行数:7,代码来源:FormChrome.cs

示例7: BusListView

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

            InitializeComponent();
            initColumns();
        }
开发者ID:UtrsSoftware,项目名称:ATMLWorkBench,代码行数:7,代码来源:BusListView.cs

示例8: BindingNavigator

        public BindingNavigator(IContainer container) : this(false) {
            if (container == null) {
                throw new ArgumentNullException("container");
            }

            container.Add(this);
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:7,代码来源:BindingNavigator.cs

示例9: ManufacturerContactListView

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

            InitializeComponent();
            initColumns();
        }
开发者ID:UtrsSoftware,项目名称:ATMLWorkBench,代码行数:7,代码来源:ManufacturerContactListView.cs

示例10: TVKingButton

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

            InitializeComponent();
            this.Cursor = Cursors.Hand;
        }
开发者ID:nghoang,项目名称:tvkpme,代码行数:7,代码来源:TVKingButton.cs

示例11: SimpleLinkGrid

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

            viewComponentHelper = new ViewComponentHelper(this);
            InitializeComponent();
        }
开发者ID:wshanshan,项目名称:DDD,代码行数:7,代码来源:SimpleLinkGrid.cs

示例12: CardLayoutPanel

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

            InitializeComponent();
            current = String.Empty;
        }
开发者ID:wshanshan,项目名称:DDD,代码行数:7,代码来源:CardLayoutPanel.cs

示例13: OWindowManager

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

            init();
            InitializeComponent();
        }
开发者ID:PokeD,项目名称:Ohana3DS-Rebirth,代码行数:7,代码来源:OWindowManager.cs

示例14: TimerComponent

 public TimerComponent(IContainer container)
 {
     container.Add(this);
     this.ID = 1;
     this.Name = "Timer";
     InitializeComponent();
 }
开发者ID:goder1985,项目名称:EventCoreEngine,代码行数:7,代码来源:TimerComponent.cs

示例15: TableLayoutPanelEx

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

            InitializeComponent();
            this.DoubleBuffered = true;
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:7,代码来源:TableLayoutPanelEx.cs


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