Microsoft.VisualStudio.Project.ProjectNode.SetSccLocation C# (CSharp) Method

SetSccLocation() public method

This method is called by the source control portion of the environment when a project is initially added to source control, or to change some of the project's settings.
public SetSccLocation ( string sccProjectName, string sccAuxPath, string sccLocalPath, string sccProvider ) : int
sccProjectName string String, opaque to the project, that identifies the project location on the server. Persist this string in the project file.
sccAuxPath string String, opaque to the project, that identifies the local path to the project. Persist this string in the project file.
sccLocalPath string String, opaque to the project, that identifies the path to the server. Persist this string in the project file.
sccProvider string String, opaque to the project, that identifies the source control package. Persist this string in the project file.
return int
        public virtual int SetSccLocation(string sccProjectName, string sccAuxPath, string sccLocalPath, string sccProvider)
        {
            if (this.IsSccDisabled)
            {
                throw new NotImplementedException();
            }

            if (sccProjectName == null)
            {
                throw new ArgumentNullException("sccProjectName");
            }

            if (sccAuxPath == null)
            {
                throw new ArgumentNullException("sccAuxPath");
            }

            if (sccLocalPath == null)
            {
                throw new ArgumentNullException("sccLocalPath");
            }

            if (sccProvider == null)
            {
                throw new ArgumentNullException("sccProvider");
            }

            // Save our settings (returns true if something changed)
            if (!this.SetSccSettings(sccProjectName, sccLocalPath, sccAuxPath, sccProvider))
            {
                return VSConstants.S_OK;
            }

            bool unbinding = (sccProjectName.Length == 0 && sccProvider.Length == 0);

            if (unbinding || this.QueryEditProjectFile(false))
            {
                this.buildProject.SetProperty(ProjectFileConstants.SccProjectName, sccProjectName);
                this.buildProject.SetProperty(ProjectFileConstants.SccProvider, sccProvider);
                this.buildProject.SetProperty(ProjectFileConstants.SccAuxPath, sccAuxPath);
                this.buildProject.SetProperty(ProjectFileConstants.SccLocalPath, sccLocalPath);
            }

            this.isRegisteredWithScc = true;

            return VSConstants.S_OK;
        }
ProjectNode