我曾经在wcf数据服务服务操作中访问我的(ef 5.0)实体的数据上下文this.CurrentDataSource.MyEntity.我的数据服务继承自DataService<T>.现在我想使用实体框架6.0并在互联网上阅读,我应该继承服务EntityFrameworkDataService<T>.但是现在从我的服务操作中,我再也无法访问我的数据上下文了.this.CurrentDataSource不包含对实体的任何引用.
我使用以下代码创建了带有彩色边框的组合框:
Public Class BorderGroupBox
Inherits GroupBox
Private _borderColor As Color
Private _borderWidth As Integer
Private _borderStyle As ButtonBorderStyle
...
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim tSize As Size = TextRenderer.MeasureText(Me.Text, Me.Font)
Dim borderRect As Rectangle = e.ClipRectangle
borderRect.Y = CInt((borderRect.Y + (tSize.Height / 2)))
borderRect.Height = CInt((borderRect.Height - (tSize.Height / 2)))
ControlPaint.DrawBorder(e.Graphics, borderRect, _borderColor, _borderWidth, _borderStyle, BorderColor, _borderWidth, _borderStyle, BorderColor, _borderWidth, _borderStyle, BorderColor, _borderWidth, _borderStyle)
Dim textRect As Rectangle = e.ClipRectangle
textRect.X = (textRect.X + 6)
textRect.Width = …Run Code Online (Sandbox Code Playgroud)