Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 public void Dispose()
 {
     m_onCompleted = null;
     m_job?.Dispose();
     m_job = null;
     ChipstarTracker.Remove(this);
 }
Exemplo n.º 2
0
        //=====================================
        //  関数
        //=====================================

        public LoadProcess(
            ILoadJob <T> job,
            Action <T> onCompleted,
            Action <ResultCode> onError = null
            )
        {
            m_onCompleted   = onCompleted;
            m_job           = job;
            m_job.OnSuccess = () =>
            {
                Content = m_job.Content;
                ChipstarUtils.OnceInvoke(ref m_onCompleted, Content);
                IsCompleted = true;
            };
            m_job.OnError = code =>
            {
                m_onCompleted = null;
                onError?.Invoke(code);
                IsError = true;
            };
            m_job.OnDisposed = () => this.DisposeIfNotNull();
            ChipstarTracker.Add(this);
        }