CategoryAttribute in Microsoft Word

Maker Data Matrix in Microsoft Word CategoryAttribute

CategoryAttribute
Data Matrix ECC200 Drawer In None
Using Barcode creator for Word Control to generate, create ECC200 image in Office Word applications.
www.OnBarcode.com
Paint PDF-417 2d Barcode In None
Using Barcode encoder for Office Word Control to generate, create PDF-417 2d barcode image in Office Word applications.
www.OnBarcode.com
That takes care of an example of using a dependency property, but as I said, you don t always need a dependency property. Sometimes a regular old simple property will do the trick quite nicely. Listings 5-7 through 5-10 show the standard properties that we need for our solution. Listing 5-7. Nothing Special Here Just a Regular Old Property private string _finalDocumentName; [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility. Visible)] [BrowsableAttribute(false)] [DescriptionAttribute("Name of macro-free document in Document Library")] [CategoryAttribute("Configuration")] public string FinalDocumentName { get { return _finalDocumentName; } set { _finalDocumentName = value; } } You ll notice in Listing 5-7 that this property is not going to show up in the Properties window because its BrowsableAttribute is set to false. This property is going to be accessed in our Workflow code in 6 to retrieve the name of the macro-free document. Next up (Listing 5-8) is another property that is only used in code. This time it is the opposite of the previous property it stores the original name of the document before we started tearing it apart and looking to put it back together again. Listing 5-8. A Property to Store the Original Name of Our Payload s Document private string _originalDocumentName; [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)] [BrowsableAttribute(false)] [DescriptionAttribute("Original name of document in Document Library")] [CategoryAttribute("Configuration")]
Create QR Code ISO/IEC18004 In None
Using Barcode generator for Office Word Control to generate, create QR Code JIS X 0510 image in Microsoft Word applications.
www.OnBarcode.com
Encode Barcode In None
Using Barcode generation for Word Control to generate, create Barcode image in Microsoft Word applications.
www.OnBarcode.com
CHAPTER 5 ACTIVITIES
Encoding UPC - 13 In None
Using Barcode generator for Microsoft Word Control to generate, create EAN 13 image in Office Word applications.
www.OnBarcode.com
UCC-128 Generation In None
Using Barcode generation for Word Control to generate, create EAN128 image in Office Word applications.
www.OnBarcode.com
public string OriginalDocumentName { get { return _originalDocumentName; } set { _originalDocumentName = value; } } One more property is shown in Listing 5-9. This time around, we re storing a reference to the SPList that our workflow is running within. As before, this is going to be used later in 6. Listing 5-9. Setting Up Our ParentList Property private SPList _parentList; [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)] [BrowsableAttribute(false)] [DescriptionAttribute("SPList item containing document")] [CategoryAttribute("Configuration")] public SPList ParentList { get { return _parentList; } set { _parentList = value; } } Last but not least, we need to set up a property we can check from the workflow to see whether or not we successfully removed the macros from the file. Listing 5-10 shows this code. Listing 5-10. The IsMacroFree Property private bool _isMacroFree = false; [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)] [BrowsableAttribute(false)] [DescriptionAttribute("Indicates whether resulting document is free of macros")] [CategoryAttribute("Configuration")] public bool IsMacroFree { get { return _isMacroFree; } set { _isMacroFree = value; } }
Barcode Creator In None
Using Barcode encoder for Office Word Control to generate, create Barcode image in Office Word applications.
www.OnBarcode.com
Identcode Drawer In None
Using Barcode generation for Word Control to generate, create Identcode image in Word applications.
www.OnBarcode.com
Wrapping It All Up
Creating Data Matrix In None
Using Barcode generation for Software Control to generate, create Data Matrix ECC200 image in Software applications.
www.OnBarcode.com
Data Matrix 2d Barcode Encoder In .NET Framework
Using Barcode creator for VS .NET Control to generate, create ECC200 image in Visual Studio .NET applications.
www.OnBarcode.com
Technically, our activity is complete. We don t have to do anything more to it. If we stop here, though, there are a few problems: Our activity is ugly (and its mother dresses it funny). Right now if a developer were to add our activity to a workflow, it would look like Figure 5-1. While OK, it is a little dull. We need to add some flash and pizzazz. In a similar vein, the icon representing our activity in the Visual Studio Toolbox is the generic gear not very appealing.
PDF 417 Recognizer In VB.NET
Using Barcode reader for Visual Studio .NET Control to read, scan read, scan image in VS .NET applications.
www.OnBarcode.com
Drawing PDF417 In .NET
Using Barcode printer for Reporting Service Control to generate, create PDF417 image in Reporting Service applications.
www.OnBarcode.com
CHAPTER 5 ACTIVITIES
Code 39 Extended Generation In None
Using Barcode creation for Online Control to generate, create Code39 image in Online applications.
www.OnBarcode.com
Draw Matrix In .NET Framework
Using Barcode generator for ASP.NET Control to generate, create Matrix Barcode image in ASP.NET applications.
www.OnBarcode.com
There is nothing in our activity that verifies that the user has supplied a valid value for the PayloadItem property.
USS-128 Generation In None
Using Barcode creation for Online Control to generate, create EAN128 image in Online applications.
www.OnBarcode.com
Data Matrix Creation In VB.NET
Using Barcode generation for .NET Control to generate, create Data Matrix ECC200 image in VS .NET applications.
www.OnBarcode.com
Figure 5-1. The default look of an activity is dull, dull, boring. So, we have a little work still ahead of us after all. Let s start with the Activity Designer.
PDF 417 Recognizer In .NET
Using Barcode recognizer for .NET Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
Decoding EAN-13 In Visual C#.NET
Using Barcode decoder for .NET Control to read, scan read, scan image in VS .NET applications.
www.OnBarcode.com
Activity Designer Class
Generating UCC - 12 In None
Using Barcode creator for Software Control to generate, create GS1 128 image in Software applications.
www.OnBarcode.com
Encoding Denso QR Bar Code In VS .NET
Using Barcode creation for Reporting Service Control to generate, create Denso QR Bar Code image in Reporting Service applications.
www.OnBarcode.com
The Activity Designer class is responsible for controlling the behavior and appearance of our activity in the Visual Studio environment. There are a few somewhat esoteric things that the Activity Designer can do, but the main things it is responsible for are Rendering our activity when it is dropped onto the Workflow Designer canvas Controlling the actions available on the context menu for our activity (in activity-lingo, these are known as verbs, and we ll cover how to add new ones in 9) For now, all we re going to do is add a little eye candy to our activity we ll make it look a bit nicer than the default. Before we get to the code to make this happen, let s take a look at what we re aiming for. Figure 5-2 shows the end result of our Activity Designer class a little more appealing than the default presentation, no
Figure 5-2. The end result of our Activity Designer class is a more visually appealing activity. So, how do we get to Figure 5-2 from Figure 5-1 It actually involves two classes and a few overridden methods, but all in all it s pretty easy. To begin with, we need to declare our Activity Designer class. Listing 5-11 shows this piece. Looking at this code, you ll see that this class is also decorated with an attribute ActivityDesignerTheme. We ll get to that in just a few minutes. Listing 5-11. Declaring an Activity Designer Class for Our Activity [ActivityDesignerTheme(typeof(MacroStripperDesignerTheme))] public class MacroStripperDesigner : ActivityDesigner { The visual appearance of our activity is controlled by three rectangles: The rectangle bounding the entire activity The rectangle controlling the size and placement of the text space The rectangle controlling the size and placement of the image space
Copyright © OnBarcode.com . All rights reserved.