public OrientationActionList(SplitContainerDesigner owner) : base(owner.Component)
 {
     this.owner          = owner;
     this.ownerComponent = owner.Component as Component;
     if (this.ownerComponent != null)
     {
         PropertyDescriptor descriptor = TypeDescriptor.GetProperties(this.ownerComponent)["Orientation"];
         if (descriptor != null)
         {
             bool flag = ((Orientation)descriptor.GetValue(this.ownerComponent)) == Orientation.Horizontal;
             this.actionName = flag ? System.Design.SR.GetString("DesignerShortcutVerticalOrientation") : System.Design.SR.GetString("DesignerShortcutHorizontalOrientation");
         }
     }
 }
Пример #2
0
        public override void Initialize(IComponent component)
        {
            base.Initialize(component);
            this.splitterPanel          = (SplitterPanel)component;
            this.designerHost           = (IDesignerHost)component.Site.GetService(typeof(IDesignerHost));
            this.splitContainerDesigner = (SplitContainerDesigner)this.designerHost.GetDesigner(this.splitterPanel.Parent);
            IComponentChangeService service = (IComponentChangeService)this.GetService(typeof(IComponentChangeService));

            if (service != null)
            {
                service.ComponentChanged += new ComponentChangedEventHandler(this.OnComponentChanged);
            }
            PropertyDescriptor descriptor = TypeDescriptor.GetProperties(component)["Locked"];

            if ((descriptor != null) && (this.splitterPanel.Parent is SplitContainer))
            {
                descriptor.SetValue(component, true);
            }
        }
 public OrientationActionList(SplitContainerDesigner owner) : base(owner.Component)
 {
     this.owner = owner;
     this.ownerComponent = owner.Component as Component;
     if (this.ownerComponent != null)
     {
         PropertyDescriptor descriptor = TypeDescriptor.GetProperties(this.ownerComponent)["Orientation"];
         if (descriptor != null)
         {
             bool flag = ((Orientation) descriptor.GetValue(this.ownerComponent)) == Orientation.Horizontal;
             this.actionName = flag ? System.Design.SR.GetString("DesignerShortcutVerticalOrientation") : System.Design.SR.GetString("DesignerShortcutHorizontalOrientation");
         }
     }
 }
 public override void Initialize(IComponent component)
 {
     base.Initialize(component);
     this.splitterPanel = (SplitterPanel) component;
     this.designerHost = (IDesignerHost) component.Site.GetService(typeof(IDesignerHost));
     this.splitContainerDesigner = (SplitContainerDesigner) this.designerHost.GetDesigner(this.splitterPanel.Parent);
     IComponentChangeService service = (IComponentChangeService) this.GetService(typeof(IComponentChangeService));
     if (service != null)
     {
         service.ComponentChanged += new ComponentChangedEventHandler(this.OnComponentChanged);
     }
     PropertyDescriptor descriptor = TypeDescriptor.GetProperties(component)["Locked"];
     if ((descriptor != null) && (this.splitterPanel.Parent is SplitContainer))
     {
         descriptor.SetValue(component, true);
     }
 }