示例#1
0
        private bool ShouldSerializeAutoScaleBaseSize()
        {
            // Never serialize this unless AutoScale is turned

            // on

#pragma warning disable 618

            return(initializing ? false

             : ((Form)Component).AutoScale && ShadowProperties.Contains("AutoScaleBaseSize"));

#pragma warning restore 618
        }
示例#2
0
 /// <include file='doc\FormDocumentDesigner.uex' path='docs/doc[@for="FormDocumentDesigner.OnComponentAdded"]/*' />
 /// <devdoc>
 ///      Called when a component is added to the design container.
 ///      If the component isn't a control, this will demand create
 ///      the component tray and add the component to it.
 /// </devdoc>
 private void OnComponentAdded(object source, ComponentEventArgs ce)
 {
     if (ce.Component is Menu)
     {
         IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
         if (host != null && !host.Loading)
         {
             //if it's a MainMenu & we don't have one set for the form yet, then do it...
             //
             if (ce.Component is MainMenu && !ShadowProperties.Contains("Menu"))
             {
                 PropertyDescriptor menuProp = TypeDescriptor.GetProperties(Component)["Menu"];
                 Debug.Assert(menuProp != null, "What the hell happened to the Menu property");
                 menuProp.SetValue(Component, ce.Component);
             }
         }
     }
 }