Пример #1
0
        public VulcanEngine.IR.IIR Execute(VulcanEngine.IR.IIR predecessorIR)
        {
            var physicalIR = predecessorIR as PhysicalIR;

            if (physicalIR != null)
            {
                int emittablesCount = 0;
                foreach (PhysicalObject root in physicalIR.EmittableNodes)
                {
                    emittablesCount += root.Count;
                    foreach (PhysicalObject emittable in root.Children)
                    {
                        var package = emittable as Package;
                        if (package != null)
                        {
                            package.ClearProjectDirectory();
                        }
                    }
                }

                // TODO: Progress bar is whacky.
                int emittablesProcessed = 0;
                var context             = new SsisEmitterContext();
                foreach (PhysicalObject root in physicalIR.EmittableNodes)
                {
                    MessageEngine.UpdateProgress(emittablesProcessed / (double)emittablesCount);
                    foreach (ISsisEmitter emittable in root.Children)
                    {
                        emittable.Initialize(context);
                        emittable.Emit(context);
                    }

                    emittablesProcessed += root.Count;
                    MessageEngine.UpdateProgress(emittablesProcessed / (double)emittablesCount);
                }
            }

            return(null);
        }