public UpdateProjectAction(IView view, IController con, PipelineProject item, PropertyDescriptor property, object previousValue)
        {
            _view = view;
            _con = con;

            _state = ProjectState.Get(item);

            switch (property.Name)
            {
                case "OutputDir":
                    _state.OutputDir = (string)previousValue;
                    break;
                case "IntermediateDir":
                    _state.IntermediateDir = (string)previousValue;
                    break;
                case "References":
                    _state.References = new List<string>((List<string>)previousValue);
                    _referencesChanged = true;
                    break;
                case "Platform":
                    _state.Platform = (TargetPlatform)previousValue;
                    break;
                case "Profile":
                    _state.Profile = (GraphicsProfile)previousValue;
                    break;
                case "Config":
                    _state.Config = (string)previousValue;
                    break;
                case "OriginalPath":
                    _state.OriginalPath = (string)previousValue;
                    break;
            }
        }
예제 #2
0
        /// <summary>
        /// Create a ProjectState storing member values of the passed PipelineProject.
        /// </summary>        
        public static ProjectState Get(PipelineProject proj)
        {
            var state = new ProjectState()
                {
                    OriginalPath = proj.OriginalPath,
                    OutputDir = proj.OutputDir,
                    IntermediateDir = proj.IntermediateDir,
                    References = new List<string>(proj.References),
                    Platform = proj.Platform,
                    Profile = proj.Profile,
                    Config = proj.Config,        
                };

            return state;
        }
        private void Toggle()
        {
            var item = (PipelineProject)_con.GetItem(_state.OriginalPath);
            var state = ProjectState.Get(item);
            _state.Apply(item);
            _state = state;

            if (_referencesChanged)
                _con.OnReferencesModified();
            else
                _con.OnProjectModified();

            _view.BeginTreeUpdate();
            _view.UpdateProperties(item);
            _view.UpdateTreeItem(item);
            _view.EndTreeUpdate();
        }