Beispiel #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="priority"></param>
        /// <param name="profile"></param>
        public DemoCustomExtensionService(string name, uint priority, DemoCustomExtensionServiceProfile profile)
            : base(name, priority, profile)
        {
            if (profile == null)
            {
                throw new Exception($"{GetType().Name} expects a {nameof(DemoCustomExtensionServiceProfile)}");
            }

            // In the constructor, you should set any configuration data from your profile here.
            MyCustomData = profile.MyCustomStringData;
        }
Beispiel #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="priority"></param>
        /// <param name="profile"></param>
        public DemoCustomExtensionService(string name, uint priority, DemoCustomExtensionServiceProfile profile)
            : base(name, priority, profile)
        {
            // If your service requires the use of a configuration profile, be sure to check it here.
            if (profile.IsNull())
            {
                throw new Exception($"{GetType().Name} expects a {nameof(DemoCustomExtensionServiceProfile)}");
            }

            // In the constructor, you should set any configuration data from your profile here.
            myCustomData = profile.MyCustomStringData;
        }