Exemple #1
0
        /// <summary>
        /// Attach the GroupBox control to the dialog object
        /// </summary>
        /// <param name="dialog">Target dialog</param>
        internal override void Attach(IFileDialogCustomize dialog)
        {
            Debug.Assert(dialog != null, "CommonFileDialogGroupBox.Attach: dialog parameter can not be null");

            // Start a visual group
            dialog.StartVisualGroup(this.Id, this.Text);

            // Add child controls
            foreach (CommonFileDialogControl item in this.items)
            {
                item.HostingDialog = HostingDialog;
                item.Attach(dialog);
            }

            // End visual group
            dialog.EndVisualGroup();

            // Make this control prominent if needed
            if (IsProminent)
            {
                dialog.MakeProminent(this.Id);
            }

            // Sync unmanaged properties with managed properties
            SyncUnmanagedProperties();
        }
Exemple #2
0
        internal override void Attach(IFileDialogCustomize dialog)
        {
            Debug.Assert(dialog != null, "CommonFileDialogComboBox.Attach: dialog parameter can not be null");

            // Add the combo box control
            dialog.AddComboBox(this.Id);

            // Add the combo box items
            for (int index = 0; index < items.Count; index++)
            {
                dialog.AddControlItem(this.Id, index, items[index].Text);
            }

            // Set the currently selected item
            if (selectedIndex >= 0 && selectedIndex < items.Count)
            {
                dialog.SetSelectedControlItem(this.Id, this.selectedIndex);
            }
            else if (selectedIndex != -1)
            {
                throw new IndexOutOfRangeException(LocalizedMessages.ComboBoxIndexOutsideBounds);
            }

            // Make this control prominent if needed
            if (IsProminent)
            {
                dialog.MakeProminent(this.Id);
            }

            // Sync additional properties
            SyncUnmanagedProperties();
        }
        /// <summary>
        /// Attach the PushButton control to the dialog object
        /// </summary>
        /// <param name="dialog">Target dialog</param>
        public override void Attach(IFileDialogCustomize dialog)
        {
            Debug.Assert(dialog != null, "CommonFileDialogButton.Attach: dialog parameter can not be null");

            // Add a push button control
            dialog.AddPushButton(this.Id, this.Text);

            // Make this control prominent if needed
            if (IsProminent) { dialog.MakeProminent(this.Id); }

            // Sync unmanaged properties with managed properties
            SyncUnmanagedProperties();
        }
        /// <summary>
        /// Attach the PushButton control to the dialog object
        /// </summary>
        /// <param name="dialog">Target dialog</param>
        internal override void Attach(IFileDialogCustomize dialog)
        {
            Debug.Assert(dialog != null, "CommonFileDialogButton.Attach: dialog parameter can not be null");

            // Add a push button control
            dialog.AddPushButton(this.Id, this.Text);

            // Make this control prominent if needed
            if (IsProminent)
            {
                dialog.MakeProminent(this.Id);
            }

            // Sync unmanaged properties with managed properties
            SyncUnmanagedProperties();
        }
		/// <summary>
		/// Attach the Menu control to the dialog object.
		/// </summary>
		/// <param name="dialog">the target dialog</param>
		internal override void Attach(IFileDialogCustomize dialog) {
			Debug.Assert(dialog != null, "CommonFileDialogMenu.Attach: dialog parameter can not be null");

			// Add the menu control
			dialog.AddMenu(this.Id, this.Text);

			// Add the menu items
			foreach (CommonFileDialogMenuItem item in this.items)
				dialog.AddControlItem(this.Id, item.Id, item.Text);

			// Make prominent as needed
			if (IsProminent)
				dialog.MakeProminent(this.Id);

			// Sync unmanaged properties with managed properties
			SyncUnmanagedProperties();
		}
        /// <summary>
        /// Attach the CheckButton control to the dialog object.
        /// </summary>
        /// <param name="dialog">the target dialog</param>
        internal override void Attach(IFileDialogCustomize dialog)
        {
            Debug.Assert(dialog != null, "CommonFileDialogCheckBox.Attach: dialog parameter can not be null");

            // Add a check button control
            dialog.AddCheckButton(this.Id, this.Text, this.isChecked);

            // Make this control prominent if needed
            if (IsProminent)
            {
                dialog.MakeProminent(this.Id);
            }

            // Make sure this property is set
            ApplyPropertyChange("IsChecked");

            // Sync unmanaged properties with managed properties
            SyncUnmanagedProperties();
        }
        /// <summary>
        /// Attach the Menu control to the dialog object.
        /// </summary>
        /// <param name="dialog">the target dialog</param>
        internal override void Attach(IFileDialogCustomize dialog)
        {
            Debug.Assert(dialog != null, "CommonFileDialogMenu.Attach: dialog parameter can not be null");

            // Add the menu control
            dialog.AddMenu(this.Id, this.Text);

            // Add the menu items
            foreach (CommonFileDialogMenuItem item in this.items)
            {
                dialog.AddControlItem(this.Id, item.Id, item.Text);
            }

            // Make prominent as needed
            if (IsProminent)
            {
                dialog.MakeProminent(this.Id);
            }

            // Sync unmanaged properties with managed properties
            SyncUnmanagedProperties();
        }
		/// <summary>
		/// Attach the GroupBox control to the dialog object
		/// </summary>
		/// <param name="dialog">Target dialog</param>
		internal override void Attach(IFileDialogCustomize dialog) {
			Debug.Assert(dialog != null, "CommonFileDialogGroupBox.Attach: dialog parameter can not be null");

			// Start a visual group
			dialog.StartVisualGroup(this.Id, this.Text);

			// Add child controls
			foreach (CommonFileDialogControl item in this.items) {
				item.HostingDialog = HostingDialog;
				item.Attach(dialog);
			}

			// End visual group
			dialog.EndVisualGroup();

			// Make this control prominent if needed
			if (IsProminent)
				dialog.MakeProminent(this.Id);

			// Sync unmanaged properties with managed properties
			SyncUnmanagedProperties();
		}
        /// <summary>
        /// Attach the CheckButton control to the dialog object.
        /// </summary>
        /// <param name="dialog">the target dialog</param>
        internal override void Attach(IFileDialogCustomize dialog)
        {
            Debug.Assert(dialog != null, "CommonFileDialogCheckBox.Attach: dialog parameter can not be null");

            // Add a check button control
            dialog.AddCheckButton(this.Id, this.Text, this.isChecked);

            // Make this control prominent if needed
            if (IsProminent) { dialog.MakeProminent(this.Id); }

            // Make sure this property is set
            ApplyPropertyChange("IsChecked");

            // Sync unmanaged properties with managed properties
            SyncUnmanagedProperties();
        }
        /// <summary>
        /// Attach the ComboBox control to the dialog object
        /// </summary>
        /// <param name="dialog">The target dialog</param>
        internal override void Attach(IFileDialogCustomize dialog)
        {
            Debug.Assert(dialog != null, "CommonFileDialogComboBox.Attach: dialog parameter can not be null");
            
            // Add the combo box control
            dialog.AddComboBox(this.Id);

            // Add the combo box items
            for (int index = 0; index < items.Count; index++)
                dialog.AddControlItem(this.Id, index, items[index].Text);

            // Set the currently selected item
            if (selectedIndex >= 0 && selectedIndex < items.Count)
            {
                dialog.SetSelectedControlItem(this.Id, this.selectedIndex);
            }
            else if (selectedIndex != -1)
            {
                throw new IndexOutOfRangeException("Index was outside the bounds of the CommonFileDialogComboBox.");
            }

            // Make this control prominent if needed
            if (IsProminent)
                dialog.MakeProminent(this.Id);

            // Sync additional properties
            SyncUnmanagedProperties();
        }