Exemplo n.º 1
0
        public static IPlantEx Run(object plant, ISettingsBox rootSettingsBox)
        {
            var args = new InitializePlantArgs(plant, rootSettingsBox);

            HatcherGuide <IPipelineManager> .Instance.InvokePipeline("initializePlant", args);

            return(args.ResolvedPlantEx);
        }
Exemplo n.º 2
0
 public virtual void Process(InitializePlantArgs args)
 {
     IPlant plant = args.IPlantObject;
       if (plant.Description.IsNullOrEmpty() || plant.HumanSupportingName.IsNullOrEmpty())
       {
     Log.Warn("Plant '{0}' doesn't provide correct name and description. It will be disabed".FormatWith(args.PlantID), this);
     args.Abort();
     args.ResolvedPlantEx = null;
       }
 }
Exemplo n.º 3
0
        public virtual void Process(InitializePlantArgs args)
        {
            IPlant plant = args.IPlantObject;

            if (plant.Description.IsNullOrEmpty() || plant.HumanSupportingName.IsNullOrEmpty())
            {
                Log.Warn("Plant '{0}' doesn't provide correct name and description. It will be disabed".FormatWith(args.PlantID), this);
                args.Abort();
                args.ResolvedPlantEx = null;
            }
        }
Exemplo n.º 4
0
 public virtual void Process(InitializePlantArgs args)
 {
     var iPlant = args.PlantObject as IPlant;
       if (iPlant != null)
       {
     args.IPlantObject = iPlant;
       }
       else
       {
     args.Abort();
       }
 }
Exemplo n.º 5
0
 public virtual void Process(InitializePlantArgs args)
 {
     IPlant plant = args.IPlantObject;
       try
       {
     plant.Initialize();
       }
       catch (Exception ex)
       {
     Log.Error("Unable to initialize plant {0}".FormatWith(plant.GetType()), ex, this);
     args.Abort();
       }
 }
Exemplo n.º 6
0
        public virtual void Process(InitializePlantArgs args)
        {
            var iPlant = args.PlantObject as IPlant;

            if (iPlant != null)
            {
                args.IPlantObject = iPlant;
            }
            else
            {
                args.Abort();
            }
        }
Exemplo n.º 7
0
 public virtual void Process(InitializePlantArgs args)
 {
     var plantEx = new PlantEx();
       try
       {
     plantEx.Initialize(args.IPlantObject, args.Workhorses, args.PlantID, args.PlantSettingsBox);
     args.ResolvedPlantEx = plantEx;
       }
       catch (Exception ex)
       {
     Log.Error("Can't initialize PlantEx", ex, this);
       }
 }
Exemplo n.º 8
0
        public virtual void Process(InitializePlantArgs args)
        {
            IPlant plant = args.IPlantObject;

            try
            {
                plant.Initialize();
            }
            catch (Exception ex)
            {
                Log.Error("Unable to initialize plant {0}".FormatWith(plant.GetType()), ex, this);
                args.Abort();
            }
        }
Exemplo n.º 9
0
        public virtual void Process(InitializePlantArgs args)
        {
            var plantEx = new PlantEx();

            try
            {
                plantEx.Initialize(args.IPlantObject, args.Workhorses, args.PlantID, args.PlantSettingsBox);
                args.ResolvedPlantEx = plantEx;
            }
            catch (Exception ex)
            {
                Log.Error("Can't initialize PlantEx", ex, this);
            }
        }
Exemplo n.º 10
0
 public virtual void Process(InitializePlantArgs args)
 {
     var workhorses = new List<object> { args.PlantObject };
       var asExpected = args.PlantObject as IServicesDelegation;
       if (asExpected != null)
       {
     List<object> workhorseCandidates = asExpected.GetServiceDelegates();
     if (workhorseCandidates != null)
     {
       workhorses.AddRange(workhorseCandidates);
     }
     Log.Debug("Plant {0} supports service delegation".FormatWith(args.PlantObject.GetType().FullName), this);
       }
       args.Workhorses = workhorses;
 }
Exemplo n.º 11
0
        public virtual void Process(InitializePlantArgs args)
        {
            var workhorses = new List <object> {
                args.PlantObject
            };
            var asExpected = args.PlantObject as IServicesDelegation;

            if (asExpected != null)
            {
                List <object> workhorseCandidates = asExpected.GetServiceDelegates();
                if (workhorseCandidates != null)
                {
                    workhorses.AddRange(workhorseCandidates);
                }
                Log.Debug("Plant {0} supports service delegation".FormatWith(args.PlantObject.GetType().FullName), this);
            }
            args.Workhorses = workhorses;
        }
Exemplo n.º 12
0
 public static IPlantEx Run(object plant, ISettingsBox rootSettingsBox)
 {
     var args = new InitializePlantArgs(plant, rootSettingsBox);
       HatcherGuide<IPipelineManager>.Instance.InvokePipeline("initializePlant", args);
       return args.ResolvedPlantEx;
 }
Exemplo n.º 13
0
 public virtual void Process(InitializePlantArgs args)
 {
     args.PlantSettingsBox = args.RootSettingsBox.GetSubBox(args.PlantID);
 }
Exemplo n.º 14
0
 public virtual void Process(InitializePlantArgs args)
 {
     args.PlantSettingsBox = args.RootSettingsBox.GetSubBox(args.PlantID);
 }
Exemplo n.º 15
0
 public virtual void Process(InitializePlantArgs args)
 {
     args.PlantID = args.PlantObject.GetType().FullName;
 }
Exemplo n.º 16
0
 public virtual void Process(InitializePlantArgs args)
 {
     args.PlantID = args.PlantObject.GetType().FullName;
 }