コード例 #1
0
        /// <summary>
        /// The add operation schedule.
        /// </summary>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <returns>
        /// A LocationOperationSchedule.
        /// </returns>
        public virtual LocationOperationSchedule AddOperationSchedule(string name)
        {
            Check.IsNotNullOrWhitespace(name, "LocationOperationSchedule name is required.");

            LocationOperationSchedule locationOperationSchedule = null;
            var newLocationOperatingSchedule = new LocationOperationSchedule(name);

            DomainRuleEngine.CreateRuleEngine(this, "AddOperationSchedule")
            .WithContext(newLocationOperatingSchedule)
            .Execute(() =>
            {
                locationOperationSchedule          = newLocationOperatingSchedule;
                locationOperationSchedule.Location = this;
                _locationOperationSchedules.Add(locationOperationSchedule);
                NotifyItemAdded(() => LocationOperationSchedules, locationOperationSchedule);
            });

            return(locationOperationSchedule);
        }
コード例 #2
0
ファイル: Location.cs プロジェクト: divyang4481/REM
 /// <summary>
 /// The remove operation schedule.
 /// </summary>
 /// <param name="locationOperationSchedule">
 /// The location operation schedule.
 /// </param>
 public virtual void RemoveOperationSchedule(LocationOperationSchedule locationOperationSchedule)
 {
     _locationOperationSchedules.Delete(locationOperationSchedule);
     NotifyItemRemoved(() => LocationOperationSchedules, locationOperationSchedule);
 }
コード例 #3
0
ファイル: Location.cs プロジェクト: divyang4481/REM
        /// <summary>
        /// The add operation schedule.
        /// </summary>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <returns>
        /// A LocationOperationSchedule.
        /// </returns>
        public virtual LocationOperationSchedule AddOperationSchedule(string name)
        {
            Check.IsNotNullOrWhitespace(name, "LocationOperationSchedule name is required.");

            LocationOperationSchedule locationOperationSchedule = null;
            var newLocationOperatingSchedule = new LocationOperationSchedule ( name );

            DomainRuleEngine.CreateRuleEngine( this, "AddOperationSchedule" )
                .WithContext(newLocationOperatingSchedule)
                .Execute(() =>
                    {
                        locationOperationSchedule = newLocationOperatingSchedule;
                        locationOperationSchedule.Location = this;
                    _locationOperationSchedules.Add(locationOperationSchedule);
                    NotifyItemAdded(() => LocationOperationSchedules, locationOperationSchedule);
                });

            return locationOperationSchedule;
        }
コード例 #4
0
 /// <summary>
 /// The remove operation schedule.
 /// </summary>
 /// <param name="locationOperationSchedule">
 /// The location operation schedule.
 /// </param>
 public virtual void RemoveOperationSchedule(LocationOperationSchedule locationOperationSchedule)
 {
     _locationOperationSchedules.Delete(locationOperationSchedule);
     NotifyItemRemoved(() => LocationOperationSchedules, locationOperationSchedule);
 }