private SQLiteParameter[] GetSqlParameters() { List <SQLiteParameter> SqlParmColl = new List <SQLiteParameter>(); try { SqlParmColl.Add(CommonDB.AddSqlParm("@PolylineID", PolylineID, DbType.Int64)); SqlParmColl.Add(CommonDB.AddSqlParm("@SymbolStatusID", SymbolStatusID, DbType.Int64)); SqlParmColl.Add(CommonDB.AddSqlParm("@oIndex", oIndex, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@BorderBlinking", BorderBlinking, DbType.Boolean)); SqlParmColl.Add(CommonDB.AddSqlParm("@BorderColor1", BorderColor1.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@BorderColor2", BorderColor2.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@BorderWidth", BorderWidth, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@BorderDashStyle", BorderDashStyle, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@LinePaternScale", LinePaternScale, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@Blinking", Blinking, DbType.Boolean)); SqlParmColl.Add(CommonDB.AddSqlParm("@FillColor11", FillColor11.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@FillColor12", FillColor12.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@FillColor21", FillColor21.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@FillColor22", FillColor22.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@FillType", FillType, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@LinearGradientBrush", LinearGradientBrush, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@HachStyle", HachStyle, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@HachColor", HachColor.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@NoPoints", NoPoints, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@Type", Type, DbType.Int32)); return(SqlParmColl.ToArray()); } catch (SQLiteException Exc) { throw Exc; } }
private SQLiteParameter[] GetSqlParameters() { List <SQLiteParameter> SqlParmColl = new List <SQLiteParameter>(); try { SqlParmColl.Add(CommonDB.AddSqlParm("@LineID", LineID, DbType.Int64)); SqlParmColl.Add(CommonDB.AddSqlParm("@SymbolStatusID", SymbolStatusID, DbType.Int64)); SqlParmColl.Add(CommonDB.AddSqlParm("@oIndex", oIndex, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@BoarderBlinking", BoarderBlinking, DbType.Boolean)); SqlParmColl.Add(CommonDB.AddSqlParm("@BorderColor1", BorderColor1.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@BorderColor2", BorderColor2.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@BorderWidth", BorderWidth, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@BorderDashStyle", BorderDashStyle, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@LinePaternScale", LinePaternScale, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@Blinking", Blinking, DbType.Boolean)); SqlParmColl.Add(CommonDB.AddSqlParm("@FillColor11", FillColor11.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@FillColor12", FillColor12.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@FillColor21", FillColor21.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@FillColor22", FillColor22.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@FillType", FillType, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@LinearGradientBrush", LinearGradientBrush, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@HachStyle", HachStyle, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@HachColor", HachColor.ToArgb(), DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@EndCap", EndCap, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@StartCap", StartCap, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@ArrowSize", ArrowSize, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@Top", Top, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@Bottom", Bottom, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@Left", Left, DbType.Int32)); SqlParmColl.Add(CommonDB.AddSqlParm("@Right", Right, DbType.Int32)); return(SqlParmColl.ToArray()); } catch (SQLiteException Exc) { throw Exc; } }
public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SmoothingMode = SmoothingMode.HighQuality; g.PixelOffsetMode = PixelOffsetMode.HighQuality; g.InterpolationMode = InterpolationMode.HighQualityBilinear; //Draw outer border using (GraphicsPath outerControlPath = GetRectangleClipPath(borderRectangle)) { g.SetClip(outerControlPath); Color borderColor1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BorderColor1.ToGrayScale() : BorderColor1; Color borderColor2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BorderColor2.ToGrayScale() : BorderColor2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, borderColor1, borderColor2, LinearGradientMode.Vertical)) { g.FillPath(borderBrush, outerControlPath); } g.ResetClip(); } //Draw inner background Rectangle innercontrolRectangle = new Rectangle(borderRectangle.X + 1, borderRectangle.Y + 1, borderRectangle.Width - 1, borderRectangle.Height - 2); using (GraphicsPath innerControlPath = GetRectangleClipPath(innercontrolRectangle)) { g.SetClip(innerControlPath); Color backColor1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BackColor1.ToGrayScale() : BackColor1; Color backColor2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BackColor2.ToGrayScale() : BackColor2; using (Brush backgroundBrush = new LinearGradientBrush(borderRectangle, backColor1, backColor2, LinearGradientMode.Horizontal)) { g.FillPath(backgroundBrush, innerControlPath); } //Draw inner top shadow Rectangle upperShadowRectangle = new Rectangle(innercontrolRectangle.X, innercontrolRectangle.Y, innercontrolRectangle.Width, UpperShadowHeight); g.IntersectClip(upperShadowRectangle); using (Brush shadowBrush = new LinearGradientBrush(upperShadowRectangle, UpperShadowColor1, UpperShadowColor2, LinearGradientMode.Vertical)) { g.FillRectangle(shadowBrush, upperShadowRectangle); } g.ResetClip(); } }