private static Func <int> TwoLevelIncremental(IAllocation allocation)
        {
            var query    = TwoLevelContainerAnalysis.GetFaultyContainers(allocation);
            var queryInc = Observable.Expression(() => query.Count());

            return(() => queryInc.Value);
        }
Beispiel #2
0
        /// <summary>
        /// Gets called when the parent model element of the current model element is about to change
        /// </summary>
        /// <param name="oldParent">The old parent model element</param>
        /// <param name="newParent">The new parent model element</param>
        protected override void OnParentChanging(IModelElement newParent, IModelElement oldParent)
        {
            IAllocation           oldAllocation_AllocationContext = ModelHelper.CastAs <IAllocation>(oldParent);
            IAllocation           newAllocation_AllocationContext = ModelHelper.CastAs <IAllocation>(newParent);
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldAllocation_AllocationContext, newAllocation_AllocationContext);

            this.OnAllocation_AllocationContextChanging(e);
            this.OnPropertyChanging("Allocation_AllocationContext", e, _allocation_AllocationContextReference);
        }
 public static IEnumerableExpression <IAssemblyConnector> GetFaultyContainers(IAllocation allocation)
 {
     return(from connector in allocation.AllocatedSystem.Connectors
            let providingAllocation = allocation.AllocationContexts
                                      .FirstOrDefault(c => c.Assembly == connector.ProvidingComponent)
                                      let requiringAllocation = allocation.AllocationContexts
                                                                .FirstOrDefault(c => c.Assembly == connector.UsingComponent)
                                                                where providingAllocation.Container != requiringAllocation.Container &&
                                                                !allocation.Environment.Links.Any(link =>
                                                                                                  link.ConnectedContainers.Contains(providingAllocation.Container) &&
                                                                                                  link.ConnectedContainers.Contains(requiringAllocation.Container))
                                                                select connector);
 }
Beispiel #4
0
 public HomeController(IUser iuser, ITraining itraining,
                       IPdfSharpService pdfService, IMentor mentor,
                       IInternal iinternal, IAllocation allocation,
                       IAspiration aspiration, ILog log,
                       IMigraDocService migraDocService)
 {
     _IUser           = iuser;
     _ITraining       = itraining;
     _pdfService      = pdfService;
     _IMentor         = mentor;
     _IInternal       = iinternal;
     _IAllocation     = allocation;
     _IAspiration     = aspiration;
     _ILog            = log;
     _migraDocService = migraDocService;
 }
Beispiel #5
0
        /// <summary>
        /// Gets called when the parent model element of the current model element changes
        /// </summary>
        /// <param name="oldParent">The old parent model element</param>
        /// <param name="newParent">The new parent model element</param>
        protected override void OnParentChanged(IModelElement newParent, IModelElement oldParent)
        {
            IAllocation oldAllocation_AllocationContext = ModelHelper.CastAs <IAllocation>(oldParent);
            IAllocation newAllocation_AllocationContext = ModelHelper.CastAs <IAllocation>(newParent);

            if ((oldAllocation_AllocationContext != null))
            {
                oldAllocation_AllocationContext.AllocationContexts_Allocation.Remove(this);
            }
            if ((newAllocation_AllocationContext != null))
            {
                newAllocation_AllocationContext.AllocationContexts_Allocation.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldAllocation_AllocationContext, newAllocation_AllocationContext);

            this.OnAllocation_AllocationContextChanged(e);
            this.OnPropertyChanged("Allocation_AllocationContext", e, _allocation_AllocationContextReference);
            base.OnParentChanged(newParent, oldParent);
        }
Beispiel #6
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.System == null))
     {
         ISystem0 systemCasted = item.As <ISystem0>();
         if ((systemCasted != null))
         {
             this._parent.System = systemCasted;
             return;
         }
     }
     if ((this._parent.Repository == null))
     {
         IRepository repositoryCasted = item.As <IRepository>();
         if ((repositoryCasted != null))
         {
             this._parent.Repository = repositoryCasted;
             return;
         }
     }
     if ((this._parent.Allocation == null))
     {
         IAllocation allocationCasted = item.As <IAllocation>();
         if ((allocationCasted != null))
         {
             this._parent.Allocation = allocationCasted;
             return;
         }
     }
     if ((this._parent.Environment == null))
     {
         IEnvironment environmentCasted = item.As <IEnvironment>();
         if ((environmentCasted != null))
         {
             this._parent.Environment = environmentCasted;
             return;
         }
     }
 }
Beispiel #7
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.ResourceContainer_AllocationContext == null))
     {
         IResourceContainer resourceContainer_AllocationContextCasted = item.As <IResourceContainer>();
         if ((resourceContainer_AllocationContextCasted != null))
         {
             this._parent.ResourceContainer_AllocationContext = resourceContainer_AllocationContextCasted;
             return;
         }
     }
     if ((this._parent.AssemblyContext_AllocationContext == null))
     {
         IAssemblyContext assemblyContext_AllocationContextCasted = item.As <IAssemblyContext>();
         if ((assemblyContext_AllocationContextCasted != null))
         {
             this._parent.AssemblyContext_AllocationContext = assemblyContext_AllocationContextCasted;
             return;
         }
     }
     if ((this._parent.Allocation_AllocationContext == null))
     {
         IAllocation allocation_AllocationContextCasted = item.As <IAllocation>();
         if ((allocation_AllocationContextCasted != null))
         {
             this._parent.Allocation_AllocationContext = allocation_AllocationContextCasted;
             return;
         }
     }
     if ((this._parent.EventChannel__AllocationContext == null))
     {
         IEventChannel eventChannel__AllocationContextCasted = item.As <IEventChannel>();
         if ((eventChannel__AllocationContextCasted != null))
         {
             this._parent.EventChannel__AllocationContext = eventChannel__AllocationContextCasted;
             return;
         }
     }
 }
        private static Func <int> TwoLevelBatch(IAllocation allocation)
        {
            var query = TwoLevelContainerAnalysis.GetFaultyContainers(allocation);

            return(() => query.Count());
        }
Beispiel #9
0
 public AllocationController(IAllocation iallocation, IUser iuser, ICommon icommon)
 {
     _IAllocation = iallocation;
     _IUser       = iuser;
     _ICommon     = icommon;
 }