Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ComponentBase"/> class.
        /// </summary>
        /// <param name="name">The name attached to this component</param>
        protected ComponentBase(string name)
        {
            Name = name ?? GetType().Name;
            Id   = Interlocked.Increment(ref globalCounterId);

            // Track this component
            if (ComponentTracker.Enable)
            {
                ComponentTracker.Track(this);
            }
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ComponentBase"/> class.
        /// </summary>
        /// <param name="name">The name attached to this component</param>
        protected ComponentBase(string name)
        {
            Name = name ?? GetType().Name;
            Id   = Guid.NewGuid();

            // Track this component
            if (ComponentTracker.Enable)
            {
                ComponentTracker.Track(this);
            }
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ComponentBase"/> class.
        /// </summary>
        /// <param name="name">The name attached to this component</param>
        protected ComponentBase(string name)
        {
            Name      = name ?? GetType().Name;
            Id        = Interlocked.Increment(ref globalCounterId);
            collector = new ObjectCollector();

            // Track this component
            if (ComponentTracker.Enable)
            {
                ComponentTracker.Track(this);
            }
            Tags = new PropertyContainer(this);
        }