Click here to Skip to main content
15,884,973 members
Articles / Desktop Programming / Win32

Host and Workflow: Two Worlds to Communicate. Part V

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
4 Oct 2008CPOL7 min read 36.8K   408   23  
Part V: Intercommunications with a Workflow instance using Correlation parameter
//------------------------------------------------------------------------------
// <auto-generated>
//     Dieser Code wurde von einem Tool generiert.
//     Laufzeitversion:2.0.50727.1434
//
//     Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
//     der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------

namespace CommunicationManager {
    using System;
    using System.ComponentModel;
    using System.Workflow.Activities;
    using System.Workflow.ComponentModel;
    using System.Workflow.ComponentModel.Design;
    using System.Workflow.ComponentModel.Compiler;
    
    
    [ToolboxItemAttribute(typeof(ActivityToolboxItem))]
    public partial class SendEmailToWorkflow : HandleExternalEventActivity {
        
        public static DependencyProperty SenderProperty = DependencyProperty.Register("Sender", typeof(object), typeof(SendEmailToWorkflow));
        
        public static DependencyProperty TypoProperty = DependencyProperty.Register("Typo", typeof(string), typeof(SendEmailToWorkflow));
        
        public static DependencyProperty EmailProperty = DependencyProperty.Register("Email", typeof(string), typeof(SendEmailToWorkflow));
        
        public SendEmailToWorkflow() {
            base.InterfaceType = typeof(CommunicationManager.IMailCommunication);
            base.EventName = "SendEmailToWorkflow";
        }
        
        [BrowsableAttribute(false)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
        public override System.Type InterfaceType {
            get {
                return base.InterfaceType;
            }
            set {
                throw new InvalidOperationException("Cannot set InterfaceType on a derived HandleExternalEventActivity.");
            }
        }
        
        [BrowsableAttribute(false)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
        public override string EventName {
            get {
                return base.EventName;
            }
            set {
                throw new InvalidOperationException("Cannot set EventName on a derived HandleExternalEventActivity.");
            }
        }
        
        [ValidationOptionAttribute(ValidationOption.Required)]
        public object Sender {
            get {
                return ((object)(this.GetValue(SendEmailToWorkflow.SenderProperty)));
            }
            set {
                this.SetValue(SendEmailToWorkflow.SenderProperty, value);
            }
        }
        
        [ValidationOptionAttribute(ValidationOption.Required)]
        public string Typo {
            get {
                return ((string)(this.GetValue(SendEmailToWorkflow.TypoProperty)));
            }
            set {
                this.SetValue(SendEmailToWorkflow.TypoProperty, value);
            }
        }
        
        [ValidationOptionAttribute(ValidationOption.Required)]
        public string Email {
            get {
                return ((string)(this.GetValue(SendEmailToWorkflow.EmailProperty)));
            }
            set {
                this.SetValue(SendEmailToWorkflow.EmailProperty, value);
            }
        }
        
        protected override void OnInvoked(System.EventArgs e) {
            CommunicationManager.MailEventArgs castedE = ((CommunicationManager.MailEventArgs)(e));
            this.Sender = this.ParameterBindings["sender"].Value;
            this.Typo = ((string)(castedE.Typo));
            this.Email = ((string)(castedE.Email));
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Avalon Development
United States United States
Jose A. Garcia Guirado, Electronic Engineer, graduated in Havana/Cuba 1982, MCTS, MCSD.NET, MCAD.NET, MCSE. Worked in the Institute for Cybernetics and Mathematics of Academy of Science of Cuba for 8 years; since 1995 working as free software architect, developer and adviser, first in Argentina and from 2003 to 2010, in Germany as External consultant in DWS Luxembourg, AIXTRON AG and Shell Deutschland GmbH and from 2010 to 2012 in Mexico working for Twenty Century Fox, and Mexico Stock Exchange (BMV). From 2013 to now in USA, Florida, First in FAME Inc. and now as Senior Software Engineer in Spirit Airlines.

Comments and Discussions