DesignerGlyph.GetBounds(ActivityDesigner, Boolean) Metoda

Definicja

Zwraca granice dla glyph w określonym obiekcie ActivityDesigner.

public:
 virtual System::Drawing::Rectangle GetBounds(System::Workflow::ComponentModel::Design::ActivityDesigner ^ designer, bool activated);
public virtual System.Drawing.Rectangle GetBounds (System.Workflow.ComponentModel.Design.ActivityDesigner designer, bool activated);
abstract member GetBounds : System.Workflow.ComponentModel.Design.ActivityDesigner * bool -> System.Drawing.Rectangle
override this.GetBounds : System.Workflow.ComponentModel.Design.ActivityDesigner * bool -> System.Drawing.Rectangle
Public Overridable Function GetBounds (designer As ActivityDesigner, activated As Boolean) As Rectangle

Parametry

designer
ActivityDesigner

Z ActivityDesigner którym jest skojarzona glifa.

activated
Boolean

true aby wskazać, czy glyph pojawia się na powierzchni projektanta działań; w przeciwnym razie , false.

Zwraca

Rectangle

Element Rectangle reprezentujący granice glifu.

Wyjątki

designerzawiera odwołanie o wartości null (Nothingw Visual Basic).

Przykłady

Poniższy przykład kodu pokazuje, jak można zastąpić metodę GetBounds . Kod ustawia rozmiar i lokalizację niestandardowego obiektu glyph.

Ten przykład kodu jest częścią przykładu zestawu SDK monitora przepływu pracy z pliku DesignerGlyphProvider.cs. Aby uzyskać więcej informacji, zobacz Monitor przepływu pracy.

public override Rectangle GetBounds(ActivityDesigner designer, bool activated)
{
    Rectangle imageBounds = Rectangle.Empty;
    Image image = Resources.Executing;
    if (image != null)
    {
        Size glyphSize = WorkflowTheme.CurrentTheme.AmbientTheme.GlyphSize;
        imageBounds.Location = new Point(designer.Bounds.Right - glyphSize.Width / 2, designer.Bounds.Top - glyphSize.Height / 2);
        imageBounds.Size = glyphSize;
    }
    return imageBounds;
}
Public Overrides Function GetBounds(ByVal designer As System.Workflow.ComponentModel.Design.ActivityDesigner, ByVal activated As Boolean) As System.Drawing.Rectangle
    Dim imageBounds As Rectangle = Rectangle.Empty
    Dim image As Image = AppResources.Executing
    If Not image Is Nothing Then
        Dim glyphSize As Size = WorkflowTheme.CurrentTheme.AmbientTheme.GlyphSize
        imageBounds.Location = New Point(designer.Bounds.Right - glyphSize.Width / 2, designer.Bounds.Top - glyphSize.Height / 2)
        imageBounds.Size = glyphSize
    End If
    Return imageBounds
End Function

Uwagi

O ile nie zostanie zastąpiona w klasie pochodnej, zwraca granice projektanta działań, GetBounds z którym jest skojarzony glif.

Dotyczy

Zobacz też