コード例 #1
0
        public static DialogResult Show(P4.P4Exception ex, bool showCancel, bool suppressUI)
        {
            P4VsProviderService p4vs = (P4VsProviderService)P4VsProvider.Service(typeof(P4VsProviderService));

            if ((suppressUI) && (ex.ErrorLevel < P4.ErrorSeverity.E_FATAL))
            {
                return(DialogResult.OK);
            }

            if (p4vs.ScmProvider != null && p4vs.ScmProvider.Connection != null)
            {
                if (p4vs.ScmProvider.Connection.isLoggedIn() == false)
                {
                    MessageBox.Show(Resources.P4ErrorDlg_LoggedOutMsg, Resources.P4VS, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(DialogResult.Cancel);
                }
            }

            if (ex is P4.P4CommandCanceledException)
            {
                // this command was canceled by the user, so no need to show an error.
                return(DialogResult.OK);
            }

            P4ErrorDlg dlg = new P4ErrorDlg(ex, showCancel);

            return(dlg.ShowDialog());
        }
コード例 #2
0
        public ReconcileDlg(IList <P4.FileSpec> addFiles, IList <P4.FileSpec> delFiles,
                            IList <P4.FileSpec> editFiles, IList <P4.Changelist> changelists,
                            P4VsProviderService sccService)

        {
            Init(addFiles, delFiles, editFiles, changelists, sccService);
        }
コード例 #3
0
        public DepotPathDlg(P4VsProviderService sccService, string title, bool showOpenConnectionBtn)
        {
            PreferenceKey = "DepotPathDlg";

            SccService = sccService;

            ShowOpenConnectionBtn = showOpenConnectionBtn;

            UseEnvConnect = Preferences.LocalSettings.GetBool("DepotPathDlg.EnvCB.Checked", false);

            FilterByWorkspace = Preferences.LocalSettings.GetBool("DepotPathDlg.FilterCB.Checked", true);

            InitializeComponent();

            this.Icon = Images.icon_p4vs_16px;
            //
            // DepotTreeViewImageList
            //
            this.DepotTreeViewImageList = new System.Windows.Forms.ImageList(this.components);

            DepotTreeViewImageList.TransparentColor = System.Drawing.Color.Transparent;
            DepotTreeViewImageList.Images.Add("depot.png", Images.depot);
            DepotTreeViewImageList.Images.Add("folder.png", Images.folder);
            DepotTreeViewImageList.Images.Add("greyfile.png", Images.greyfile);
            DepotTreeViewImageList.Images.Add("stream_depot.png", Images.stream_depot);

            mDepotTreeView.ImageList = DepotTreeViewImageList;

            if (title != null)
            {
                this.Text = title;
            }

            Init();
        }
コード例 #4
0
        private void createActiveChangelists(P4VsProviderService P4Service)
        {
            string key = "ActiveChangelist_" + P4Service.ScmProvider.Connection.Repository.Connection.Server.Address.Uri.Replace(':', '_') +
                         "_" + P4Service.ScmProvider.Connection.User + "_" + P4Service.ScmProvider.Connection.Workspace;

            ChangeLists = new ActiveChangeListCombo(P4Service);
            string newActiveChangeListComboChoice = Preferences.LocalSettings.GetString(key, Resources.Changelist_Default);

            ChangeLists.SetActiveChangeList(newActiveChangeListComboChoice);
        }
コード例 #5
0
        protected override void Initialize()
        {
            try
            {
                // load the local settings
                Preferences.Initialize();
                Preferences.LocalSettings.Load(null);

                logger.Trace("Entering Initialize() of: {0}", this.ToString());
                base.Initialize();

                // Proffer the source control service implemented by the provider
                // The service provider implemented by the package
                SccService = new P4VsProviderService(this);
                ((IServiceContainer)this).AddService(typeof(P4VsProviderService), SccService, true);

                // Initilise Glyphs
                IVsHierarchy solHier = (IVsHierarchy)GetService(typeof(SVsSolution));
                Glyphs = new NodeGlyphs(SccService, solHier);

                // Add our command handlers for menu (commands must exist in the .vsct file)
                OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
                if (mcs != null)
                {
                    // View Menu commands
                    #region View Menu commands
                    // Workspaces ToolWindow Command
                    CommandID   cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdViewWorkspaceToolWindow);
                    MenuCommand menuCmd = new MenuCommand(new EventHandler(P4VsViewWorkspaceToolWindow), cmd);
                    mcs.AddCommand(menuCmd);

                    // History ToolWindow
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdViewHistoryToolWindow);
                    menuCmd = new MenuCommand(new EventHandler(P4VsViewHistoryToolWindow), cmd);
                    mcs.AddCommand(menuCmd);

                    // Jobs ToolWindow
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdViewJobsToolWindow);
                    menuCmd = new MenuCommand(new EventHandler(P4VsViewJobsToolWindow), cmd);
                    mcs.AddCommand(menuCmd);

                    // P4 ToolWindow
                    //cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdViewP4ToolWindow);
                    //menuCmd = new MenuCommand(new EventHandler(P4VsViewP4ToolWindow), cmd);
                    //mcs.AddCommand(menuCmd);

                    // SubmittedChangelists ToolWindow
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdViewSubmittedChangelistsToolWindow);
                    menuCmd = new MenuCommand(new EventHandler(P4VsViewSubmittedChangelistsToolWindow), cmd);
                    mcs.AddCommand(menuCmd);

                    // PendingChangelists ToolWindow
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdViewPendingChangelistsToolWindow);
                    menuCmd = new MenuCommand(new EventHandler(P4VsViewPendingChangelistsToolWindow), cmd);
                    mcs.AddCommand(menuCmd);

                    // Labels ToolWindow
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdViewLabelsToolWindow);
                    menuCmd = new MenuCommand(new EventHandler(P4VsViewLabelsToolWindow), cmd);
                    mcs.AddCommand(menuCmd);

                    // Swarm ToolWindow
                    //cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdViewSwarmToolWindow);
                    //menuCmd = new MenuCommand(new EventHandler(P4VsViewSwarmToolWindow), cmd);
                    //mcs.AddCommand(menuCmd);

                    // Streams ToolWindow
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdViewStreamsToolWindow);
                    menuCmd = new MenuCommand(new EventHandler(P4VsViewStreamsToolWindow), cmd);
                    mcs.AddCommand(menuCmd);

                    // Reviews ToolWindow
                    //cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdViewReviewsToolWindow);
                    //menuCmd = new MenuCommand(new EventHandler(P4VsViewReviewsToolWindow), cmd);
                    //mcs.AddCommand(menuCmd);
                    #endregion

                    // Help Menu commands
                    #region Help Menu commands
                    // Help/P4VS Help
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdP4VSHelp);
                    menuCmd = new MenuCommand(new EventHandler(P4VsP4VSHelp), cmd);
                    mcs.AddCommand(menuCmd);

                    // Help/P4VS SystemInfo
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdP4VSSystemInfo);
                    menuCmd = new MenuCommand(new EventHandler(P4VsP4VSSystemInfo), cmd);
                    mcs.AddCommand(menuCmd);

                    #endregion

                    // File Menu commands
                    #region File Menu commands
                    // File/Open Solution in Perforce Depot
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdFileOpenInDepot);
                    menuCmd = new MenuCommand(new EventHandler(P4VsFileOpenInDepot), cmd);
                    mcs.AddCommand(menuCmd);

                    // File/Open Connection to a Perforce Depot
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdOpenConnection);
                    menuCmd = new MenuCommand(new EventHandler(P4VsOpenConnection), cmd);
                    mcs.AddCommand(menuCmd);

                    // File/Close Connection to the Perforce Depot
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdCloseConnection);
                    menuCmd = new MenuCommand(new EventHandler(P4VsCloseConnection), cmd);
                    mcs.AddCommand(menuCmd);

                    // Workspaces ToolWindow's ToolBar Command
                    //cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdToolWindowToolbarCommand);
                    //menuCmd = new MenuCommand(new EventHandler(P4VsWorkspaceToolWindowToolbarCommand), cmd);
                    //mcs.AddCommand(menuCmd);
                    #endregion

                    // Source control menu commands
                    #region File Menu commands
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdScmRefresh);
                    menuCmd = new MenuCommand(new EventHandler(P4VsScmRefresh), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdAddToSourceControl);
                    menuCmd = new MenuCommand(new EventHandler(P4VsAddToSourceControl), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdCheckin);
                    menuCmd = new MenuCommand(new EventHandler(P4VsCheckin), cmd);
                    mcs.AddCommand(menuCmd);

                    //cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdCheckout);
                    //menuCmd = new MenuCommand(new EventHandler(P4VsCheckout), cmd);
                    //mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdCheckout);
                    menuCmd = new OleMenuCommand(new EventHandler(P4VsCheckout), cmd);
                    //queryStatusMenuCommand.BeforeQueryStatus +=new EventHandler(OnBeforeQueryStatus);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdCheckoutProject);
                    menuCmd = new MenuCommand(new EventHandler(P4VsCheckoutEntireProjectOrSolution), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdCheckoutSolution);
                    menuCmd = new MenuCommand(new EventHandler(P4VsCheckoutEntireProjectOrSolution), cmd);
                    mcs.AddCommand(menuCmd);

                    //cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdUseSccOffline);
                    //menuCmd = new MenuCommand(new EventHandler(P4VsUseSccOffline), cmd);
                    //mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdReconcile);
                    menuCmd = new MenuCommand(new EventHandler(P4VsReconcileFiles), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdRevert);
                    menuCmd = new MenuCommand(new EventHandler(P4VsRevert), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdRevertUnchanged);
                    menuCmd = new MenuCommand(new EventHandler(P4VsRevertUnchanged), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdLock);
                    menuCmd = new MenuCommand(new EventHandler(P4VsLock), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdUnlock);
                    menuCmd = new MenuCommand(new EventHandler(P4VsUnlock), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdChangeFileType);
                    menuCmd = new MenuCommand(new EventHandler(P4VsChangeFileType), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdMoveToChangelist);
                    menuCmd = new MenuCommand(new EventHandler(P4VsMoveToChangelist), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdAddToIgnoreList);
                    menuCmd = new MenuCommand(new EventHandler(P4VsAddToIgnoreList), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdRemoveFromIgnoreList);
                    menuCmd = new MenuCommand(new EventHandler(P4VsRemoveFromIgnoreList), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdEditIgnoreList);
                    menuCmd = new MenuCommand(new EventHandler(P4VsEditIgnoreList), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdResolve);
                    menuCmd = new MenuCommand(new EventHandler(P4VsResolve), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdSync);
                    menuCmd = new MenuCommand(new EventHandler(P4VsSync), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdSyncHead);
                    menuCmd = new MenuCommand(new EventHandler(P4VsSyncHead), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdDiffVsHave);
                    menuCmd = new MenuCommand(new EventHandler(P4VsDiffVsHave), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdDiffVsAny);
                    menuCmd = new MenuCommand(new EventHandler(P4VsDiffVsAny), cmd);
                    mcs.AddCommand(menuCmd);

                    //cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdAddProjectToSCC);
                    //menuCmd = new MenuCommand(new EventHandler(P4VsAddProjectToSCC), cmd);
                    //mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdShowHistory);
                    menuCmd = new MenuCommand(new EventHandler(P4VsShowHistory), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdShelve);
                    menuCmd = new MenuCommand(new EventHandler(P4VsShelve), cmd);
                    mcs.AddCommand(menuCmd);

                    //cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdScmAttributes);
                    //menuCmd = new MenuCommand(new EventHandler(P4VsScmAttributes), cmd);
                    //mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdScmMerge);
                    menuCmd = new MenuCommand(new EventHandler(P4VsScmMerge), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdScmCopy);
                    menuCmd = new MenuCommand(new EventHandler(P4VsScmCopy), cmd);
                    mcs.AddCommand(menuCmd);
                    #endregion

                    // P4V commands
                    #region P4V Menu commands
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdP4V);
                    menuCmd = new MenuCommand(new EventHandler(P4VsP4V), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdTimeLapse);
                    menuCmd = new MenuCommand(new EventHandler(P4VsTimeLapse), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdRevGraph);
                    menuCmd = new MenuCommand(new EventHandler(P4VsRevGraph), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdStreamGraph);
                    menuCmd = new MenuCommand(new EventHandler(P4VsStreamGraph), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.cmdidCancelActiveCommand);
                    menuCmd = new MenuCommand(new EventHandler(Exec_CancelActiveCommand), cmd);
                    mcs.AddCommand(menuCmd);

                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.cmdidCurrentStream);
                    menuCmd = new MenuCommand(new EventHandler(Exec_CurrentStream), cmd);
                    mcs.AddCommand(menuCmd);
                    #endregion

                    // Status Bar commands
                    #region Status Bar commands
                    // Add to Source Control/Publish
                    cmd     = new CommandID(GuidList.guidP4VsProviderCmdSet, CommandId.icmdPublish);
                    menuCmd = new MenuCommand(new EventHandler(P4VsScmPublish), cmd);
                    mcs.AddCommand(menuCmd);
                    #endregion

                    // DropDownCombo
                    //	 a DROPDOWNCOMBO does not let the user type into the combo box; they can only pick from the list.
                    //   The string value of the element selected is returned.
                    //	 For example, this type of combo could be used for the "Solution Configurations" on the "Standard" toolbar.
                    //
                    //   A DropDownCombo box requires two commands:
                    //     One command (cmdidMyCombo) is used to ask for the current value of the combo box and to
                    //     set the new value when the user makes a choice in the combo box.
                    //
                    //     The second command (cmdidMyComboGetList) is used to retrieve this list of choices for the combo box.
                    //
                    // Normally IOleCommandTarget::QueryStatus is used to determine the state of a command, e.g.
                    // enable vs. disable, shown vs. hidden, etc. The QueryStatus method does not have any way to
                    // control the statue of a combo box, e.g. what list of items should be shown and what is the
                    // current value. In order to communicate this information actually IOleCommandTarget::Exec
                    // is used with a non-NULL varOut parameter. You can think of these Exec calls as extended
                    // QueryStatus calls. There are two pieces of information needed for a combo, thus it takes
                    // two commands to retrieve this information. The main command id for the command is used to
                    // retrieve the current value and the second command is used to retrieve the full list of
                    // choices to be displayed as an array of strings.
                    cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, (int)CommandId.cmdidConnectionDropDownCombo);
                    omcConnectionComboSelChanged = new OleMenuCommand(new EventHandler(P4VsConnectionDropDownCombo), cmd);
                    omcConnectionComboSelChanged.ParametersDescription = "$"; // accept any argument string
                    mcs.AddCommand(omcConnectionComboSelChanged);

                    cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, (int)CommandId.cmdidConnectionDropDownComboGetList);
                    omcConnectionComboGetList = new OleMenuCommand(new EventHandler(P4VsConnectionDropDownComboGetList), cmd);
                    mcs.AddCommand(omcConnectionComboGetList);

                    cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, (int)CommandId.cmdidActiveChangelistDropDownCombo);
                    omcActiveChangelistComboSelChanged = new OleMenuCommand(new EventHandler(P4VsActiveChangelistDropDownCombo), cmd);
                    omcActiveChangelistComboSelChanged.ParametersDescription = "$"; // accept any argument string
                    mcs.AddCommand(omcActiveChangelistComboSelChanged);

                    cmd = new CommandID(GuidList.guidP4VsProviderCmdSet, (int)CommandId.cmdidActiveChangelistDropDownComboGetList);
                    omcActiveChangelistComboGetList = new OleMenuCommand(new EventHandler(P4VsActiveChangelistDropDownComboGetList), cmd);
                    mcs.AddCommand(omcActiveChangelistComboGetList);
                }

                // -- Set an eventlistener for shell property changes
                var shellService = GetService(typeof(SVsShell)) as IVsShell;
                if (shellService != null)
                {
                    ErrorHandler.ThrowOnFailure(shellService.AdviseShellPropertyChanges(this, out _EventSinkCookie));
                }

                // Register the provider with the source control manager
                // If the package is to become active, this will also callback on OnActiveStateChange and the menu commands will be enabled
                IVsRegisterScciProvider rscp = (IVsRegisterScciProvider)GetService(typeof(IVsRegisterScciProvider));
                rscp.RegisterSourceControlProvider(GuidList.guidP4VsProvider);

                instance = this;
            } catch (Exception ex)
            {
                logger.Error(ex, "Initialize failed");
                logger.Error("Error: {0}", ex.Message);
                logger.Error("Stacktrace: {0}", ex.StackTrace);
            }
        }
コード例 #6
0
        private void MainThreadInitialization(IVsUIShell shellService, bool isAsyncPath)
        {
            // Do operations requiring main thread utilizing passed in services
            if (isAsyncPath)
            {
                var    solService = GetService(typeof(SVsSolution)) as IVsSolution;
                string dir        = "";
                string file       = "";
                string optsFile   = "";
                solService.GetSolutionInfo(out dir, out file, out optsFile);

                if (string.IsNullOrEmpty(optsFile))
                {
                    return;
                }

                try
                {
                    FileStream fs = new FileStream(
                        optsFile,
                        FileMode.Open,
                        FileAccess.ReadWrite
                        );

                    CompoundFile   cf   = new CompoundFile(fs, CFSUpdateMode.Update, CFSConfiguration.SectorRecycle | CFSConfiguration.NoValidationException | CFSConfiguration.EraseFreeSectors);
                    IList <CFItem> list = cf.GetAllNamedEntries(PersistSolutionProps._strSolutionUserOptionsKey);

                    if (list != null && list.Count > 0)
                    {
                        // while checking the solution user options, get the port,
                        // user, and workspace. This needs to be done here as ReadUserOptions
                        // is no longer triggered on .sln load if Visual Studio is launched
                        // by opening a .sln.
                        CFStream foundStream = cf.RootStorage.GetStream(PersistSolutionProps._strSolutionUserOptionsKey);
                        byte[]   data        = foundStream.GetData();
                        Stream   stream      = new MemoryStream(data);

                        Hashtable hashProjectsUserData = new Hashtable();
                        if (stream.Length > 0)
                        {
                            BinaryFormatter formatter = new BinaryFormatter();
                            hashProjectsUserData = formatter.Deserialize(stream) as Hashtable;
                        }

                        P4VsProviderService P4VSService = (P4VsProviderService)GetService(typeof(P4VsProviderService));

                        if (hashProjectsUserData != null && (hashProjectsUserData.ContainsKey("Connect_State") && (hashProjectsUserData["Connect_State"] != null)))
                        {
                            if (hashProjectsUserData.ContainsKey("Connect_Port"))
                            {
                                P4VSService.port = hashProjectsUserData["Connect_Port"] as string;
                            }
                            if (hashProjectsUserData.ContainsKey("Connect_User"))
                            {
                                P4VSService.user = hashProjectsUserData["Connect_User"] as string;
                            }
                            if (hashProjectsUserData.ContainsKey("Connect_Workspace"))
                            {
                                P4VSService.workspace = hashProjectsUserData["Connect_Workspace"] as string;
                            }
                            if (string.IsNullOrEmpty(P4VSService.LoadingControlledSolutionLocation))
                            {
                                P4VSService.LoadingControlledSolutionLocation = P4VSService.port;
                            }
                        }

                        // check to see if the sln is tagged
                        string sln = System.IO.File.ReadAllText(file);
                        P4VSService._P4VsProvider.SolutionFileTagged = sln.Contains("GlobalSection(" +
                                                                                    PersistSolutionProps._strSolutionPersistanceKey + ") = preSolution\r\n\t\t" +
                                                                                    PersistSolutionProps._strSolutionControlledProperty + " = True\r\n\tEndGlobalSection");

                        P4VSService.AsyncLoad = true;
                        P4VSService.OnAfterOpenSolution(null, 0);
                    }
                    cf.Close();
                }
                catch
                {
                    // If we are here, most likely the .suo file was not found, or could not
                    // be opened, so just continue without attempting to get user settings.
                }
            }
        }
コード例 #7
0
        private void Init(IList <P4.FileSpec> addFiles, IList <P4.FileSpec> delFiles,
                          IList <P4.FileSpec> editFiles, IList <P4.Changelist> changelists,
                          P4VsProviderService sccService)
        {
            PreferenceKey = "ReconcileDlg";

            InitializeComponent();
            this.Icon  = Images.icon_p4vs_16px;
            SccService = sccService;

            listView1.CheckBoxes = true;
            if (addFiles != null)
            {
                notInDepotText.Text += " [" + addFiles.Count + "]";
                foreach (P4.FileSpec fs in addFiles)
                {
                    ListViewItem addFile = new ListViewItem();
                    addFile.Checked = true;
                    addFile.SubItems.Add(fs.LocalPath.GetFileName().ToString());
                    addFile.SubItems.Add(fs.LocalPath.Path.Remove(fs.LocalPath.Path.LastIndexOf(@"\")));
                    addFile.Tag = fs.LocalPath.Path;
                    listView1.Items.Add(addFile);
                }
            }

            listView2.CheckBoxes = true;
            if (editFiles != null)
            {
                modifiedText.Text += " [" + editFiles.Count + "]";
                foreach (P4.FileSpec fs in editFiles)
                {
                    ListViewItem editFile = new ListViewItem();
                    editFile.Checked = true;
                    editFile.SubItems.Add(fs.LocalPath.GetFileName().ToString());
                    editFile.SubItems.Add(fs.LocalPath.Path.Remove(fs.LocalPath.Path.LastIndexOf(@"\")));
                    editFile.Tag = fs.LocalPath.Path;
                    listView2.Items.Add(editFile);
                }
            }

            listView3.CheckBoxes = true;
            if (delFiles != null)
            {
                missingText.Text += " [" + delFiles.Count + "]";
                foreach (P4.FileSpec fs in delFiles)
                {
                    ListViewItem deleteFile = new ListViewItem();
                    deleteFile.Checked = true;
                    deleteFile.SubItems.Add(fs.LocalPath.GetFileName().ToString());
                    deleteFile.SubItems.Add(fs.LocalPath.Path.Remove(fs.LocalPath.Path.LastIndexOf(@"\")));
                    deleteFile.Tag = fs.LocalPath.Path;
                    listView3.Items.Add(deleteFile);
                }
            }

            ItemsCB.Items.Add("New");
            ItemsCB.Items.Add("Default");
            if (changelists != null)
            {
                foreach (P4.Changelist cl in changelists)
                {
                    ItemsCB.Items.Add(cl.Id.ToString() + " - " + cl.Description);
                }
            }
            ItemsCB.SelectedIndex = 1;
        }
コード例 #8
0
 public NodeGlyphs(P4VsProviderService service, IVsHierarchy hier)
 {
     SccService = service;
     solHier    = hier;
 }
コード例 #9
0
 public ActiveChangeListCombo(P4VsProviderService service)
 {
     SccService = service;
     InitActiveChangeListComboChoicesMap();
 }