コード例 #1
0
        public void AddBackendEvent(BackendActionType action, BackendEventType type, string path, long size)
        {
            if (m_parent != null)
            {
                m_parent.AddBackendEvent(action, type, path, size);
            }
            else
            {
                if (type == BackendEventType.Started)
                {
                    this.BackendProgressUpdater.StartAction(action, path, size);
                }

                Logging.Log.WriteMessage(string.Format("Backend event: {0} - {1}: {2} ({3})", action, type, path, size <= 0 ? "" : Library.Utility.Utility.FormatSizeString(size)), Duplicati.Library.Logging.LogMessageType.Information);

                if (MessageSink != null)
                {
                    MessageSink.BackendEvent(action, type, path, size);
                }
            }
        }
コード例 #2
0
        public void AddBackendEvent(BackendActionType action, BackendEventType type, string path, long size)
        {
            if (m_parent != null)
            {
                m_parent.AddBackendEvent(action, type, path, size);
            }
            else
            {
                lock (Logging.Log.Lock)
                {
                    if (m_is_reporting)
                    {
                        return;
                    }

                    try
                    {
                        m_is_reporting = true;
                        if (type == BackendEventType.Started)
                        {
                            this.BackendProgressUpdater.StartAction(action, path, size);
                        }

                        Logging.Log.WriteInformationMessage(LOGTAG, "BackendEvent", "Backend event: {0} - {1}: {2} ({3})", action, type, path, size <= 0 ? "" : Library.Utility.Utility.FormatSizeString(size));

                        if (MessageSink != null)
                        {
                            MessageSink.BackendEvent(action, type, path, size);
                        }
                    }
                    finally
                    {
                        m_is_reporting = false;
                    }
                }
            }
        }