Example #1
0
 public override void AfterConstruction()
 {
     base.AfterConstruction();
     StartOn = DateTime.Now;
     EndOn   = StartOn.AddHours(1);
     Employees.Add(Session.GetObjectByKey <Employee>(SecuritySystem.CurrentUserId));
 }
Example #2
0
        public override int GetHashCode()
        {
            int hashCode = 1012203405;

            hashCode = hashCode * -1521134295 + StartOn.GetHashCode();
            hashCode = hashCode * -1521134295 + EndOn.GetHashCode();
            return(hashCode);
        }
Example #3
0
        /// <summary>
        /// Adds itself as an XML content into the WiX source being generated from the <see cref="WixSharp.Project"/>.
        /// See 'Wix#/samples/Extensions' sample for the details on how to implement this interface correctly.
        /// </summary>
        /// <param name="context">The context.</param>
        public void Process(ProcessingContext context)
        {
            Config = new ServiceConfig
            {
                DelayedAutoStart        = DelayedAutoStart,
                PreShutdownDelay        = PreShutdownDelay,
                ServiceSid              = ServiceSid,
                ConfigureServiceTrigger = ConfigureServiceTrigger,
            };

            ConfigUtil = new ServiceConfigUtil
            {
                FirstFailureActionType       = FirstFailureActionType,
                SecondFailureActionType      = SecondFailureActionType,
                ThirdFailureActionType       = ThirdFailureActionType,
                ProgramCommandLine           = ProgramCommandLine,
                RebootMessage                = RebootMessage,
                ResetPeriodInDays            = ResetPeriodInDays,
                RestartServiceDelayInSeconds = RestartServiceDelayInSeconds,
            };

            XElement ServiceInstaller = this.ToXElement("ServiceInstall");

            context.XParent.Add(ServiceInstaller);

            var newContext = new ProcessingContext
            {
                Project           = context.Project,
                Parent            = context.Project,
                XParent           = ServiceInstaller,
                FeatureComponents = context.FeatureComponents,
            };

            if (DependsOn != null)
            {
                foreach (ServiceDependency dependency in DependsOn)
                {
                    dependency.Process(newContext);
                }
            }

            Config?.Process(newContext);

            if (UrlReservations != null)
            {
                foreach (IGenericEntity urlReservation in UrlReservations)
                {
                    urlReservation.Process(newContext);
                }
            }

            ConfigUtil?.Process(newContext);

            StopOn?.Process(context);
            StartOn?.Process(context);
            RemoveOn?.Process(context);
        }