コード例 #1
0
        /// <summary>
        /// Gets the glyphs for the associated activity designer
        /// </summary>
        /// <param name="activityDesigner"></param>
        /// <returns></returns>
        public ActivityDesignerGlyphCollection GetGlyphs(ActivityDesigner activityDesigner)
        {
            ActivityDesignerGlyphCollection glyphs = new ActivityDesignerGlyphCollection();
            //The glyph position indicates how far down the glyph is drawn
            int    glyphPosition   = -1;
            string validationError = string.Empty;

            if (profileManager.IsActivityValid(activityDesigner.Activity, out validationError))
            {
                //Add an error glyph if the selected activity is not configured correctly
                ++glyphPosition;
                glyphs.Add(new ErrorActivityGlyph(validationError));
            }
            if (profileManager.IsTracked(activityDesigner.Activity))
            {
                //Add the glyph for the trackpoint
                glyphs.Add(new TrackedActivityGlyph(++glyphPosition, redPin));
            }
            if (profileManager.IsMatchedByDerivedTrackPoint(activityDesigner.Activity))
            {
                //Add faded derive match glyph
                glyphs.Add(new TrackedActivityGlyph(++glyphPosition, fadedRedPin));
            }
            string annotation = profileManager.GetAnnotation(activityDesigner.Activity);

            if (annotation != null)
            {
                //If an annotation exists, use the tooltip via the description.
                activityDesigner.Activity.Description = annotation;
            }
            return(glyphs);
        }
コード例 #2
0
 private void annotateButton_Click(object sender, EventArgs e)
 {
     annotationText.Text         = profileManager.GetAnnotation(SelectedActivity);
     annotationToolStrip.Visible = true;
     annotateButton.Enabled      = false;
 }