Exemple #1
0
        private void pivotGridControl1_MouseMove(object sender, MouseEventArgs e)
        {
            mousePos = Point.Empty;
            PivotGridHitInfo info = pivotGridControl1.CalcHitInfo(e.Location);

            if (info.HitTest == PivotGridHitTest.Value)
            {
                mousePos = e.Location;
                BaseViewInfo newVI = info.ValueInfo.Data.ViewInfo.GetViewInfoAtPoint(e.Location);
                if (!object.ReferenceEquals(newVI, viewInfo))
                {
                    pivotGridControl1.Invalidate(newVI.PaintBounds);
                    if (viewInfo != null)
                    {
                        pivotGridControl1.Invalidate(viewInfo.PaintBounds);
                    }
                    viewInfo = newVI;
                }
            }
            else
            {
                if (viewInfo != null)
                {
                    pivotGridControl1.Invalidate(viewInfo.PaintBounds);
                }
                viewInfo = null;
            }
        }
 protected void DrawButton(BaseViewInfo vi)
 {
     if (((PropertyGridControlDescendant)vi.Grid).ButtonInfoList != null)
     {
         foreach (EditorButtonObjectInfoArgs info in ((PropertyGridControlDescendant)vi.Grid).ButtonInfoList)
         {
             if (info != null)
             {
                 EditorButtonPainter painter = EditorButtonHelper.GetPainter(BorderStyles.Default);
                 info.Cache = this.DrawInfo.Cache;
                 painter.DrawObject(info);
             }
         }
     }
 }
Exemple #3
0
        //----------------------------------------------------------------------------------------------------
        public static List <BaseViewInfo> ASPdb_View__GetRawList_NoCache(ASPdb_Connection aspdb_Connection)
        {
            AjaxService.ASPdatabaseService.GetSetVal();
            var rtn = new List <BaseViewInfo>();

            if (aspdb_Connection.E_ConnectionType == ASPdb_Connection.Enum_ConnectionTypes.SQLServer ||
                aspdb_Connection.E_ConnectionType == ASPdb_Connection.Enum_ConnectionTypes.SQLServerAzure)
            {
                string sql = @"
                    select 
	                    t2.schema_id,
	                    t2.[name] [SchemaName], 
	                    t1.[name] [ViewName], 
	                    t1.object_id,
	                    t1.create_date, 
	                    t1.modify_date
                    from sys.views t1
                    inner join 
	                    sys.schemas t2 on t1.schema_id = t2.schema_id
                    order by t2.[name], t1.[name]
                    ";
                using (DbConnectionCommand command = UniversalADO.OpenConnectionCommand(aspdb_Connection.GetConnectionString(), sql))
                {
                    using (DbReaderWrapper reader = command.ExecuteReaderWrapper())
                    {
                        DateTime?nullDate = null;
                        while (reader.Read())
                        {
                            var item = new BaseViewInfo();
                            item.SchemaId   = reader.Get("schema_id", "");
                            item.SchemaName = reader.Get("SchemaName", "");
                            item.ViewName   = reader.Get("ViewName", "");
                            item.ObjectId   = reader.Get("object_id", "");
                            item.CreateDate = reader.Get("create_date", nullDate);
                            item.ModifyDate = reader.Get("modify_date", nullDate);
                            rtn.Add(item);
                        }
                    }
                }
            }
            return(rtn);
        }
Exemple #4
0
 private void pivotGridControl1_MouseLeave(object sender, EventArgs e)
 {
     viewInfo = null;
     mousePos = Point.Empty;
 }
        protected override void DrawRowValueCellCore(CustomDrawRowValueCellEventArgs e, BaseEditPainter pb, BaseEditViewInfo bvi, BaseViewInfo vi)
        {
            MyPropertyGridControl grid       = (MyPropertyGridControl)vi.Grid;
            RowProperties         properties = e.Row.GetRowProperties(e.CellIndex);
            DescriptorContext     context    = grid.GetDescriptorContext(properties);
            UITypeEditor          editor     = grid.GetUITypeEditor(context);

            if (editor != null && editor.GetPaintValueSupported())
            {
                int                 indent = 1;
                Size                size   = new Size(e.Bounds.Size.Height - 2 * indent, e.Bounds.Size.Height - 2 * indent);
                Rectangle           bounds = new Rectangle(e.Bounds.X + indent, e.Bounds.Y + indent, size.Width, size.Height);
                PaintValueEventArgs args   = new PaintValueEventArgs(context, grid.GetCellValue(properties.Row, 0), e.Cache.Graphics, bounds);
                editor.PaintValue(args);
                e.Cache.DrawRectangle(Pens.DarkGray, bounds);
                Rectangle textBounds = new Rectangle(e.Bounds.X + bounds.Width + 2 * indent + indent, e.Bounds.Y, e.Bounds.Width - bounds.Width + 2 * indent, e.Bounds.Height);
                grid.Appearance.RecordValue.DrawString(e.Cache, grid.GetCellDisplayText(properties.Row, 0), textBounds);
            }
            else
            {
                base.DrawRowValueCellCore(e, pb, bvi, vi);
            }
        }
 public MultiRecordScrollStrategyDescendant(BaseViewInfo viewInfo)
     : base(viewInfo)
 {
 }
Exemple #7
0
        private static Rectangle GetFirstMergedCellBounds(CustomDrawRowValueCellEventArgs e, BaseViewInfo vi)
        {
            int recordIndex = e.RecordIndex + 1;

            while (NeigbourEqual(e, recordIndex))
            {
                recordIndex++;
            }
            BaseRowViewInfo ri             = vi.RowsViewInfo[e.Row.Index] as BaseRowViewInfo;
            Rectangle       lastCellBounds = GetValueBoundsByRecordIndex(ri, recordIndex);

            if (lastCellBounds.Right < e.Bounds.Left)
            {
                lastCellBounds = ri.RowRect;
            }
            return(new Rectangle(e.Bounds.Left, e.Bounds.Top, lastCellBounds.Right - e.Bounds.Left, e.Bounds.Height));
        }
Exemple #8
0
 public BandsScrollStrategyDescendant(BaseViewInfo viewInfo)
     : base(viewInfo)
 {
 }