Пример #1
0
        public void LoadCell(IGnosisCaptionLabelImplementation header, int col, int row, int colSpan, int rowSpan)
        {
            GnosisCaptionLabel captionLabel = (GnosisCaptionLabel)header;

            if (captionLabel.RelativePosition == GnosisController.CaptionPosition.LEFT)
            {
                captionLabel.VerticalAlignment   = VerticalAlignment.Top;
                captionLabel.HorizontalAlignment = HorizontalAlignment.Right;
            }
            else if (captionLabel.RelativePosition == GnosisController.CaptionPosition.RIGHT)
            {
                captionLabel.VerticalAlignment   = VerticalAlignment.Top;
                captionLabel.HorizontalAlignment = HorizontalAlignment.Left;
            }


            Grid.SetColumn(captionLabel, col);
            Grid.SetColumnSpan(captionLabel, colSpan);
            Grid.SetRow(captionLabel, row);
            Grid.SetRowSpan(captionLabel, rowSpan);

            gridContent.Children.Add(captionLabel);
        }
Пример #2
0
        //public GnosisGridFieldController FieldController
        //{
        //    get { return fieldController; }
        //}

        public GnosisGridColumnController(
            GnosisGridColumn column,
            GnosisInstanceController _instanceController,
            GnosisGridController _parent)
        {
            columnModel        = column;
            instanceController = _instanceController;
            parent             = _parent;
            fields             = new List <IGnosisGridFieldImplementation>();

            //header
            header = GnosisControlCreator.CreateGnosisGridHeaderField();
            GnosisStyle captionStyle = _instanceController.EntityController.GetCaptionStyle();

            GlobalData.Singleton.StyleHelper.ApplyCaptionStyle(header, captionStyle);
            double height = GlobalData.Singleton.StyleHelper.GetFieldHeight(header, captionStyle.Font, captionStyle.FontSize);

            ((GnosisGridHeaderField)header).Height = height;
            header.Caption = column.Caption;

            //columnar header
            columnarHeader = GnosisControlCreator.CreateGnosisCaptionLabel();
            GlobalData.Singleton.StyleHelper.ApplyCaptionStyle(columnarHeader, _instanceController.EntityController.GetCaptionStyle());

            SetDisplayWidths();

            ////field for cloning
            //if (column is GnosisTextColumn)
            //{
            //    // IGnosisGridTextFieldImplementation textFieldImp = GlobalData.Singleton.ImplementationCreator.GetGnosisGridTextFieldImplementation();
            //    ModelCreator.CreateGnosisGridTextField(1);
            //    fieldController = new GnosisGridTextFieldController(this, textFieldImp, instanceController, parent, 0);
            //    GlobalData.Singleton.StyleHelper.ApplyStyle(textFieldImp, fieldController, instanceController.EntityController.GetNormalStyle());
            //}
            //else if (column is GnosisTextResults)
            //{
            //    IGnosisTextResultsFieldImplementation textFieldImp = GlobalData.Singleton.ImplementationCreator.GetGnosisTextResultsFieldImplementation();
            //    fieldController = new GnosisTextResultsFieldController(this, textFieldImp, instanceController, (GnosisSearchResultsGridController)parent, 0);
            //    GlobalData.Singleton.StyleHelper.ApplyStyle(textFieldImp, fieldController, instanceController.EntityController.GetNormalStyle());
            //}
            //else if (column is GnosisCheckColumn)
            //{
            //    IGnosisGridCheckFieldImplementation checkFieldImp = GlobalData.Singleton.ImplementationCreator.GetGnosisGridCheckFieldImplementation();
            //    fieldController = new GnosisGridCheckFieldController(this, checkFieldImp, instanceController, parent, 0);
            //    GlobalData.Singleton.StyleHelper.ApplyStyle(checkFieldImp, fieldController, instanceController.EntityController.GetNormalStyle());
            //}
            //else if (column is GnosisCheckResults)
            //{
            //    IGnosisCheckResultsFieldImplementation checkFieldImp = GlobalData.Singleton.ImplementationCreator.GetGnosisCheckResultsFieldImplementation();
            //    fieldController = new GnosisCheckResultsFieldController(this, checkFieldImp, instanceController, (GnosisSearchResultsGridController)parent, 0);
            //}
            //else if (column is GnosisComboColumn)
            //{
            //    IGnosisGridComboFieldImplementation comboFieldImp = GlobalData.Singleton.ImplementationCreator.GetGnosisGridComboFieldImplementation();
            //    fieldController = new GnosisGridComboFieldController(this, comboFieldImp, instanceController, parent, 0);
            //}
            //else if (column is GnosisDateColumn)
            //{
            //    IGnosisGridDateFieldImplementation dateFieldImp = GlobalData.Singleton.ImplementationCreator.GetGnosisGridDateFieldImplementation();
            //    fieldController = new GnosisGridDateFieldController(this, dateFieldImp, instanceController, parent, 0);
            //}
            //else if (column is GnosisDateResults)
            //{
            //    IGnosisDateResultsFieldImplementation dateResultsImp = GlobalData.Singleton.ImplementationCreator.GetGnosisDateResultsFieldImplementation();
            //    fieldController = new GnosisDateResultsFieldController(this, dateResultsImp, instanceController, (GnosisSearchResultsGridController)parent, 0);
            //}
            //else if (column is GnosisDateTimeColumn)
            //{
            //    IGnosisGridDateTimeFieldImplementation dateTimeFieldImp = GlobalData.Singleton.ImplementationCreator.GetGnosisGridDateTimeFieldImplementation();
            //    fieldController = new GnosisGridDateTimeFieldController(this, dateTimeFieldImp, instanceController, parent, 0);
            //}
            //else if (column is GnosisDateTimeResults)
            //{
            //    IGnosisDateTimeResultsFieldImplementation dateTimeResultsImp = GlobalData.Singleton.ImplementationCreator.GetGnosisDateTimeResultsFieldImplementation();
            //    fieldController = new GnosisGridFieldController(this, dateTimeResultsImp, instanceController, (GnosisSearchResultsGridController)parent, 0);
            //}
            //fieldController.ControlImplementation.Order = column.Order;

            //get min and max field width
        }