コード例 #1
0
        public void Reset()
        {
            mOfflineRequestQueue.Clear();

            lock ( noteLock )
            {
                currentNote = null;
            }
        }
コード例 #2
0
        private async void btnDownload_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            OfflineDataInfo d = lvOfflineDataList.SelectedItem as OfflineDataInfo;

            if (d == null)
            {
                await ShowMessage("Select Offline Data Item");
            }

            _controller?.RequestOfflineData(d.Section, d.Owner, d.Note);
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: chyccs/Windows-SDK2.0
        private void button1_Click(object sender, EventArgs e)
        {
            if (lbOfflineData.SelectedItem == null)
            {
                return;
            }
            OfflineDataInfo data = lbOfflineData.SelectedItem as OfflineDataInfo;

            Request(
                delegate { mPenCommV1.ReqRemoveOfflineData(data.Section, data.Owner); },
                delegate { mPenCommV2.ReqRemoveOfflineData(data.Section, data.Owner, new int[] { data.Note }); });
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: chyccs/Windows-SDK2.0
        private void button3_Click(object sender, EventArgs e)
        {
            if (lbOfflineData.SelectedItem == null)
            {
                return;
            }
            OfflineDataInfo data = lbOfflineData.SelectedItem as OfflineDataInfo;

            Request(
                delegate { mPenCommV1.ReqOfflineData(data); },
                delegate { mPenCommV2.ReqOfflineData(data.Section, data.Owner, data.Note, false, data.Pages); });
        }
コード例 #5
0
        /// <summary>
        /// Requests the transmission of data
        /// </summary>
        /// <param name="note">A OfflineDataInfo that specifies the information for the offline data.</param>
        /// <returns>true if the request is accepted; otherwise, false.</returns>
        public bool ReqOfflineData(OfflineDataInfo note)
        {
            ulong freeCapacity = 0;

            if (GetAvailableCapacity(ref freeCapacity))
            {
                if (freeCapacity < 50)                 // 50MB
                {
                    return(false);
                }
            }

            mOfflineworker.Put(note);

            return(true);
        }
コード例 #6
0
        private void RequestNote()
        {
            while (isRun)
            {
                if (mOfflineRequestQueue.Count() > 0)
                {
                    lock ( noteLock )
                    {
                        currentNote = mOfflineRequestQueue.Peek();

                        System.Console.WriteLine("[OfflineWorker] start download offline note => sectionId : " + currentNote.Section + ", ownerId : " + currentNote.Owner + ", noteId : " + currentNote.Note);

                        // 데이터 전송을 요청한다.
                        mHandler.onRequestDownloadOfflineData(currentNote.Section, currentNote.Owner, currentNote.Note);
                    }
                }

                {
                    lockHandleRequest.WaitOne();
                }
            }
        }
コード例 #7
0
        public void onFinishDownload()
        {
            if (currentNote == null)
            {
                return;
            }

            if (currentNote.Section != 4)
            {
                mHandler.onRequestRemoveOfflineData(4, currentNote.Note);
            }

            lock ( noteLock )
            {
                currentNote = null;
            }

            mOfflineRequestQueue.Dequeue();

            lock ( lockHandleRequest )
            {
                lockHandleRequest.Set();
            }
        }
        /// <summary>
        /// Requests the transmission of data
        /// </summary>
        /// <param name="note">A OfflineDataInfo that specifies the information for the offline data.</param>
        /// <returns>true if the request is accepted; otherwise, false.</returns>
        public bool ReqOfflineData(OfflineDataInfo note)
        {
            mOfflineworker.Put(note);

            return(true);
        }
コード例 #9
0
 public void Put(OfflineDataInfo note)
 {
     Put(new OfflineDataInfo[] { note });
 }