Example #1
0
        internal TemplatingOptionsDialog(MobileTemplatedControlDesigner designer,
                                         ISite site,
                                         int mergingContext)
        {
            _strCollSchemas = new StringCollection();
            _mergingContext = mergingContext;
            _designer       = designer;
            _site           = site;
            _dsd            = (IDeviceSpecificDesigner)designer;
            _dsd.SetDeviceSpecificEditor(this);

            InitializeComponent();

            this.Text            = SR.GetString(SR.TemplatingOptionsDialog_Title);
            _btnHelp.Text        = SR.GetString(SR.GenericDialog_HelpBtnCaption);
            _btnClose.Text       = SR.GetString(SR.GenericDialog_CloseBtnCaption);
            _lblSchemas.Text     = SR.GetString(SR.TemplatingOptionsDialog_SchemaCaption);
            _btnEditChoices.Text = SR.GetString(SR.TemplatingOptionsDialog_EditBtnCaption);
            _lblChoices.Text     = SR.GetString(SR.TemplatingOptionsDialog_FilterCaption);
            _schemasFriendly     = new String[] { SR.GetString(SR.TemplatingOptionsDialog_HTMLSchemaFriendly),
                                                  SR.GetString(SR.TemplatingOptionsDialog_CHTMLSchemaFriendly) };
            _schemasUrl = new String[] { SR.GetString(SR.MarkupSchema_HTML32),
                                         SR.GetString(SR.MarkupSchema_cHTML10) };

            int tabOffset = GenericUI.InitDialog(
                this,
                _dsd,
                _mergingContext
                );

            SetTabIndexes(tabOffset);
            _dsd.RefreshHeader(_mergingContext);
            String currentDeviceSpecificID = _dsd.CurrentDeviceSpecificID;

            if (null != currentDeviceSpecificID && currentDeviceSpecificID.Length > 0)
            {
                DeviceSpecific ds;
                _dsd.GetDeviceSpecific(currentDeviceSpecificID, out ds);
                ((IRefreshableDeviceSpecificEditor)this).Refresh(currentDeviceSpecificID, ds);
            }
            UpdateControlEnabling();
        }
        internal TemplatingOptionsDialog(MobileTemplatedControlDesigner designer, 
                                       ISite site, 
                                       int mergingContext) : base(site)
        {
            _strCollSchemas = new StringCollection();
            _mergingContext = mergingContext;
            _designer = designer;
            _site = site;
            _dsd = (IDeviceSpecificDesigner) designer;
            _dsd.SetDeviceSpecificEditor(this);

            InitializeComponent();

            this.Text = SR.GetString(SR.TemplatingOptionsDialog_Title);
            _btnClose.Text = SR.GetString(SR.GenericDialog_CloseBtnCaption);
            _lblSchemas.Text = SR.GetString(SR.TemplatingOptionsDialog_SchemaCaption);
            _btnEditChoices.Text = SR.GetString(SR.TemplatingOptionsDialog_EditBtnCaption);
            _lblChoices.Text = SR.GetString(SR.TemplatingOptionsDialog_FilterCaption);
            _schemasFriendly = new String[] { SR.GetString(SR.TemplatingOptionsDialog_HTMLSchemaFriendly),
                                              SR.GetString(SR.TemplatingOptionsDialog_CHTMLSchemaFriendly) };
            _schemasUrl = new String[] { SR.GetString(SR.MarkupSchema_HTML32),
                                         SR.GetString(SR.MarkupSchema_cHTML10) };
            
            int tabOffset = GenericUI.InitDialog(
                this,
                _dsd,
                _mergingContext
            );

            SetTabIndexes(tabOffset);
            _dsd.RefreshHeader(_mergingContext);
            String currentDeviceSpecificID = _dsd.CurrentDeviceSpecificID;
            if (null != currentDeviceSpecificID && currentDeviceSpecificID.Length > 0)
            {
                DeviceSpecific ds;
                _dsd.GetDeviceSpecific(currentDeviceSpecificID, out ds);
                ((IRefreshableDeviceSpecificEditor) this).Refresh(currentDeviceSpecificID, ds);
            }
            UpdateControlEnabling();
        }
Example #3
0
        void IRefreshableDeviceSpecificEditor.Refresh(
            String deviceSpecificID,
            DeviceSpecific deviceSpecific
            )
        {
            if (_currentDeviceSpecificID != null)
            {
                CacheCurrentState();
            }
            _cbChoices.Items.Clear();

            if (!RestoreState(deviceSpecificID))
            {
                LoadChoices(deviceSpecific);
                if (!ValidateLoadedChoices())
                {
                    _designer.RefreshHeader(
                        MobileControlDesigner.MergingContextProperties
                        );
                }
            }
            UpdateUI();
        }
        internal PropertyOverridesDialog(
            IDeviceSpecificDesigner designer,
            int mergingContext
        ) : base(designer.UnderlyingControl.Site) {
            _designer = designer;
            _mergingContext = mergingContext;
           
            // Required for Win Form Designer support
            InitializeComponent();

            this._lblAppliedFilters.Text =
                SR.GetString(SR.PropertyOverridesDialog_AppliedDeviceFilters);
            this._btnEditFilters.Text = SR.GetString(SR.GenericDialog_Edit);
            this._lblProperties.Text =
                SR.GetString(SR.PropertyOverridesDialog_DeviceSpecificProperties);
            this._cmdOK.Text = SR.GetString(SR.GenericDialog_OKBtnCaption);
            this._cmdCancel.Text = SR.GetString(SR.GenericDialog_CancelBtnCaption);

            int tabOffset = GenericUI.InitDialog(
                this,
                _designer,
                _mergingContext
            );

            this.Text = _designer.UnderlyingControl.ID
                + " - " + SR.GetString(SR.PropertyOverridesDialog_Title);
            SetTabIndexes(tabOffset);
            _designer.SetDeviceSpecificEditor(this);

            // Note that the following can cause an
            // IDeviceSpecificDesigner.Refresh() to occur as a side-effect.
            _designer.RefreshHeader(_mergingContext);
            _ignoreSelectionChanged = false;

            // NOTE: Calling CurrentDeviceSpecificID will cause a refresh to
            //       happen as a side effect.
            _currentDeviceSpecificID = _designer.CurrentDeviceSpecificID;
            if(_currentDeviceSpecificID != null)
            {
                _cbChoices.Items.Clear();
                LoadChoices(_currentDeviceSpecificID);
                if(!ValidateLoadedChoices())
                {
                    // Throw to prevent dialog from opening.  Caught and hidden
                    // by PropertyOverridesTypeEditor.cs
                    throw new InvalidChoiceException(
                        "Property overrides dialog can not open because there " +
                        "are invalid choices defined in the page."
                    );
                }
            }
            
            // Register Event Handlers
            _cbChoices.SelectedIndexChanged += new EventHandler(
                OnFilterSelected
            );
            _btnEditFilters.Click += new EventHandler(OnEditFilters);
            _cmdOK.Click += new EventHandler(OnOK);
            _cmdCancel.Click += new EventHandler(OnCancel);
            UpdateUI();
        }
Example #5
0
        internal PropertyOverridesDialog(
            IDeviceSpecificDesigner designer,
            int mergingContext
            )
        {
            _designer       = designer;
            _mergingContext = mergingContext;

            // Required for Win Form Designer support
            InitializeComponent();

            this._lblAppliedFilters.Text =
                SR.GetString(SR.PropertyOverridesDialog_AppliedDeviceFilters);
            this._btnEditFilters.Text = SR.GetString(SR.GenericDialog_Edit);
            this._lblProperties.Text  =
                SR.GetString(SR.PropertyOverridesDialog_DeviceSpecificProperties);
            this._cmdOK.Text     = SR.GetString(SR.GenericDialog_OKBtnCaption);
            this._cmdCancel.Text = SR.GetString(SR.GenericDialog_CancelBtnCaption);
            this._cmdHelp.Text   = SR.GetString(SR.GenericDialog_HelpBtnCaption);

            int tabOffset = GenericUI.InitDialog(
                this,
                _designer,
                _mergingContext
                );

            this.Text = _designer.UnderlyingControl.ID
                        + " - " + SR.GetString(SR.PropertyOverridesDialog_Title);
            SetTabIndexes(tabOffset);
            _designer.SetDeviceSpecificEditor(this);

            // Note that the following can cause an
            // IDeviceSpecificDesigner.Refresh() to occur as a side-effect.
            _designer.RefreshHeader(_mergingContext);
            _ignoreSelectionChanged = false;

            // NOTE: Calling CurrentDeviceSpecificID will cause a refresh to
            //       happen as a side effect.
            _currentDeviceSpecificID = _designer.CurrentDeviceSpecificID;
            if (_currentDeviceSpecificID != null)
            {
                _cbChoices.Items.Clear();
                LoadChoices(_currentDeviceSpecificID);
                if (!ValidateLoadedChoices())
                {
                    // Throw to prevent dialog from opening.  Caught and hidden
                    // by PropertyOverridesTypeEditor.cs
                    throw new InvalidChoiceException(
                              "Property overrides dialog can not open because there " +
                              "are invalid choices defined in the page."
                              );
                }
            }

            // Register Event Handlers
            _cbChoices.SelectedIndexChanged += new EventHandler(
                OnFilterSelected
                );
            _btnEditFilters.Click += new EventHandler(OnEditFilters);
            _cmdOK.Click          += new EventHandler(OnOK);
            _cmdCancel.Click      += new EventHandler(OnCancel);
            _cmdHelp.Click        += new EventHandler(OnHelp);
            UpdateUI();
        }
        internal AppliedDeviceFiltersDialog(
            IDeviceSpecificDesigner designer,
            int mergingContext)
        {
            _designer = designer;
            _designer.SetDeviceSpecificEditor(this);

            // Required for Win Form Designer support
            InitializeComponent();

            _lblAvailableFilters.Text =
                SR.GetString(SR.AppliedDeviceFiltersDialog_AvailableDeviceFilters);
            _appliedFiltersList.LblTitle.Text =
                SR.GetString(SR.AppliedDeviceFiltersDialog_AppliedDeviceFilters);
            _btnEditFilters.Text = SR.GetString(SR.GenericDialog_Edit);
            _btnApplyFilter.Text =
                SR.GetString(SR.AppliedDeviceFiltersDialog_ApplyDeviceFilter);
            _lblArgument.Text =
                SR.GetString(SR.AppliedDeviceFiltersDialog_Argument);
            _cmdOK.Text     = SR.GetString(SR.GenericDialog_OKBtnCaption);
            _cmdCancel.Text = SR.GetString(SR.GenericDialog_CancelBtnCaption);
            _cmdHelp.Text   = SR.GetString(SR.GenericDialog_HelpBtnCaption);

            int tabOffset = GenericUI.InitDialog(
                this,
                _designer,
                mergingContext
                );

            this.Text = _designer.UnderlyingControl.ID
                        + " - " + SR.GetString(SR.AppliedDeviceFiltersDialog_Title);
            SetTabIndexes(tabOffset);
            _webConfig = new WebConfigManager(_designer.UnderlyingControl.Site);
            LoadAvailableFilters();

            // Note that the following can cause an
            // IDeviceSpecificDesigner.Refresh() to occur as a side-effect.
            _designer.RefreshHeader(mergingContext);

            _currentDeviceSpecificID = _designer.CurrentDeviceSpecificID;
            if (_currentDeviceSpecificID != null)
            {
                DeviceSpecific ds;
                _designer.GetDeviceSpecific(_currentDeviceSpecificID, out ds);
                LoadChoices(ds);
            }

            // Register Event Handlers
            _cbAvailableFilters.SelectedIndexChanged += new EventHandler(
                OnAvailableFilterSelected
                );
            _cbAvailableFilters.TextChanged += new EventHandler(
                OnAvailableFilterSelected
                );
            _btnApplyFilter.Click += new EventHandler(OnApplyFilter);
            _btnEditFilters.Click += new EventHandler(OnEditFilters);
            _appliedFiltersList.TvList.AfterSelect    += new TreeViewEventHandler(OnAppliedFilterSelected);
            _appliedFiltersList.TvList.AfterLabelEdit += new NodeLabelEditEventHandler(OnAfterLabelEdit);
            _appliedFiltersList.BtnUp.Click           += new EventHandler(OnAppliedFiltersReordered);
            _appliedFiltersList.BtnDown.Click         += new EventHandler(OnAppliedFiltersReordered);
            _appliedFiltersList.BtnRemove.Click       -= _appliedFiltersList.RemoveHandler;
            _appliedFiltersList.BtnRemove.Click       += new EventHandler(OnRemove);
            _tbArgument.TextChanged += new EventHandler(OnArgumentChanged);
            _cmdOK.Click            += new EventHandler(OnOK);
            _cmdCancel.Click        += new EventHandler(OnCancel);
            _cmdHelp.Click          += new EventHandler(OnHelp);

            UpdateUI();
        }
        internal AppliedDeviceFiltersDialog(
            IDeviceSpecificDesigner designer, 
            int mergingContext) : base (designer.UnderlyingControl.Site)
        {
            _designer = designer;
            _designer.SetDeviceSpecificEditor(this);

            // Required for Win Form Designer support
            InitializeComponent();

            _lblAvailableFilters.Text =
                SR.GetString(SR.AppliedDeviceFiltersDialog_AvailableDeviceFilters);
            _appliedFiltersList.LblTitle.Text =
                SR.GetString(SR.AppliedDeviceFiltersDialog_AppliedDeviceFilters);
            _btnEditFilters.Text = SR.GetString(SR.GenericDialog_Edit);
            _btnApplyFilter.Text =
                SR.GetString(SR.AppliedDeviceFiltersDialog_ApplyDeviceFilter);
            _lblArgument.Text =
                SR.GetString(SR.AppliedDeviceFiltersDialog_Argument);
            _cmdOK.Text = SR.GetString(SR.GenericDialog_OKBtnCaption);
            _cmdCancel.Text = SR.GetString(SR.GenericDialog_CancelBtnCaption);

            int tabOffset = GenericUI.InitDialog(
                this,
                _designer,
                mergingContext
            );
            
            this.Text = _designer.UnderlyingControl.ID
                + " - " + SR.GetString(SR.AppliedDeviceFiltersDialog_Title);
            SetTabIndexes(tabOffset);
            _webConfig = new WebConfigManager(_designer.UnderlyingControl.Site);
            LoadAvailableFilters();

            // Note that the following can cause an
            // IDeviceSpecificDesigner.Refresh() to occur as a side-effect.
            _designer.RefreshHeader(mergingContext);

            _currentDeviceSpecificID = _designer.CurrentDeviceSpecificID;
            if(_currentDeviceSpecificID != null)
            {
                DeviceSpecific ds;
                _designer.GetDeviceSpecific(_currentDeviceSpecificID, out ds);
                LoadChoices(ds);
            }

            // Register Event Handlers
            _cbAvailableFilters.SelectedIndexChanged += new EventHandler(
                OnAvailableFilterSelected
            );
            _cbAvailableFilters.TextChanged += new EventHandler(
                OnAvailableFilterSelected
            );
            _btnApplyFilter.Click += new EventHandler(OnApplyFilter);
            _btnEditFilters.Click += new EventHandler(OnEditFilters);
            _appliedFiltersList.TvList.AfterSelect += new TreeViewEventHandler(OnAppliedFilterSelected);
            _appliedFiltersList.TvList.AfterLabelEdit += new NodeLabelEditEventHandler(OnAfterLabelEdit);
            _appliedFiltersList.BtnUp.Click += new EventHandler(OnAppliedFiltersReordered);
            _appliedFiltersList.BtnDown.Click += new EventHandler(OnAppliedFiltersReordered);
            _appliedFiltersList.BtnRemove.Click -= _appliedFiltersList.RemoveHandler;
            _appliedFiltersList.BtnRemove.Click += new EventHandler(OnRemove);
            _tbArgument.TextChanged += new EventHandler(OnArgumentChanged);
            _cmdOK.Click += new EventHandler(OnOK);
            _cmdCancel.Click += new EventHandler(OnCancel);

            UpdateUI();
        }