示例#1
0
        //
        //  FlexgridGetCellRange
        //

        /// <summary>
        /// Calls into the AUT to iterate over every cell in the grid returning a \t \r separated string of the
        /// required property of the cells
        /// </summary>
        /// <param name="sourceStore">The datastore which contains the grid object</param>
        /// <param name="destinationStore">The datastore to put the resultant string into</param>
        /// <param name="row1">The start row of the range</param>
        /// <param name="column1">The start column of the range</param>
        /// <param name="row2">The end row of the range</param>
        /// <param name="column2">The end column of the range</param>
        unsafe public void AddQueryMessageFlexgridGetCellRange(DataStores sourceStore, DataStores destinationStore, int row1, int column1, int row2, int column2, CellProperty property)
        {
            if (!m_DoneFind)
            {
                throw new Exception("Must locate the flexgrid before trying to use it");
            }

            Message *ptrMessage = GetPointerToNextMessage();

            ptrMessage->SourceStore      = sourceStore;
            ptrMessage->DestinationStore = destinationStore;

            switch (property)
            {
            case CellProperty.BackColourName:
                ptrMessage->Action = MessageAction.FlexgridGetCellRangeBackColourName;
                break;

            case CellProperty.ForeColourName:
                ptrMessage->Action = MessageAction.FlexgridGetCellRangeForeColourName;
                break;

            case CellProperty.DataType:
                ptrMessage->Action = MessageAction.FlexgridGetCellRangeDataType;
                break;

            case CellProperty.CheckBox:
                ptrMessage->Action = MessageAction.FlexgridGetCellRangeCheckBox;
                break;

            case CellProperty.Image:
                ptrMessage->Action = MessageAction.FlexgridGetCellRangeImage;
                break;

            case CellProperty.BackgroundImage:
                ptrMessage->Action = MessageAction.FlexgridGetCellRangeBackgroundImage;
                break;

            default:
                throw new Exception("Implement support for getting cell property " + property.ToString());
            }

            Parameter row1Parameter    = new Parameter(this, row1);
            Parameter column1Parameter = new Parameter(this, column1);
            Parameter row2Parameter    = new Parameter(this, row2);
            Parameter column2Parameter = new Parameter(this, column2);

            m_PtrMessageStore->NumberOfMessages++;
            m_DoneQuery = true;
        }
示例#2
0
        /// <summary>
        /// Gets the parameters from the message then calls the appropriate FlexgridGetCellRange method
        /// on the correct thread storing the results in the specified datastore
        /// </summary>
        /// <param name="ptrMessage">A pointer to the message</param>
        unsafe private void FlexgridGetCellRange(Message *ptrMessage, CellProperty property)
        {
            int    row1              = GetParameterInt32(ptrMessage, 0);
            int    column1           = GetParameterInt32(ptrMessage, 1);
            int    row2              = GetParameterInt32(ptrMessage, 2);
            int    column2           = GetParameterInt32(ptrMessage, 3);
            object sourceObject      = GetObjectFromDatastore(ptrMessage->SourceStore);
            object destinationObject = null;

            if (sourceObject != null)
            {
                object[] theParameters = { sourceObject, row1, column1, row2, column2 };
                switch (property)
                {
                case CellProperty.BackColourName:
                    destinationObject = ((WF.Control)tempStore0).Invoke(m_FlexgridGetCellRangeBackColourNameDelegater, theParameters);
                    break;

                case CellProperty.ForeColourName:
                    destinationObject = ((WF.Control)tempStore0).Invoke(m_FlexgridGetCellRangeForeColourNameDelegater, theParameters);
                    break;

                case CellProperty.DataType:
                    destinationObject = ((WF.Control)tempStore0).Invoke(m_FlexgridGetCellRangeDataTypeDelegater, theParameters);
                    break;

                case CellProperty.CheckBox:
                    destinationObject = ((WF.Control)tempStore0).Invoke(m_FlexgridGetCellRangeCheckBoxDelegater, theParameters);
                    break;

                case CellProperty.Image:
                    destinationObject = ((WF.Control)tempStore0).Invoke(m_FlexgridGetCellRangeImageDelegater, theParameters);
                    break;

                case CellProperty.BackgroundImage:
                    destinationObject = ((WF.Control)tempStore0).Invoke(m_FlexgridGetCellRangeBackgroundImageDelegater, theParameters);
                    break;

                default:
                    throw new Exception("Implement support for getting cell property " + property.ToString());
                }
            }

            PutObjectInDatastore(ptrMessage->DestinationStore, destinationObject);
            CleanUpMessage(ptrMessage);
        }