protected override String GetErrorMessage(out bool infoMode) { infoMode = false; if (!DesignerAdapterUtil.InMobileUserControl(_styleSheet)) { if (DesignerAdapterUtil.InUserControl(_styleSheet)) { infoMode = true; return(MobileControlDesigner._userControlWarningMessage); } if (!DesignerAdapterUtil.InMobilePage(_styleSheet)) { return(MobileControlDesigner._mobilePageErrorMessage); } } if (!ValidContainment) { return(MobileControlDesigner._topPageContainmentErrorMessage); } // No error condition, return null; return(null); }
protected override String GetErrorMessage(out bool infoMode) { infoMode = false; // Skip containment checking if the control is placed in MobileUserControl if (DesignerAdapterUtil.InMobileUserControl(_panel)) { return(null); } if (DesignerAdapterUtil.InUserControl(_panel)) { infoMode = true; return(MobileControlDesigner._userControlWarningMessage); } if (!DesignerAdapterUtil.InMobilePage(_panel)) { return(SR.GetString(SR.MobileControl_MobilePageErrorMessage)); } if (!ValidContainment) { return(SR.GetString(SR.MobileControl_FormPanelContainmentErrorMessage)); } return(null); }
protected virtual String GetErrorMessage(out bool infoMode) { infoMode = false; if (!DesignerAdapterUtil.InMobileUserControl(_control)) { if (DesignerAdapterUtil.InUserControl(_control)) { infoMode = true; return(MobileControlDesigner._userControlWarningMessage); } if (!DesignerAdapterUtil.InMobilePage(_control)) { return(MobileControlDesigner._mobilePageErrorMessage); } if (!ValidContainment) { return(MobileControlDesigner._formPanelContainmentErrorMessage); } } if (CurrentChoice != null && !IsHTMLSchema(CurrentChoice)) { infoMode = true; return(_nonHtmlSchemaErrorMessage); } // Containment is valid, return null; return(null); }
/// <summary> /// <para> /// Filter the properties to replace the runtime DataSource property /// descriptor with the designer's. /// </para> /// </summary> /// <param name='properties'> /// The set of properties to filter. /// </param> /// <seealso cref='IDesignerFilter'/> protected override void PreFilterProperties(IDictionary properties) { base.PreFilterProperties(properties); Type designerType = this.GetType(); DesignerAdapterUtil.AddAttributesToPropertiesOfDifferentType( designerType, typeof(String), properties, _dataSourcePropertyName, new TypeConverterAttribute(typeof(DataSourceConverter))); DesignerAdapterUtil.AddAttributesToProperty( designerType, properties, _dataMemberPropertyName, _emptyAttrs); DesignerAdapterUtil.AddAttributesToProperty( designerType, properties, _dataTextFieldPropertyName, _emptyAttrs); DesignerAdapterUtil.AddAttributesToProperty( designerType, properties, _dataValueFieldPropertyName, _emptyAttrs); }
protected override String GetErrorMessage(out bool infoMode) { infoMode = false; if (DesignerAdapterUtil.InMobileUserControl(_textView)) { return(null); } if (DesignerAdapterUtil.InUserControl(_textView)) { infoMode = true; return(MobileControlDesigner._userControlWarningMessage); } if (!DesignerAdapterUtil.InMobilePage(_textView)) { return(MobileControlDesigner._mobilePageErrorMessage); } if (!ValidContainment) { return(MobileControlDesigner._formPanelContainmentErrorMessage); } // Containment is valid, return null; return(null); }
protected override String GetErrorMessage(out bool infoMode) { infoMode = false; if (!DesignerAdapterUtil.InMobileUserControl(_form)) { if (DesignerAdapterUtil.InUserControl(_form)) { infoMode = true; return(MobileControlDesigner._userControlWarningMessage); } if (!DesignerAdapterUtil.InMobilePage(_form)) { return(SR.GetString(SR.MobileControl_MobilePageErrorMessage)); } } if (!ValidContainment) { return(SR.GetString(SR.MobileControl_TopPageContainmentErrorMessage)); } return(null); }
public override bool EditComponent(ITypeDescriptorContext context, Object component) { Debug.Assert(component is StyleSheet); StyleSheet styleSheet = (StyleSheet)component; StyleSheetDesigner designer = (StyleSheetDesigner)DesignerAdapterUtil.ControlDesigner(styleSheet); //String currentStyle = designer.TemplateStyle; if (designer.InTemplateMode) { MessageBox.Show(SR.GetString(SR.BaseTemplatedMobileComponentEditor_TemplateModeErrorMessage), SR.GetString(SR.BaseTemplatedMobileComponentEditor_TemplateModeErrorTitle), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } StylesEditorDialog dialog; try { dialog = new StylesEditorDialog( styleSheet, designer, null /*currentStyle*/ ); } catch//(ArgumentException e) { // Debug.Fail(e.ToString()); // Block user from entering StylesEditorDialog until they fix // duplicate style declarations. return(false); } return(dialog.ShowDialog() == DialogResult.OK); }
protected virtual String GetErrorMessage(out bool infoMode) { infoMode = false; // Skip containment checking if the control is placed in MobileUserControl if (!DesignerAdapterUtil.InMobileUserControl(_mobileControl)) { if (DesignerAdapterUtil.InUserControl(_mobileControl)) { infoMode = true; return(MobileControlDesigner._userControlWarningMessage); } if (!DesignerAdapterUtil.InMobilePage(_mobileControl)) { return(_mobilePageErrorMessage); } if (!ValidContainment) { return(_formPanelContainmentErrorMessage); } } bool containsTag; bool containsDataboundLiteral; _mobileControl.GetControlText(out containsTag, out containsDataboundLiteral); if (containsTag) { return(SR.GetString(SR.MobileControl_InnerTextCannotContainTagsDesigner)); } // Containment is valid, return null; return(null); }
protected virtual void SetStyleAttributes() { Debug.Assert(Behavior != null); DesignerAdapterUtil.SetStandardStyleAttributes(Behavior, ContainmentStatus); }
protected virtual String GetDesignTimeErrorHtml(String errorMessage, bool infoMode) { return(DesignerAdapterUtil.GetDesignTimeErrorHtml( errorMessage, infoMode, _control, Behavior, ContainmentStatus)); }
protected virtual void SetStyleAttributes() { //Debug.Assert(Behavior != null, "Behavior is null, Load completed? " + LoadComplete.ToString()); DesignerAdapterUtil.SetStandardStyleAttributes(Behavior, ContainmentStatus); }