Пример #1
0
        /// <summary>Gets information about the specified target</summary>
        public bool GetInfo(SvnTarget target, out SvnInfoEventArgs info)
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            var results = new InfoItemCollection <SvnInfoEventArgs>();

            try
            {
                return(Info(target, new SvnInfoArgs(), results.Handler));
            }
            finally
            {
                info = results.Count > 0 ? results[0] : null;
            }
        }
Пример #2
0
        static unsafe IntPtr svn_info_receiver(IntPtr baton, sbyte *path, IntPtr info_ptr, IntPtr pool)
        {
            var client = AprBaton <SvnClient> .Get(baton);

            using var thePool = new AprPool(pool, false);

            if (!(client.CurrentCommandArgs is SvnInfoArgs args))
            {
                return(IntPtr.Zero);
            }

            var info = svn_client_info2_t.__CreateInstance(info_ptr);
            var e    = new SvnInfoEventArgs(SvnBase.Utf8_PathPtrToString(path, thePool), info, thePool);

            try
            {
                args.OnInfo(e);

                if (e.Cancel)
                {
                    return(svn_error.svn_error_create((int)SvnErrorCode.SVN_ERR_CEASE_INVOCATION, null, "Info receiver canceled operation").__Instance);
                }
                else
                {
                    return(IntPtr.Zero);
                }
            }
            catch (Exception ex)
            {
                return(SvnException.CreateExceptionSvnError("Info receiver", ex).__Instance);
            }
            finally
            {
                e.Detach(false);
            }
        }
Пример #3
0
 protected internal void OnInfo(SvnInfoEventArgs e)
 {
     Info?.Invoke(this, e);
 }