Exemple #1
0
 /// <summary>
 /// Redirect all luminosity modification to the ORMDiagram.ModifyLuminosity
 /// algorithm
 /// </summary>
 /// <param name="currentLuminosity">The luminosity to modify</param>
 /// <param name="view">The view containing this item</param>
 /// <returns>Modified luminosity value</returns>
 protected override int ModifyLuminosity(int currentLuminosity, DiagramClientView view)
 {
     if (view.HighlightedShapes.Contains(new DiagramItem(this)))
     {
         return(ORMDiagram.ModifyLuminosity(currentLuminosity));
     }
     return(currentLuminosity);
 }
Exemple #2
0
        /// <summary>
        /// Add error brushes to the styleSet
        /// </summary>
        protected override void InitializeResources(StyleSet classStyleSet)
        {
            base.InitializeResources(classStyleSet);

            IORMFontAndColorService colorService  = (Store as IORMToolServices).FontAndColorService;
            BrushSettings           brushSettings = new BrushSettings();

            //UNDONE: This color isn't permanent. probably want a better color for the errors.
            brushSettings.ForeColor = Color.LightPink;
            //brushSettings.ForeColor = colorService.GetForeColor(ORMDesignerColor.ConstraintError);
            brushSettings.HatchStyle = HatchStyle.LightDownwardDiagonal;
            brushSettings.BrushType  = typeof(HatchBrush);
            classStyleSet.AddBrush(ORMDiagram.ErrorBackgroundResource, DiagramBrushes.DiagramBackground, brushSettings);
            brushSettings.ForeColor = ORMDiagram.ModifyLuminosity(brushSettings.ForeColor);
            brushSettings.BackColor = ORMDiagram.ModifyLuminosity(((SolidBrush)classStyleSet.GetBrush(DiagramBrushes.DiagramBackground)).Color);
            classStyleSet.AddBrush(ORMDiagram.HighlightedErrorBackgroundResource, DiagramBrushes.DiagramBackground, brushSettings);

            BrushSettings transBrush = new BrushSettings();

            transBrush.ForeColor = Color.Transparent;
            classStyleSet.AddBrush(ORMDiagram.TransparentBrushResource, DiagramBrushes.DiagramBackground, transBrush);
        }