コード例 #1
0
        private List <ActivityDesigner> GetMatchingActivityDesigners(ActivityDesigner activityDesigner)
        {
            CompositeActivityDesigner rootDesigner = DesignerPainter.GetRootDesigner(activityDesigner);

            matchingActivityDesigner = new List <ActivityDesigner>();

            Walker activityTreeWalker = new Walker();

            activityTreeWalker.FoundActivity += new WalkerEventHandler(OnWalkerFoundActivity);
            activityTreeWalker.Walk(rootDesigner.Activity);

            return(matchingActivityDesigner);
        }
コード例 #2
0
        protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer)
        {
            Rectangle frameRect  = Bounds;
            Rectangle shadowRect = frameRect;

            Color BaseColor     = Color.FromArgb(150, 0, 0, 0); // dark semitransparent backdrop
            Color LightingColor = Color.FromArgb(150, 0, 0, 0);

            Brush frameBrush = new LinearGradientBrush(new Point(frameRect.Left, frameRect.Top), new Point(frameRect.Left, frameRect.Bottom), BaseColor, LightingColor);

            shadowRect = DropRoundedRectangleShadow(shadowRect, graphics);
            graphics.FillPath(frameBrush, RoundedRect(frameRect));
            graphics.SmoothingMode     = SmoothingMode.HighQuality;
            graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;

            foreach (ActivityDesigner highlightedDesigner in HighlightedDesigners)
            {
                DesignerPainter.PaintDesigner(highlightedDesigner, new ActivityDesignerPaintEventArgs(graphics, designer.Bounds, designer.Bounds, null));
            }
        }