TrackingSection.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Activities / System / ServiceModel / Activities / Tracking / Configuration / TrackingSection.cs / 1305376 / TrackingSection.cs

                            //------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------

namespace System.ServiceModel.Activities.Tracking.Configuration 
{
    using System; 
    using System.Configuration; 
    using System.Activities.Tracking;
    using System.Diagnostics.CodeAnalysis; 
    using System.Runtime;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
 
    public class TrackingSection : ConfigurationSection
    { 
        Collection trackingProfiles; 

        ConfigurationPropertyCollection properties; 

        public TrackingSection()
        {
        } 

        protected override ConfigurationPropertyCollection Properties 
        { 
            get
            { 
                if (this.properties == null)
                {
                    ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
                    properties.Add(new ConfigurationProperty(TrackingConfigurationStrings.Profiles, typeof(System.ServiceModel.Activities.Tracking.Configuration.ProfileElementCollection), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); 
                    this.properties = properties;
                } 
                return this.properties; 
            }
        } 

        [ConfigurationProperty(TrackingConfigurationStrings.Profiles)]
        public ProfileElementCollection Profiles
        { 
            get
            { 
                return (ProfileElementCollection)base[TrackingConfigurationStrings.Profiles]; 
            }
        } 

        [SuppressMessage(FxCop.Category.Configuration, FxCop.Rule.ConfigurationPropertyAttributeRule,
            Justification = "This property returns a list of profiles in format suitable for the runtime")]
        public Collection TrackingProfiles 
        {
            get 
            { 
                if (this.trackingProfiles == null)
                { 
                    this.trackingProfiles = new Collection();

                    foreach (ProfileElement profileElement in this.Profiles)
                    { 
                        if (profileElement.Workflows != null)
                        { 
                            foreach (ProfileWorkflowElement workflowElement in profileElement.Workflows) 
                            {
                                TrackingProfile profile = new TrackingProfile() 
                                {
                                    Name = profileElement.Name,
                                    ImplementationVisibility = profileElement.ImplementationVisibility,
                                    ActivityDefinitionId = workflowElement.ActivityDefinitionId 
                                };
 
                                workflowElement.AddQueries(profile.Queries); 

                                this.trackingProfiles.Add(profile); 
                            }
                        }
                    }
                } 

                return this.trackingProfiles; 
            } 
        }
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK