示例#1
0
        /// <summary>
        ///   creates controland coordinator according to the type
        /// </summary>
        /// <param name = "commandType"></param>
        /// <param name = "mgControl"></param>
        /// <param name = "containerControl"></param>
        /// <returns></returns>
        internal static LogicalControl createControl(CommandType commandType, GuiMgControl guiMgControl,
                                                     Control containerControl, int mgRow, int mgColumn)
        {
            LogicalControl lg = createControl(commandType, guiMgControl, containerControl);

            lg._mgRow    = mgRow;
            lg._mgColumn = mgColumn;
            ContainerManager containerManager = GuiUtilsBase.getContainerManager(containerControl);

            if (containerManager is TableManager)
            {
                TableCoordinator tableCoordinator = new TableCoordinator((TableManager)containerManager, lg, mgColumn);
                lg._coordinator    = tableCoordinator;
                lg._editorProvider = tableCoordinator;
            }
            else if (containerManager is BasicControlsManager)
            {
                EditorSupportingCoordinator editorSupportingCoordinator = new EditorSupportingCoordinator(lg);
                lg._coordinator    = editorSupportingCoordinator;
                lg._editorProvider = editorSupportingCoordinator;
            }
            else // tree
            {
                Debug.Assert(false);
            }

            return(lg);
        }
示例#2
0
        /// <summary>
        /// Gets logical control cell rect in table
        /// </summary>
        /// <param name="lg"></param>
        /// <returns></returns>
        public override Rectangle GetCellRect(PlacementDrivenLogicalControl lg)
        {
            LogicalControl   logicalControl   = (LogicalControl)lg;
            TableCoordinator tableCoordinator = (TableCoordinator)lg.Coordinator;

            return(tableCoordinator.GetCellRect(lg._mgColumn, logicalControl._mgRow));
        }