internal static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(Catch<>); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(CatchDesigner))); builder.AddCustomAttributes(type, type.GetProperty("Action"), BrowsableAttribute.No); builder.AddCustomAttributes(type, new ActivityDesignerOptionsAttribute { AllowDrillIn = false }); }
public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(DoWhile); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(DoWhileDesigner))); builder.AddCustomAttributes(type, type.GetProperty("Body"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Variables"), BrowsableAttribute.No); }
public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(ModelItemKeyValuePair<,>); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(CaseDesigner))); builder.AddCustomAttributes(type, type.GetProperty("Value"), BrowsableAttribute.No); builder.AddCustomAttributes(type, new ActivityDesignerOptionsAttribute { AllowDrillIn = false }); }
// since designer and activity are in same assembly register in static constructor static SimpleCodeActivity() { AttributeTableBuilder builder = new AttributeTableBuilder(); builder.AddCustomAttributes(typeof(SimpleCodeActivity), "RepeatCount", new EditorAttribute(typeof(CustomInlineEditor), typeof(PropertyValueEditor))); builder.AddCustomAttributes(typeof(SimpleCodeActivity), "FileName", new EditorAttribute(typeof(FilePickerEditor), typeof(DialogPropertyValueEditor))); MetadataStore.AddAttributeTable(builder.CreateTable()); }
/// <summary> /// The register metadata. /// </summary> /// <param name="builder"> /// The builder. /// </param> public static void RegisterMetadata(AttributeTableBuilder builder) { builder.AddCustomAttributes(typeof(DelayUntilTime), new DesignerAttribute(typeof(DelayUntilTimeDesigner))); builder.AddCustomAttributes(typeof(DelayUntilTime), OccurenceDays, new BrowsableAttribute(false)); builder.AddCustomAttributes(typeof(DelayUntilTime), new DescriptionAttribute(Properties.Resources.An_activity_that_will_delay_until_a_specific_time_on_certain_days)); builder.AddCustomAttributes(typeof(DelayUntilTime), new ToolboxBitmapAttribute("DelayCheck.bmp")); }
/// <summary> /// The register metadata. /// </summary> /// <param name="builder"> /// The builder. /// </param> public static void RegisterMetadata(AttributeTableBuilder builder) { builder.AddCustomAttributes( typeof(HttpWorkflowService), new DesignerAttribute(typeof(HttpWorkflowServiceDesigner))); builder.AddCustomAttributes( typeof(HttpWorkflowService), new DescriptionAttribute("A Workflow Service that uses HTTP Messaging")); }
public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(Sequence); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(SequenceDesigner))); builder.AddCustomAttributes(type, type.GetProperty("Activities"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Variables"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Activities"), new ShowPropertyInOutlineViewAttribute() { CurrentPropertyVisible = false }); }
/// <summary> /// The register metadata. /// </summary> /// <param name = "builder"> /// The builder. /// </param> public static void RegisterMetadata(AttributeTableBuilder builder) { builder.AddCustomAttributes(typeof(InvokeWorkflow), new DesignerAttribute(typeof(InvokeWorkflowDesigner))); builder.AddCustomAttributes( typeof(InvokeWorkflow), new DescriptionAttribute(Properties.Resources.Invokes_an_Activity_using_WorkflowInvoker)); builder.AddCustomAttributes(typeof(InvokeWorkflow), new ToolboxBitmapAttribute("InvokeWorkflow.bmp")); }
public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(System.Activities.Statements.Pick); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(PickDesigner))); builder.AddCustomAttributes(type, type.GetProperty("Branches"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Branches"), new ShowPropertyInOutlineViewAttribute() { CurrentPropertyVisible = false }); builder.AddCustomAttributes(type, new FeatureAttribute(typeof(PickValidationErrorSourceLocatorFeature))); }
public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(TransactedReceiveScope); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(TransactedReceiveScopeDesigner))); builder.AddCustomAttributes(type, type.GetProperty("Body"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Request"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Variables"), BrowsableAttribute.No); }
public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(If); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(IfElseDesigner))); builder.AddCustomAttributes(type, type.GetProperty("Then"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Else"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Condition"), new HidePropertyInOutlineViewAttribute()); }
public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(PickBranch); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(PickBranchDesigner))); builder.AddCustomAttributes(type, type.GetProperty("Action"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Trigger"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Variables"), BrowsableAttribute.No); builder.AddCustomAttributes(type, new ShowInOutlineViewAttribute()); }
/// <summary> /// The register metadata. /// </summary> /// <param name="builder"> /// The builder. /// </param> public static void RegisterMetadata(AttributeTableBuilder builder) { builder.AddCustomAttributes( typeof(LoadAndInvokeWorkflow), new DesignerAttribute(typeof(LoadAndInvokeWorkflowDesigner))); builder.AddCustomAttributes( typeof(LoadAndInvokeWorkflow), new DescriptionAttribute(Properties.Resources.Loads_and_invokes_a_workflow)); builder.AddCustomAttributes(typeof(LoadAndInvokeWorkflow), new ToolboxBitmapAttribute("InvokeWorkflow.bmp")); }
public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(SendMail); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(SendMailDesigner))); builder.AddCustomAttributes(type, type.GetProperty("To"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("From"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Subject"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Host"), BrowsableAttribute.No); }
public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(Parallel); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(ParallelDesigner))); builder.AddCustomAttributes(type, type.GetProperty("Branches"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Variables"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Branches"), new ShowPropertyInOutlineViewAttribute() { CurrentPropertyVisible = false }); builder.AddCustomAttributes(type, type.GetProperty("CompletionCondition"), new HidePropertyInOutlineViewAttribute()); }
internal static void RegisterMetadata(AttributeTableBuilder builder) { builder.AddCustomAttributes(typeof(Statements.FolderWatcher), new DesignerAttribute(typeof(FolderWatcherDesigner)), new DescriptionAttribute(Properties.Resources.FolderWatcherDesigner_Description)); //new ToolboxBitmapAttribute(typeof(FolderWatcherDesigner), "FolderWatcher.png") builder.AddCustomAttributes(typeof(Statements.SubscribeFileChanges), new DesignerAttribute(typeof(FolderWatcherDesigner)), new DescriptionAttribute(Properties.Resources.SubscribeFileChangesDesigner_Description)); }
public void Register() { var builder = new AttributeTableBuilder(); builder.AddCustomAttributes(typeof (DiagnosticTrace), new DesignerAttribute(typeof (DiagnosticTraceDesigner))); builder.AddCustomAttributes(typeof (TestBookmark<string>), new DesignerAttribute(typeof (TestBookmarkDesigner))); MetadataStore.AddAttributeTable(builder.CreateTable()); }
private static void RegisterMetadata() { Type type = typeof(AzureAsyncOperation); AttributeTableBuilder builder = new AttributeTableBuilder(); builder.AddCustomAttributes(type, new Attribute[] { new DesignerAttribute(typeof(AzureOperationDesigner)) }); builder.AddCustomAttributes(type, new ActivityDesignerOptionsAttribute { AllowDrillIn = false }); builder.AddCustomAttributes(type, type.GetProperty("Operation"), new Attribute[] { BrowsableAttribute.No }); builder.AddCustomAttributes(type, type.GetProperty("Success"), new Attribute[] { BrowsableAttribute.No }); builder.AddCustomAttributes(type, type.GetProperty("Failure"), new Attribute[] { BrowsableAttribute.No }); MetadataStore.AddAttributeTable(builder.CreateTable()); }
static InitializeCorrelationDesigner() { Type type = typeof(InitializeCorrelation); AttributeTableBuilder builder = new AttributeTableBuilder(); builder.AddCustomAttributes(type, type.GetProperty("Correlation"), new DescriptionAttribute(StringResourceDictionary.Instance.GetString("messagingCorrelatesWithHint"))); builder.AddCustomAttributes(type, type.GetProperty("CorrelationData"), PropertyValueEditor.CreateEditorAttribute(typeof(CorrelationDataValueEditor)), new DescriptionAttribute(StringResourceDictionary.Instance.GetString("messagingCorrelationDataHint"))); builder.AddCustomAttributes(type, "CorrelationData", BrowsableAttribute.Yes); MetadataStore.AddAttributeTable(builder.CreateTable()); }
public MainWindow() { InitializeComponent(); new BluEnergyXDesignerStart().ShowDialog(); errorService = new ValidationErrorService(this.messageListBox); originalTitle = this.Title; //register designers for the standard activities DesignerMetadata dm = new DesignerMetadata(); dm.Register(); //toolbox toolboxControl = CreateToolbox(); toolboxArea.Child = toolboxControl; CreateContextMenu(); InitializeDesigner(); StartNewWorkflow(); //override designer for the standard While activity AttributeTableBuilder atb = new AttributeTableBuilder(); atb.AddCustomAttributes(typeof(While), new DesignerAttribute(typeof(ActivityLibrary.Design.MyWhileDesigner))); MetadataStore.AddAttributeTable(atb.CreateTable()); }
internal static void RegisterMetadata(AttributeTableBuilder builder) { builder.AddCustomAttributes(typeof(Statements.FileCopy), new DesignerAttribute(typeof(FileCopyDesigner)), new DescriptionAttribute(Properties.Resources.FileCopyDesigner_Description)); //new ToolboxBitmapAttribute(typeof(FileCopyDesigner), "FileCopy.png") }
static void Main(string[] args) { // First, we will print out all attributes that are on string by default AttributeCollection attributeCollection = TypeDescriptor.GetAttributes(typeof(string)); Console.WriteLine("--------- default attributes"); OutputAttributes(attributeCollection); // Use the AttributeTableBuilder to add a new Attribute to string AttributeTableBuilder builder = new AttributeTableBuilder(); builder.AddCustomAttributes(typeof(string), new DesignerCategoryAttribute("Custom category")); MetadataStore.AddAttributeTable(builder.CreateTable()); Console.WriteLine("--------- including custom attributes"); attributeCollection = TypeDescriptor.GetAttributes(typeof(string)); OutputAttributes(attributeCollection); Console.WriteLine("--------- registering callback"); // Use the AttributeCallback to delay registering metadata until it is requested. builder = new AttributeTableBuilder(); builder.AddCallback(typeof(string), new AttributeCallback(acb => { Console.WriteLine("*** In AttributeCallback, adding a new attribute"); acb.AddCustomAttributes(new DesignTimeVisibleAttribute(false)); } ) ); MetadataStore.AddAttributeTable(builder.CreateTable()); Console.WriteLine("--------- including custom attributes added via callback"); attributeCollection = TypeDescriptor.GetAttributes(typeof(string)); OutputAttributes(attributeCollection); Console.WriteLine("Press Enter to Exit"); Console.ReadLine(); }
/// <summary> /// The register metadata. /// </summary> /// <param name="builder"> /// The builder. /// </param> public static void RegisterMetadata(AttributeTableBuilder builder) { builder.AddCustomAttributes( typeof(DelayUntilDateTime), new DesignerAttribute(typeof(DelayUntilDateTimeDesigner)), new DescriptionAttribute(Properties.Resources.DelayUntilDateTimeDesigner_RegisterMetadata_Delay_until_a_specific_date_time), new ToolboxBitmapAttribute("DelayCheck.bmp")); }
/// <summary> /// The register metadata. /// </summary> /// <param name="builder"> /// The builder. /// </param> public static void RegisterMetadata(AttributeTableBuilder builder) { builder.AddCustomAttributes( typeof(ClearDictionary<,>), new DesignerAttribute(typeof(ClearDictionaryDesigner)), new ToolboxBitmapAttribute("ClearDict.bmp"), new DescriptionAttribute( Properties.Resources.ClearDictionaryDesigner_RegisterMetadata_Clears_the_Dictionary)); }
/// <summary> /// The register metadata. /// </summary> /// <param name="builder"> /// The builder. /// </param> public static void RegisterMetadata(AttributeTableBuilder builder) { builder.AddCustomAttributes( typeof(LoadAssembly), new DesignerAttribute(typeof(LoadAssemblyDesigner)), new ToolboxBitmapAttribute("dbGreenCheck16.png"), new DescriptionAttribute( Properties.Resources.LoadActivityDesigner_RegisterMetadata_Loads_an_activity_from_XAML)); }
public override void Initialize(EditingContext context, Type modelType) { if (context.Services.GetService<DesignerConfigurationService>().TargetFrameworkName.IsLessThan45()) { AttributeTableBuilder builder = new AttributeTableBuilder(); builder.AddCustomAttributes(typeof(FlowSwitchDefaultLink<>), "DefaultCaseDisplayName", BrowsableAttribute.No); MetadataStore.AddAttributeTable(builder.CreateTable()); } }
/// <summary> /// Registers metadata for the StateMachine related designers. /// </summary> public void Register() { AttributeTableBuilder builder = new AttributeTableBuilder(); builder.AddCustomAttributes(typeof(WizardContainer), new DesignerAttribute(typeof(WizardContainerDesigner))); builder.AddCustomAttributes(typeof(Wizard), new DesignerAttribute(typeof(WizardDesigner))); builder.AddCustomAttributes(typeof(Step), new DesignerAttribute(typeof(StepDesigner))); MetadataStore.AddAttributeTable(builder.CreateTable()); }
internal static void RegisterMetadata(AttributeTableBuilder builder) { var serviceType = typeof(WorkflowService); var advancedAttribute = new EditorBrowsableAttribute(EditorBrowsableState.Advanced); var categoryAttribute = new CategoryAttribute(EditorCategoryTemplateDictionary.Instance.GetCategoryTitle(MiscellaneousCategoryLabelKey)); builder.AddCustomAttributes(serviceType, new DesignerAttribute(typeof(ServiceDesigner))); builder.AddCustomAttributes(serviceType, "Name", new TypeConverterAttribute(typeof(XNameConverter))); builder.AddCustomAttributes(serviceType, serviceType.GetProperty("Endpoints"), BrowsableAttribute.No); builder.AddCustomAttributes( serviceType, "ImplementedContracts", advancedAttribute, categoryAttribute, PropertyValueEditor.CreateEditorAttribute(typeof(TypeCollectionPropertyEditor)), new EditorOptionAttribute { Name = TypeCollectionPropertyEditor.AllowDuplicate, Value = false }, new EditorOptionAttribute { Name = TypeCollectionPropertyEditor.Filter, Value = ServiceContractImporter.FilterFunction }, new EditorOptionAttribute { Name = TypeCollectionPropertyEditor.DefaultType, Value = null }); builder.AddCustomAttributes(serviceType, serviceType.GetProperty("Body"), BrowsableAttribute.No); }
// Ideally we need to filter out ALL new properties introduced in 4.5, for performance // reasons, we do not take this approach. Instead, we build a cache for the new properties // we want to filter out. Currently the cache is not a full cache, it only contains new properties // that affect activities. // Ideally, the cache would only contain TypeName and we load type using TypeName. // The current implementation of the cache directly references the type defined in S.A.dll and // S.SM.A.dll, this is also to save performance cost of resolving the type by type name. public static void FilterOut45Properties() { AttributeTableBuilder builder = new AttributeTableBuilder(); // System.Activities.dll builder.AddCustomAttributes(typeof(ActivityBuilder), "ImplementationVersion", BrowsableAttribute.No); builder.AddCustomAttributes(typeof(ActivityBuilder<>), "ImplementationVersion", BrowsableAttribute.No); builder.AddCustomAttributes(typeof(DynamicActivity), "ImplementationVersion", BrowsableAttribute.No); builder.AddCustomAttributes(typeof(DynamicActivity<>), "ImplementationVersion", BrowsableAttribute.No); builder.AddCustomAttributes(typeof(Flowchart), "ValidateUnconnectedNodes", BrowsableAttribute.No); builder.AddCustomAttributes(typeof(FlowDecision), "DisplayName", BrowsableAttribute.No); builder.AddCustomAttributes(typeof(FlowSwitch<>), "DisplayName", BrowsableAttribute.No); // System.ServiceModel.Activities.dll builder.AddCustomAttributes(typeof(WorkflowService), "DefinitionIdentity", BrowsableAttribute.No); builder.AddCustomAttributes(typeof(WorkflowService), "ImplementedContracts", BrowsableAttribute.No); builder.AddCustomAttributes(typeof(Send), "SecurityTokenHandle", BrowsableAttribute.No); MetadataStore.AddAttributeTable(builder.CreateTable()); }
public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(InvokeMethod); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(InvokeMethodDesigner))); builder.AddCustomAttributes( type, "GenericTypeArguments", PropertyValueEditor.CreateEditorAttribute(typeof(TypeCollectionPropertyEditor)), new EditorOptionAttribute { Name = TypeCollectionPropertyEditor.AllowDuplicate, Value = true }); builder.AddCustomAttributes( type, "Parameters", PropertyValueEditor.CreateEditorAttribute(typeof(ArgumentCollectionPropertyEditor))); builder.AddCustomAttributes( type, "TargetType", new EditorOptionAttribute { Name = TypePropertyEditor.AllowNull, Value = true }, new EditorOptionAttribute { Name = TypePropertyEditor.BrowseTypeDirectly, Value = false }); builder.AddCustomAttributes(type, new ActivityDesignerOptionsAttribute { AllowDrillIn = false }); Func<Activity, IEnumerable<ArgumentAccessor>> argumentAccessorGenerator = (activity) => new ArgumentAccessor[] { new ArgumentAccessor { Getter = (ownerActivity) => ((InvokeMethod)ownerActivity).TargetObject, Setter = (ownerActivity, arg) => { ((InvokeMethod)ownerActivity).TargetObject = arg as InArgument; }, }, new ArgumentAccessor { Getter = (ownerActivity) => ((InvokeMethod)ownerActivity).Result, Setter = (ownerActivity, arg) => { ((InvokeMethod)ownerActivity).Result = arg as OutArgument; }, }, }; ActivityArgumentHelper.RegisterAccessorsGenerator(type, argumentAccessorGenerator); }