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
        /// <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
        public UICommand(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            ClickForwarderDelegate = new EventHandler(ClickForwarder);
        }
예제 #5
0
        public CardLayoutPanel(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            current = String.Empty;
        }
        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
        public BusDevice(IContainer container)
            : base(DS3_BUS_CLASS_GUID)
        {
            container.Add(this);

            InitializeComponent();
        }
예제 #9
0
 /// <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
        public PanelOutput( IContainer container )
        {
            container.Add( this );

            InitializeComponent();
            UpdateBitmap();
        }
예제 #12
0
        public FormChrome(IContainer container)
        {
            if (container != null)
                container.Add(this);

            AdjustWhenMaximized = true;
        }
        public ManufacturerContactListView(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            initColumns();
        }
예제 #14
0
        public CodeGeneration(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            InitializeDelegates();
        }
예제 #15
0
        public BindingNavigator(IContainer container) : this(false) {
            if (container == null) {
                throw new ArgumentNullException("container");
            }

            container.Add(this);
        }
예제 #16
0
        /// <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;
        }
 public TriggerPortTypeComboBox(IContainer container)
 {
     container.Add(this);
     InitializeComponent();
     if (!this.IsInDesignMode())
         Items.AddRange(Enum.GetNames(typeof (TriggerPortType)));
 }
        public WritableHeaderExtender(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            _Header = new WritableGridHeader();
        }
예제 #23
0
        public SimpleLinkGrid(IContainer container)
        {
            container.Add(this);

            viewComponentHelper = new ViewComponentHelper(this);
            InitializeComponent();
        }
예제 #24
0
        /// <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();
 }
        /// <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();
        }
        /// <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
        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);
        }
        /// <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}]");
        }
        /// <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
        /// <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
        /// <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
        protected TaskDialogItem(IContainer container)
        {
            container?.Add(this);

            InitializeComponent();
        }
예제 #46
0
 public void Add()
 {
     ParentContainer?.Add(View);
 }
예제 #47
0
 /// <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
 /// <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();
 }
 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();
        }
 public PrinterManager(IContainer container)
 {
     container.Add(this);
 }
예제 #57
0
 public AeroButton(IContainer container)
 {
     container.Add(this);
     InitializeComponent();
 }
예제 #58
0
        /// <summary>
        /// The constructor.
        /// </summary>
        /// <param name="container">The container of the component.</param>
        public MyCaffeTrainerDual(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }
 public ServiceHost(IContainer container) : this()
 {
     container?.Add(this);
 }
        public UserLoginComponent(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }