コード例 #1
0
        /// <summary>
        /// Performs reconciliation of documents</summary>
        /// <param name="doing">True iff doing the command</param>
        /// <returns>True iff any documents reconciled or can be reconciled</returns>
        protected virtual bool DoReconcile(bool doing)
        {
            if (SourceControlService == null || SourceControlContext == null)
            {
                return(false);
            }

            if (!doing)
            {
                foreach (IResource resource in SourceControlContext.Resources)
                {
                    return(true);
                }

                return(false);
            }

            var uris = new List <Uri>();

            foreach (IResource resource in SourceControlContext.Resources)
            {
                uris.Add(resource.Uri);
            }

            var modifiled       = new List <Uri>();
            var localNotInDepot = new List <Uri>();

            using (new WaitCursor())
            {
                foreach (Uri uri in SourceControlService.GetModifiedFiles(uris))
                {
                    if (SourceControlService.GetStatus(uri) != SourceControlStatus.CheckedOut)
                    {
                        modifiled.Add(uri);
                    }
                }

                foreach (Uri uri in uris)
                {
                    if (!modifiled.Contains(uri))
                    {
                        if (SourceControlService.GetStatus(uri) == SourceControlStatus.FileDoesNotExist)
                        {
                            localNotInDepot.Add(uri);
                        }
                    }
                }
            }

            using (var form = new ReconcileForm(SourceControlService, modifiled, localNotInDepot))
            {
                if (m_mainForm != null)
                {
                    form.Icon = m_mainForm.Icon;
                }
                form.ShowDialog();
            }

            return(true);
        }
コード例 #2
0
ファイル: SourceControlCommands.cs プロジェクト: sbambach/ATF
        /// <summary>
        /// Performs reconciliation of documents</summary>
        /// <param name="doing">True iff doing the command</param>
        /// <returns>True iff any documents reconciled or can be reconciled</returns>
        protected virtual bool DoReconcile(bool doing)
        {
            if (SourceControlService == null || SourceControlContext == null)
                return false;

            if (!doing)
            {
                foreach (IResource resource in SourceControlContext.Resources)
                    return true;

                return false;
            }

            var uris = new List<Uri>();
            foreach (IResource resource in SourceControlContext.Resources)
                uris.Add(resource.Uri);

            var modifiled = new List<Uri>();
            var localNotInDepot = new List<Uri>();

            using (new WaitCursor())
            {
                foreach (Uri uri in SourceControlService.GetModifiedFiles(uris))
                {
                    if (SourceControlService.GetStatus(uri) != SourceControlStatus.CheckedOut)
                        modifiled.Add(uri);
                }

                foreach (Uri uri in uris)
                {
                    if (!modifiled.Contains(uri))
                        if (SourceControlService.GetStatus(uri) == SourceControlStatus.FileDoesNotExist)
                            localNotInDepot.Add(uri);
                }
            }

            using (var form = new ReconcileForm(SourceControlService, modifiled, localNotInDepot))
            {
                if (m_mainForm != null)
                    form.Icon = m_mainForm.Icon;
                form.ShowDialog();
            }

            return true;
        }