Example #1
0
 /// <summary>
 /// Appelé lorsque l'état de l'entité courante (spécifiée via RegisterToStateChanged) a changé.
 /// </summary>
 /// <param name="newState">le nouvel état.</param>
 protected override void OnEntityStateChanged(ObjectState newState)
 {
     CanChange &= newState == ObjectState.Unchanged;
     if (CurrentActionItem is ActionGanttItem actionGanttItem)
     {
         BrushesHelper.GetBrush(actionGanttItem.Action.Category?.Color, true, out Brush fillBrush, out Brush strokeBrush);
         actionGanttItem.FillBrush              = fillBrush;
         actionGanttItem.StrokeBrush            = strokeBrush;
         actionGanttItem.OrangeHeaderVisibility = ActionsTimingsMoveManagement.IsActionExternal(actionGanttItem.Action) ? Visibility.Visible : Visibility.Collapsed;
         ActionsManager.UpdateReductionDescription(actionGanttItem.Action, true);
     }
 }
Example #2
0
        /// <summary>
        /// Initialise un nouvel élément.
        /// </summary>
        /// <param name="item">L'élément.</param>
        /// <param name="referential">Le référentiel associé.</param>
        protected virtual void InitializeItem(TDataItem item, TReferential referential)
        {
            string color;

            if (referential == null)
            {
                color = null;
            }
            else
            {
                color = referential.Color;
            }

            Brush fill;
            Brush stroke;

            BrushesHelper.GetBrush(color, false, out fill, out stroke);

            item.FillBrush   = fill;
            item.StrokeBrush = stroke;
        }
Example #3
0
 /// <summary>
 /// Obtient des pinceaux à affecter aux items en fonction de leur catégorie.
 /// </summary>
 /// <param name="action">L'action.</param>
 /// <param name="fillBrush">Le pinceau pour le contenu.</param>
 /// <param name="strokeBrush">Le pinceau pour la bordure.</param>
 private void GetActionBrushes(KAction action, out Brush fillBrush, out Brush strokeBrush)
 {
     BrushesHelper.GetBrush(action.Category != null ? action.Category.Color : null, true, out fillBrush, out strokeBrush);
 }