Beispiel #1
0
 public BuildEngine(IBuildTool buildTool, string buildFile, FrameworkVersion version, IDependencyDispatcher dependencyDispatcher)
 {
     BuildTool = buildTool;
     BuildFile = buildFile;
     Version = version;
     Dependencies = new List<Dependency>();
     Exclusions = new List<string>();
     this.dependencyDispatcher = dependencyDispatcher;
     Modes = new Dictionary<string, IModeSettings>();
     var defaultMode = new ModeSettings( DefaultModeName );
     Modes.Add( DefaultModeName, defaultMode );
     CurrentModeSettings = defaultMode;
 }
Beispiel #2
0
        public BuildEngine(IBuildTool buildTool, string buildFile, FrameworkVersion version, IDependencyDispatcher dependencyDispatcher)
        {
            BuildTool    = buildTool;
            BuildFile    = buildFile;
            Version      = version;
            Dependencies = new List <Dependency>();
            Exclusions   = new List <string>();
            this.dependencyDispatcher = dependencyDispatcher;
            Modes = new Dictionary <string, IModeSettings>();
            var defaultMode = new ModeSettings(DefaultModeName);

            Modes.Add(DefaultModeName, defaultMode);
            CurrentModeSettings = defaultMode;
        }
Beispiel #3
0
        public virtual void SetMode(string modeName)
        {
            if (modeName == DefaultModeName)
            {
                throw new ArgumentException("You cannot explicity set the mode to the default mode ( " + DefaultModeName + ").  Use ResetMode() instead.");
            }

            if (CurrentModeSettings.Name != DefaultModeName)
            {
                throw new InvalidOperationException("You cannot change modes when the current mode is not the default mode.  Ensure you call ResetMode() after each use of SetMode().");
            }

            if (Modes.ContainsKey(modeName))
            {
                CurrentModeSettings = Modes[modeName];
                return;
            }

            var modeSettings = new ModeSettings(modeName);

            Modes.Add(modeName, modeSettings);
            CurrentModeSettings = modeSettings;
        }
Beispiel #4
0
        public virtual void SetMode( string modeName )
        {
            if( modeName == DefaultModeName )
            {
                throw new ArgumentException( "You cannot explicity set the mode to the default mode ( " + DefaultModeName + ").  Use ResetMode() instead.");
            }

            if( CurrentModeSettings.Name != DefaultModeName )
            {
                throw new InvalidOperationException( "You cannot change modes when the current mode is not the default mode.  Ensure you call ResetMode() after each use of SetMode().");
            }

            if( Modes.ContainsKey( modeName ))
            {
                CurrentModeSettings = Modes[ modeName ];
                return;
            }

            var modeSettings = new ModeSettings( modeName );
            Modes.Add( modeName, modeSettings );
            CurrentModeSettings = modeSettings;
        }