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
0
ファイル: Splash.cs プロジェクト: CisciarpMaster/PonyKart
        /// <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
0
        public OWindowManager(IContainer container)
        {
            container.Add(this);

            init();
            InitializeComponent();
        }
コード例 #4
0
ファイル: UICommand.cs プロジェクト: Stoner19/Memory-Lifter
        public UICommand(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            ClickForwarderDelegate = new EventHandler(ClickForwarder);
        }
コード例 #5
0
ファイル: CardLayoutPanel.cs プロジェクト: wshanshan/DDD
        public CardLayoutPanel(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            current = String.Empty;
        }
コード例 #6
0
        public ModbusSerialPort(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            this.InitializeComponent2();
        }
コード例 #7
0
ファイル: UsbDs3.cs プロジェクト: metaxis/ScpServer
        public UsbDs3(IContainer container)
            : base(USB_CLASS_GUID)
        {
            container.Add(this);

            InitializeComponent();
        }
コード例 #8
0
ファイル: BusDevice.cs プロジェクト: joshreve/Touchmote
        public BusDevice(IContainer container)
            : base(DS3_BUS_CLASS_GUID)
        {
            container.Add(this);

            InitializeComponent();
        }
コード例 #9
0
ファイル: ContextMenuStrip.cs プロジェクト: JianwenSun/cc
 /// <devdoc>
 /// Summary of ContextMenuStrip.
 /// </devdoc>
 public ContextMenuStrip(IContainer container) : base() {
     // this constructor ensures ContextMenuStrip is disposed properly since its not parented to the form.
     if (container == null) {
         throw new ArgumentNullException("container");
     }
     container.Add(this);
 }
コード例 #10
0
ファイル: Timer.cs プロジェクト: JianwenSun/cc
        /// <include file='doc\Timer.uex' path='docs/doc[@for="Timer.Timer1"]/*' />
        /// <devdoc>
        /// <para>Initializes a new instance of the <see cref='System.Windows.Forms.Timer'/> class with the specified container.</para>
        /// </devdoc>
        public Timer(IContainer container) : this() {
            if (container == null) {
                throw new ArgumentNullException("container");
            }

            container.Add(this);
        }
コード例 #11
0
ファイル: PanelOutput.cs プロジェクト: Patapom/GodComplex
        public PanelOutput( IContainer container )
        {
            container.Add( this );

            InitializeComponent();
            UpdateBitmap();
        }
コード例 #12
0
        public FormChrome(IContainer container)
        {
            if (container != null)
                container.Add(this);

            AdjustWhenMaximized = true;
        }
コード例 #13
0
        public ManufacturerContactListView(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            initColumns();
        }
コード例 #14
0
        public CodeGeneration(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            InitializeDelegates();
        }
コード例 #15
0
ファイル: BindingNavigator.cs プロジェクト: JianwenSun/cc
        public BindingNavigator(IContainer container) : this(false) {
            if (container == null) {
                throw new ArgumentNullException("container");
            }

            container.Add(this);
        }
コード例 #16
0
ファイル: TaskDialogItem.cs プロジェクト: Xtremrules/dot42
        /// <summary>
        /// Initializes a new instance of the <see cref="TaskDialogItem"/> class with the specified container.
        /// </summary>
        /// <param name="container">The <see cref="IContainer"/> to add the <see cref="TaskDialogItem"/> to.</param>
        protected TaskDialogItem(IContainer container)
        {
            if( container != null )
                container.Add(this);

            InitializeComponent();
        }
コード例 #17
0
 public MetroMenuStrip(IContainer Container)
 {
     if (Container != null)
     {
         Container.Add(this);
     }
 }
コード例 #18
0
        public BusListView(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            initColumns();
        }
コード例 #19
0
 public GlobalImageCollectionHolder(IContainer container)
 {
     InitializeComponent();
     this.scaledImageCollection = this.rawImageCollection;
     SetSharedImageCollectionImages(this.rawImageCollection);
     container?.Add(this);
 }
コード例 #20
0
ファイル: zqctext.cs プロジェクト: liyuanli66/His
        public zqctext(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            m_EnterToTable = true;
        }
コード例 #21
0
 public TriggerPortTypeComboBox(IContainer container)
 {
     container.Add(this);
     InitializeComponent();
     if (!this.IsInDesignMode())
         Items.AddRange(Enum.GetNames(typeof (TriggerPortType)));
 }
コード例 #22
0
        public WritableHeaderExtender(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            _Header = new WritableGridHeader();
        }
コード例 #23
0
ファイル: SimpleLinkGrid.cs プロジェクト: wshanshan/DDD
        public SimpleLinkGrid(IContainer container)
        {
            container.Add(this);

            viewComponentHelper = new ViewComponentHelper(this);
            InitializeComponent();
        }
コード例 #24
0
ファイル: LogView.cs プロジェクト: sdzxwxlsj/lsjutil
        /// <summary>
        /// LogView
        /// </summary>
        /// <param name="container"></param>
        public LogView(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            this.Init();
        }
コード例 #25
0
        public ConnictionFormComponent(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            _ConnectionForm = new ConnectionForm();
        }
コード例 #26
0
        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 );
        }
コード例 #27
0
        public TableLayoutPanelEx(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            this.DoubleBuffered = true;
        }
コード例 #28
0
 public TimerComponent(IContainer container)
 {
     container.Add(this);
     this.ID = 1;
     this.Name = "Timer";
     InitializeComponent();
 }
コード例 #29
0
        /// <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();
        }
コード例 #30
0
        /// <summary>Initializes a new instance of the <see cref="TextMessageListView"/> class.</summary>
        /// <param name="container">The container.</param>
        public TextMessageListView(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            SetupListViewSorter();
        }
コード例 #31
0
ファイル: TVKingButton.cs プロジェクト: nghoang/tvkpme
        public TVKingButton(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            this.Cursor = Cursors.Hand;
        }
コード例 #32
0
        /// <summary>
        /// Constructor with a given owning container.
        /// </summary>
        /// <param name="container">The given owning container.</param>
        public SecurityValue(IContainer container)
            : base()
        {
            Password = null;
            Initialize();

            container?.Add(this);
        }
コード例 #33
0
        /// <summary>
        /// Constructor with a given password and a given owning container.
        /// </summary>
        /// <param name="value">The given password.</param>
        /// <param name="container">The given owning container.</param>
        internal CharacteristicDictionary(string value, IContainer container)
            : base()
        {
            Initialize(value);
            _name = ToString();

            container?.Add(this, $"Characteristic [{GetHashCode()}]");
        }
コード例 #34
0
        /// <summary>
        /// Constructor with a given password and a given owning container.
        /// </summary>
        /// <param name="password">The given password.</param>
        /// <param name="container">The given owning container.</param>
        public SecurityValue(IPassword password, IContainer container)
            : base()
        {
            Password = password;
            Initialize();

            container?.Add(this, $"Password Security ({Security}) [{Password.Site}]");
        }
コード例 #35
0
        /// <summary>
        /// Constructor with a given password and a given owning container.
        /// </summary>
        /// <param name="password">The given password.</param>
        /// <param name="container">The given owning container.</param>
        public SecurityValue(string password, IContainer container)
            : base()
        {
            Password = lib.Password.Password.GetPassword(password, container);
            Initialize();

            container?.Add(this, $"Password Security ({Security}) [{Password.Site}]");
        }
コード例 #36
0
        /// <summary>
        /// Constructor with a given owning container.
        /// </summary>
        /// <param name="container">The given owning container.</param>
        public CharacteristicDictionary(IContainer container)
            : base()
        {
            Initialize();
            _name = $"CharacteristicDictionary_[{GetHashCode()}]";

            container?.Add(this, $"Characteristic [{GetHashCode()}]");
        }
コード例 #37
0
ファイル: TrayIcon.cs プロジェクト: Darkfoe703/evemon
        /// <summary>
        /// Initializes a new instance of the <see cref="TrayIcon"/> class with the specfied container.
        /// </summary>
        /// <param name="container">An <see cref="System.ComponentModel.IContainer"/> that represents the container for the <see cref="TrayIcon"/> control.</param>
        public TrayIcon(IContainer container)
        {
            container?.Add(this);

            InitializeComponent();

            m_mouseState = new MouseStateOut(this);
        }
コード例 #38
0
ファイル: MyTextBox.cs プロジェクト: sergiocabral/App.Cabster
        /// <summary>
        ///     Construtor.
        /// </summary>
        /// <param name="container">Container</param>
        public MyTextBox(IContainer?container)
        {
            this.LogClassInstantiate();

            container?.Add(this);

            InitializeComponent();
            InitializeComponent2();
        }
コード例 #39
0
        public ColorableCheckBox(IContainer container)
        {
            container?.Add(this);

            InitializeComponent();
            FlatAppearance.MouseDownBackColor = ColorManager.ControlDarkest;
            FlatAppearance.MouseOverBackColor = ColorManager.ControlDarker;
            BackColorChanged += OnBackColorChanged;
        }
コード例 #40
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OperationsProgressDialog"/> class, adding it to the specified container.
        /// </summary>
        /// <param name="container">The <see cref="IContainer"/> to which the component should be added.</param>
        public OperationsProgressDialog(IContainer container)
        {
            container?.Add(this);

            InitializeComponent();

            ProgressBarStyle = ProgressBarStyle.ProgressBar;
            ShowCancelButton = true;
            MinimizeBox      = true;
        }
        public HealthExplorerReportForm(IContainer parentContainer) : base(parentContainer)
        {
            parentContainer?.Add(this);
            //System.IServiceProvider serviceProvider = (System.IServiceProvider)parentContainer;

            InitializeComponent();
            if (!DesignMode)
            {
                IsConsoleMaximized = false;
                reportControl      = (HealthExplorerReportControl)SetDisplayPanelType(typeof(HealthExplorerReportControl));
            }
        }
コード例 #42
0
 public EmulatedGameBoy(IContainer container)
 {
     synchronizationContext = SynchronizationContext.Current;
     bus                   = new GameBoyMemoryBus();
     frameStopwatch        = new Stopwatch();
     frameRateStopwatch    = new Stopwatch();
     bus.EmulationStarted += OnEmulationStarted;
     bus.EmulationStopped += OnEmulationStopped;
     bus.BorderChanged    += OnBorderChanged;
     bus.ClockManager      = this;
     emulationStatus       = bus.UseBootRom ? EmulationStatus.Paused : EmulationStatus.Stopped;
     container?.Add(this);
 }
コード例 #43
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProgressDialog"/> class, adding it to the specified container.
        /// </summary>
        /// <param name="container">The <see cref="IContainer"/> to which the component should be added.</param>
        public ProgressDialog(IContainer container)
        {
            container?.Add(this);

            InitializeComponent();

            ProgressBarStyle = ProgressBarStyle.ProgressBar;
            ShowCancelButton = true;
            MinimizeBox      = true;
            // Set a default animation for XP.
            if (!NativeMethods.IsWindowsVistaOrLater)
            {
                Animation = AnimationResource.GetShellAnimation(ShellAnimation.FlyingPapers);
            }
        }
コード例 #44
0
 public SynchronizedBindingSource(IContainer container)
     : this()
 {
     container?.Add(this);
 }
コード例 #45
0
ファイル: TaskDialogItem.cs プロジェクト: maxigaz/AngelLoader
        protected TaskDialogItem(IContainer container)
        {
            container?.Add(this);

            InitializeComponent();
        }
コード例 #46
0
ファイル: EntityViewModel.cs プロジェクト: yakimovim/safe2
 public void Add()
 {
     ParentContainer?.Add(View);
 }
コード例 #47
0
ファイル: FtpFileWatcher.cs プロジェクト: sotaria/gsf
 /// <summary>
 /// Initializes a new instance of the <see cref="FtpFileWatcher"/> class.
 /// </summary>
 /// <param name="container"><see cref="IContainer"/> object that contains the <see cref="FtpFileWatcher"/>.</param>
 public FtpFileWatcher(IContainer container)
     : this()
 {
     container?.Add(this);
 }
コード例 #48
0
 public BindingValidator(IContainer container)
 {
     container?.Add(this);
 }
コード例 #49
0
ファイル: RasComponent.cs プロジェクト: mogikanin/DotRas
 /// <summary>
 /// Initializes a new instance of the <see cref="DotRas.Design.RasComponent"/> class.
 /// </summary>
 /// <param name="container">An <see cref="System.ComponentModel.IContainer"/> that will contain this component.</param>
 protected RasComponent(IContainer container)
 {
     container?.Add(this);
 }
コード例 #50
0
 public RadContextMenu(IContainer owner)
     : this()
 {
     owner?.Add((IComponent)this);
 }
コード例 #51
0
 public V5ToolTip(IContainer container)
 {
     container.Add(this);
     InitializeComponent();
 }
コード例 #52
0
 public static T WithParentContainer <T>(this T entity, IContainer parent) where T : IEntity
 {
     parent?.Add(entity);
     return(entity);
 }
コード例 #53
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FtpClient"/> class.
 /// </summary>
 /// <param name="container"><see cref="IContainer"/> object that contains the <see cref="FtpClient"/>.</param>
 public FtpClient(IContainer container)
     : this()
 {
     container?.Add(this);
 }
コード例 #54
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DotRas.CredentialPromptDialog"/> class.
        /// </summary>
        /// <param name="container">An <see cref="System.ComponentModel.IContainer"/> that will contain the component.</param>
        public CredentialPromptDialog(IContainer container)
        {
            container?.Add(this);

            InitializeComponent();
        }
コード例 #55
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DotRas.RasAutoDialManager"/> class.
        /// </summary>
        /// <param name="container">An <see cref="System.ComponentModel.IContainer"/> that will contain this component.</param>
        public RasAutoDialManager(IContainer container)
        {
            container?.Add(this);

            InitializeComponent();
        }
コード例 #56
0
 public PrinterManager(IContainer container)
 {
     container.Add(this);
 }
コード例 #57
0
 public AeroButton(IContainer container)
 {
     container.Add(this);
     InitializeComponent();
 }
コード例 #58
0
ファイル: MyCaffeTrainerDual.cs プロジェクト: lulzzz/MyCaffe
        /// <summary>
        /// The constructor.
        /// </summary>
        /// <param name="container">The container of the component.</param>
        public MyCaffeTrainerDual(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }
コード例 #59
0
 public ServiceHost(IContainer container) : this()
 {
     container?.Add(this);
 }
コード例 #60
0
        public UserLoginComponent(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }