Example #1
0
        /// <summary>
        /// open the context menu
        /// </summary>
        /// <param name="menuID"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        public override void ShowContextMenu(CommandID menuID, int x, int y)
        {
            menu.Items[RuntimeHostSurface.GetTranslatedString(surface, STR_MENU_DELETE)].Visible = surface.AdminMode;
            menu.Items[RuntimeHostSurface.GetTranslatedString(surface, STR_MENU_DELETE)].Enabled = surface.CanDeleteSelectedItems();
            menu.Items[STR_MENU_SEPARATOR].Visible = surface.AdminMode;

            menu.Items[RuntimeHostSurface.GetTranslatedString(surface, STR_MENU_RESET)].Enabled = CanResetSelectedItems();

            menu.Show(x, y);
        }
Example #2
0
 /// Empty constructor simply creates a new form.
 internal RuntimeHostLoader(Type rootComponentType, Form formToClone,
                            CreateAllOwnerDrawControlsDelegate createAllOwnerDrawControls,
                            GetControlDesignerInfoDelegate getControlDesignerInfo,
                            RuntimeHostSurface hostSurface)
 {
     this.rootComponentType          = rootComponentType;
     this.Modified                   = true;
     this.formToClone                = formToClone;
     this.createAllOwnerDrawControls = createAllOwnerDrawControls;
     this.getControlDesignerInfo     = getControlDesignerInfo;
     this.runtimeHostSurface         = hostSurface;
 }
Example #3
0
        //ToolStripButton breakMenuItem;

        /// <summary>
        /// CTOR
        /// </summary>
        /// <param name="propertyGrid"></param>
        /// <param name="selectionService"></param>
        internal PropertyGridManager(PropertyGrid propertyGrid, ISelectionService selectionService, IDesignerHost host, RuntimeHostSurface surface)
        {
            this.propertyGrid     = propertyGrid;
            this.selectionService = selectionService;
            this.surface          = surface;

            selectionService.SelectionChanged += selectionService_SelectionChanged;

            host.TransactionClosed += host_TransactionClosed;
            CreateContextMenu();
            SetPropertyGridStyle();
        }
Example #4
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        internal string GetFileName()
        {
            RuntimeHostSurface runtimeHostSurface = this.CurrentDocumentsHostControl.HostSurface;
            Form   form     = CurrentDocumentsHostControl.DesignerHost.RootComponent as Form;
            String fileName = "";

            if (runtimeHostSurface.ComponentsDictionary.ContainsKey(form))
            {
                ComponentWrapper   cw = runtimeHostSurface.ComponentsDictionary[form];
                PropertyDescriptor pd = cw.PropertiesDescriptors[Constants.ConfigurationFilePropertyName];
                if (pd != null) //for tests
                {
                    fileName = pd.GetValue(form) as String;
                }
            }

            return(fileName);
        }
Example #5
0
        /// <summary>
        /// Initialize the context menu
        /// </summary>
        void InitMenu()
        {
            menu = new ContextMenuStrip();

            String            str = RuntimeHostSurface.GetTranslatedString(surface, STR_MENU_RESET);
            ToolStripMenuItem t   = new ToolStripMenuItem(str, null, OnResetClicked);

            t.Name = t.Text;
            menu.Items.Add(t);

            ToolStripSeparator separator = new ToolStripSeparator();

            separator.Name = STR_MENU_SEPARATOR;
            menu.Items.Add(separator);

            str    = RuntimeHostSurface.GetTranslatedString(surface, STR_MENU_DELETE);
            t      = new ToolStripMenuItem(str, null, OnDeleteClicked);
            t.Name = t.Text;
            menu.Items.Add(t);
        }
Example #6
0
 /// <summary>
 /// handle restoring a hidden control
 /// </summary>
 /// <param name="control"></param>
 void ControlRestored(Control control)
 {
     RuntimeHostSurface.RestoreControl(control);
 }
Example #7
0
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="serviceProvider"></param>
 internal RuntimeMenuService(RuntimeHostSurface serviceProvider)
     : base(serviceProvider)
 {
     surface = serviceProvider;
     InitMenu();
 }
Example #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="disposing"></param>
 protected override void Dispose(bool disposing)
 {
     surface = null;
     base.Dispose(disposing);
 }