DesignerGlyph Classe
Definição
Cuidado
The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*
Desenha um glifo na posição de ordem Z mais elevada em um designer de atividade.Draws a glyph at the top-most Z order position on an activity designer.
public ref class DesignerGlyph abstract
public abstract class DesignerGlyph
[System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
public abstract class DesignerGlyph
type DesignerGlyph = class
[<System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")>]
type DesignerGlyph = class
Public MustInherit Class DesignerGlyph
- Herança
-
DesignerGlyph
- Derivado
- Atributos
Exemplos
O exemplo de código a seguir demonstra uma classe de glifo que deriva da DesignerGlyph classe.The following code example demonstrates a glyph class that derives from the DesignerGlyph class. O código substitui os GetBounds OnPaint métodos e.The code overrides the GetBounds and OnPaint methods.
Este exemplo de código faz parte do exemplo de SDK do monitor de fluxo de trabalho do arquivo DesignerGlyphProvider.cs.This code example is part of the Workflow Monitor SDK Sample from the DesignerGlyphProvider.cs file. Para obter mais informações, consulte Monitor de fluxo de trabalho.For more information, see Workflow Monitor.
//Define a glyph to show an activity is executing, i.e. not 'closed'
internal sealed class ExecutingGlyph : DesignerGlyph
{
internal ExecutingGlyph()
{
}
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;
}
protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer)
{
Bitmap bitmap = Resources.Executing;
bitmap.MakeTransparent(Color.FromArgb(0, 255, 255));
if (bitmap != null)
graphics.DrawImage(bitmap, GetBounds(designer, activated), new Rectangle(Point.Empty, bitmap.Size), GraphicsUnit.Pixel);
}
}
'Define a glyph to show an activity is executing, i.e. not 'closed'
Friend Class ExecutingGlyph
Inherits DesignerGlyph
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
Protected Overrides Sub OnPaint(ByVal graphics As System.Drawing.Graphics, ByVal activated As Boolean, ByVal ambientTheme As System.Workflow.ComponentModel.Design.AmbientTheme, ByVal designer As System.Workflow.ComponentModel.Design.ActivityDesigner)
Dim bitmap As Bitmap = AppResources.Executing
bitmap.MakeTransparent(Color.FromArgb(0, 255, 255))
If Not bitmap Is Nothing Then
graphics.DrawImage(bitmap, GetBounds(designer, activated), New Rectangle(Point.Empty, bitmap.Size), GraphicsUnit.Pixel)
End If
End Sub
End Class
Comentários
Observação
Este material discute tipos e namespaces obsoletos.This material discusses types and namespaces that are obsolete. Para obter mais informações, consulte Deprecated Types in Windows Workflow Foundation 4.5 (Tipos preteridos no Windows Workflow Foundation 4.5).For more information, see Deprecated Types in Windows Workflow Foundation 4.5.
A DesignerGlyph classe é a classe base para todos os glifos de designer usados em uma superfície de design de fluxo de trabalho.The DesignerGlyph class is the base class for all designer glyphs used on a workflow design surface.
Os desenvolvedores do designer de atividades podem usar classes que herdam do DesignerGlyph para desenhar glifos personalizados na superfície de um ActivityDesigner .Activity designer developers can use classes that inherit from DesignerGlyph to draw custom glyphs onto the surface of an ActivityDesigner. DesignerGlyph as classes desenham esses glifos na ordem Z de nível superior, que coloca o glifo personalizado visualmente sobre todos os outros glifos no designer com base no Priority valor do glifo personalizado.DesignerGlyph classes draw such glyphs at the top-level Z order, which places the custom glyph visually on top of all other glyphs on the designer based on the Priority value of the custom glyph. Um valor mais baixo para a Priority propriedade indica uma prioridade mais alta e, portanto, desenha o glifo na posição da ordem Z superior em um designer de atividade.A lower value for the Priority property indicates a higher priority and therefore draws the glyph at the top-most Z order position on an activity designer.
Notas aos Implementadores
Ao herdar do DesignerGlyph , você deve substituir os seguintes membros: OnPaint(Graphics, Boolean, AmbientTheme, ActivityDesigner) .When you inherit from DesignerGlyph, you must override the following members: OnPaint(Graphics, Boolean, AmbientTheme, ActivityDesigner).
Construtores
| DesignerGlyph() |
Quando implementado em uma classe derivada, inicializa uma nova instância da classe DesignerGlyph.When implemented in a derived class, initializes a new instance of the DesignerGlyph class. |
Campos
| HighestPriority |
Representa a prioridade mais alta possível para um DesignerGlyph.Represents the highest priority possible for a DesignerGlyph. Esse valor é uma constante.This value is a constant. |
| LowestPriority |
Representa a prioridade mais baixa possível para um DesignerGlyph.Represents the lowest priority possible for a DesignerGlyph. Esse valor é uma constante.This value is a constant. |
| NormalPriority |
Representa a prioridade normal para um DesignerGlyph.Represents the normal priority for a DesignerGlyph. Esse valor é uma constante.This value is a constant. |
Propriedades
| CanBeActivated |
Obtém um valor que indica se o DesignerGlyph pode adquirir foco no ActivityDesigner ao qual ele está associado.Gets a value indicating whether the DesignerGlyph can gain focus on the ActivityDesigner with which it is associated. |
| Priority |
Obtém a configuração de prioridade do glifo do designer na superfície do designer de atividade.Gets the priority setting for the designer glyph on the activity design surface. |
Métodos
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object. (Herdado de Object) |
| GetBounds(ActivityDesigner, Boolean) |
Retorna os limites para o glifo no ActivityDesigner especificado.Returns the bounds for the glyph on the specified ActivityDesigner. |
| GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| OnActivate(ActivityDesigner) |
Indica ao glifo de que uma ação foi executada que ativou o glifo.Indicates to the glyph that an action has been performed which has activated the glyph. |
| OnPaint(Graphics, Boolean, AmbientTheme, ActivityDesigner) |
Quando substituído em uma classe derivada, executa tarefas necessárias para renderizar o glifo na superfície do designer de atividade.When overridden in a derived class, performs any tasks required to render the glyph on the activity designer surface. |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |