示例#1
0
        public void Update()
        {
            Logger.AddInfo("UpdateCommand. Start");

            ThemeProvider.Instance.ThemeName = dte.GetVSTheme(CalcVsTheme);
            Solution = dte.BuildTree();
            if (string.IsNullOrEmpty(Solution.Path))
            {
                CanTotalMerge = false;
                Logger.AddInfo("UpdateCommand. End - cant merge since solution is empty or not under vss");
                return;
            }

            //since grid bugs we must initialize startup collection
            SelectedItems = new ObservableCollection <ProjectItemBase>();
            var source = GetFlatItemsSource().Where(item => item.IsCheckOut).ToList();

            Source = source;

            PortOptions = new PortOptionsViewModel(Solution, Options);
            if (!PortOptions.IsAttached)
            {
                Logger.AddInfo("UpdateCommand. End - cant merge since port is not initialized");
                CanTotalMerge = false;
                return;
            }
            MasterBranch             = FindMasterBranch(PortOptions);
            CanTotalMerge            = MasterBranch != null;
            PortOptions.MasterBranch = MasterBranch;

            currentBranchLocker.DoIfNotLocked(() => CurrentBranch = Options.Branches.LastOrDefault(item => item != MasterBranch));
            MergeProgress = 0;

            Logger.AddInfo("UpdateCommand. End - successful initialized");
        }
示例#2
0
        bool InitializeConnection()
        {
            ThemeProvider.Instance.ThemeName = dte.GetVSTheme(CalcVsTheme);
            Solution = dte.BuildTree();
            if (string.IsNullOrEmpty(Solution.Path))
            {
                CanTotalMerge = false;
                Logger.AddInfo("UpdateCommand. End - cant merge since solution is empty or not under vss");
                return(false);
            }
            //since grid bugs we must initialize startup collection

            PortOptions = new PortOptionsViewModel(Solution, Options);
            return(true);
        }
示例#3
0
        DXVcsBranch FindMasterBranch(PortOptionsViewModel portOptions)
        {
            string relativePath = portOptions.GetRelativePath(PortOptions.ProjectFilePath);

            return(Options.Branches.FirstOrDefault(branch => relativePath.StartsWith(branch.Path, StringComparison.OrdinalIgnoreCase)));
        }
示例#4
0
 public MergeHelper(OptionsViewModel options, PortOptionsViewModel model)
 {
     Options = options;
     Port    = model;
 }