internal static String GetDesignTimeErrorHtml(
            String errorMessage,
            bool infoMode,
            Control control,
            IHtmlControlDesignerBehavior behavior,
            ContainmentStatus containmentStatus)
        {
            String id = String.Empty;

            Debug.Assert(control != null, "control is null");

            if (control.Site != null)
            {
                id = control.Site.Name;
            }

            if (behavior != null)
            {
                behavior.SetStyleAttribute("borderWidth", true, "0px", true);
            }

            return(String.Format(CultureInfo.CurrentCulture,
                                 MobileControlDesigner.defaultErrorDesignTimeHTML,
                                 new Object[]
            {
                control.GetType().Name,
                id,
                errorMessage,
                infoMode? MobileControlDesigner.infoIcon : MobileControlDesigner.errorIcon,
                ((containmentStatus == ContainmentStatus.AtTopLevel) ?
                 Constants.ControlSizeAtToplevelInErrormode :
                 Constants.ControlSizeInContainer)
            }));
        }
        internal static void SetStandardStyleAttributes(IHtmlControlDesignerBehavior behavior,
                                                        ContainmentStatus containmentStatus)
        {
            if (behavior == null)
            {
                return;
            }

            bool controlAtTopLevel = (containmentStatus == ContainmentStatus.AtTopLevel);

            Color cw = SystemColors.Window;
            Color ct = SystemColors.WindowText;
            Color c  = Color.FromArgb((Int16)(ct.R * 0.1 + cw.R * 0.9),
                                      (Int16)(ct.G * 0.1 + cw.G * 0.9),
                                      (Int16)(ct.B * 0.1 + cw.B * 0.9));

            behavior.SetStyleAttribute("borderColor", true, ColorTranslator.ToHtml(c), true);
            behavior.SetStyleAttribute("borderStyle", true, "solid", true);

            behavior.SetStyleAttribute("borderWidth", true, "1px", true);
            behavior.SetStyleAttribute("marginLeft", true, "5px", true);
            behavior.SetStyleAttribute("marginRight", true, controlAtTopLevel ? "30%" : "5px", true);
            behavior.SetStyleAttribute("marginTop", true, controlAtTopLevel ? "5px" : "2px", true);
            behavior.SetStyleAttribute("marginBottom", true, controlAtTopLevel ? "5px" : "2px", true);
        }
        internal static  String GetDesignTimeErrorHtml(
            String errorMessage, 
            bool infoMode,
            Control control,
            IHtmlControlDesignerBehavior behavior,
            ContainmentStatus containmentStatus)
        {
            String id = String.Empty;
            Debug.Assert(control != null, "control is null");

            if (control.Site != null)
            {
                id = control.Site.Name;
            }

            if (behavior != null) {
                behavior.SetStyleAttribute("borderWidth", true, "0px", true);
            }

            return String.Format(CultureInfo.CurrentCulture,
                MobileControlDesigner.defaultErrorDesignTimeHTML,
                new Object[]
                {
                    control.GetType().Name,
                    id,
                    errorMessage,
                    infoMode? MobileControlDesigner.infoIcon : MobileControlDesigner.errorIcon,
                    ((containmentStatus == ContainmentStatus.AtTopLevel) ? 
                    Constants.ControlSizeAtToplevelInErrormode : 
                    Constants.ControlSizeInContainer)
                });
        }
        internal static  void SetStandardStyleAttributes(IHtmlControlDesignerBehavior behavior, 
                                                      ContainmentStatus containmentStatus)
        {
            if (behavior == null) {
                return;
            }

            bool controlAtTopLevel = (containmentStatus == ContainmentStatus.AtTopLevel);

            Color cw = SystemColors.Window;
            Color ct = SystemColors.WindowText;
            Color c = Color.FromArgb((Int16)(ct.R * 0.1 + cw.R * 0.9),
                (Int16)(ct.G * 0.1 + cw.G * 0.9),
                (Int16)(ct.B * 0.1 + cw.B * 0.9));
            behavior.SetStyleAttribute("borderColor", true, ColorTranslator.ToHtml(c), true);
            behavior.SetStyleAttribute("borderStyle", true, "solid", true);
                        
            behavior.SetStyleAttribute("borderWidth", true, "1px", true);
            behavior.SetStyleAttribute("marginLeft", true, "5px", true);
            behavior.SetStyleAttribute("marginRight", true, controlAtTopLevel ? "30%" : "5px", true);
            behavior.SetStyleAttribute("marginTop", true, controlAtTopLevel ? "5px" : "2px", true);
            behavior.SetStyleAttribute("marginBottom", true, controlAtTopLevel ? "5px" : "2px", true);
        }
Пример #5
0
 internal static void SetStandardStyleAttributes(IHtmlControlDesignerBehavior behavior, ContainmentStatus containmentStatus)
 {
     bool flag = containmentStatus == ContainmentStatus.AtTopLevel;
     Color window = SystemColors.Window;
     Color windowText = SystemColors.WindowText;
     Color c = Color.FromArgb((short) ((windowText.R * 0.1) + (window.R * 0.9)), (short) ((windowText.G * 0.1) + (window.G * 0.9)), (short) ((windowText.B * 0.1) + (window.B * 0.9)));
     behavior.SetStyleAttribute("borderColor", true, ColorTranslator.ToHtml(c), true);
     behavior.SetStyleAttribute("borderStyle", true, "solid", true);
     behavior.SetStyleAttribute("borderWidth", true, "1px", true);
     behavior.SetStyleAttribute("marginLeft", true, "5px", true);
     behavior.SetStyleAttribute("marginRight", true, flag ? "30%" : "5px", true);
     behavior.SetStyleAttribute("marginTop", true, flag ? "5px" : "2px", true);
     behavior.SetStyleAttribute("marginBottom", true, flag ? "5px" : "2px", true);
 }
Пример #6
0
 internal static string GetDesignTimeErrorHtml(string errorMessage, bool infoMode, Control control, IHtmlControlDesignerBehavior behavior, ContainmentStatus containmentStatus)
 {
     string name = string.Empty;
     if (control.Site != null)
     {
         name = control.Site.Name;
     }
     behavior.SetStyleAttribute("borderWidth", true, "0px", true);
     return string.Format(Constants.DefaultErrorDesignTimeHTML, new object[] { control.GetType().Name, name, errorMessage, infoMode ? Constants.InfoIconUrl : Constants.ErrorIconUrl, (containmentStatus == ContainmentStatus.AtTopLevel) ? Constants.ControlSizeAtToplevelInErrormode : Constants.ControlSizeInContainer });
 }