コード例 #1
0
        /// <summary>
        /// Executes a Perforce command in non-tagged mode.
        /// </summary>
        /// <param name="Command">The command.</param>
        /// <param name="Args">The args.</param>
        /// <returns></returns>
        public P4UnParsedRecordSet RunUnParsed(string Command, params string[] Args)
        {
            P4UnParsedRecordSet r = new P4UnParsedRecordSet();

            P4BaseRecordSet.OnPromptEventHandler handler = new P4BaseRecordSet.OnPromptEventHandler(this.HandleOnPrompt);
            r.OnPrompt += handler;
            EstablishConnection(false);
            RunIt(Command, Args, r.ResultClientUser);
            r.OnPrompt -= handler;

            if (((_exceptionLevel == P4ExceptionLevels.ExceptionOnBothErrorsAndWarnings ||
                  _exceptionLevel == P4ExceptionLevels.NoExceptionOnWarnings) &&
                 r.HasErrors())
                ||
                (_exceptionLevel == P4ExceptionLevels.ExceptionOnBothErrorsAndWarnings &&
                 r.HasWarnings())
                )
            {
                throw new RunUnParsedException(r);
            }

            // always throw a defered exception (means something went WAY wrong)
            if (r.ResultClientUser.DeferedException != null)
            {
                throw r.ResultClientUser.DeferedException;
            }

            return(r);
        }
コード例 #2
0
        /// <summary>
        /// Executes a Perforce command in non-tagged mode.
        /// </summary>
        /// <param name="Command">The command.</param>
        /// <param name="Args">The args.</param>
        /// <returns></returns>
        public P4UnParsedRecordSet RunUnParsed(string Command, params string[] Args)
        {
            P4UnParsedRecordSet r  = new P4UnParsedRecordSet();
            P4RecordsetCallback cb = new P4RecordsetCallback(r);

            P4BaseRecordSet.OnPromptEventHandler handler = new P4BaseRecordSet.OnPromptEventHandler(this.HandleOnPrompt);
            r.OnPrompt += handler;
            RunCallbackUnparsed(cb, Command, Args);
            r.OnPrompt -= handler;

            if (((_exceptionLevel == P4ExceptionLevels.ExceptionOnBothErrorsAndWarnings ||
                  _exceptionLevel == P4ExceptionLevels.NoExceptionOnWarnings) &&
                 r.HasErrors())
                ||
                (_exceptionLevel == P4ExceptionLevels.ExceptionOnBothErrorsAndWarnings &&
                 r.HasWarnings())
                )
            {
                throw new RunUnParsedException(r);
            }

            return(r);
        }
コード例 #3
0
ファイル: P4Connection.cs プロジェクト: orecht/P4.net
        /// <summary>
        /// Executes a Perforce command in non-tagged mode.
        /// </summary>
        /// <param name="Command">The command.</param>
        /// <param name="Args">The args.</param>
        /// <returns></returns>
        public P4UnParsedRecordSet RunUnParsed(string Command, params string[] Args)
        {
            P4UnParsedRecordSet r = new P4UnParsedRecordSet();
            P4RecordsetCallback cb = new P4RecordsetCallback(r);
            P4BaseRecordSet.OnPromptEventHandler handler = new P4BaseRecordSet.OnPromptEventHandler(this.HandleOnPrompt);
            r.OnPrompt += handler;
            RunCallbackUnparsed(cb, Command, Args);
            r.OnPrompt -= handler;

            if (((_exceptionLevel == P4ExceptionLevels.ExceptionOnBothErrorsAndWarnings
                 || _exceptionLevel == P4ExceptionLevels.NoExceptionOnWarnings)
                 && r.HasErrors())
                ||
                  (_exceptionLevel == P4ExceptionLevels.ExceptionOnBothErrorsAndWarnings
                   && r.HasWarnings())
                )
            {
                throw new RunUnParsedException(r);
            }

            return r;
        }