Aracılığıyla paylaş


DesignerGlyph.GetBounds(ActivityDesigner, Boolean) Yöntem

Tanım

Belirtilen ActivityDesignerüzerindeki karakterin sınırlarını döndürür.

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

Parametreler

designer
ActivityDesigner

ActivityDesigner Karakterin ilişkilendirildiği.

activated
Boolean

true etkinlik tasarımcısı yüzeyinde karakterin görünüp görünmediğini belirtmek için; aksi takdirde , false.

Döndürülenler

Rectangle Karakterin sınırlarını temsil eden bir.

Özel durumlar

designer null başvuru içerir (Nothing Visual Basic'te).

Örnekler

Aşağıdaki kod örneği, yöntemini nasıl geçersiz kılabileceğinizi GetBounds gösterir. Kod, özel glif nesnesinin boyutunu ve konumunu ayarlar.

Bu kod örneği, DesignerGlyphProvider.cs dosyasından İş Akışı İzleyicisi SDK Örneği'nin bir parçasıdır. Daha fazla bilgi için bkz . İş Akışı İzleyicisi.

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

Açıklamalar

Türetilmiş bir sınıfta geçersiz kılınmadığı sürece, GetBounds karakterin ilişkilendirildiği etkinlik tasarımcısının sınırlarını döndürür.

Şunlara uygulanır

Ayrıca bkz.