Esempio n. 1
0
 private void Runner_OnStopped(object sender, StopEventArgs e)
 {
     Invoke(new MethodInvoker(delegate()
     {
         listData.Items.Add("Stoped!"); //displays the stop message when the runner stop
     }));
 }
Esempio n. 2
0
 void DoStop(object sender, StopEventArgs e)
 {
     /*
      * if (this.Channel != null)
      *  this.Channel.Cancel();
      * */
 }
Esempio n. 3
0
        /*
         * // 获得缺省帐户信息。回调函数,用于resdircontrol
         * // return:
         * //		2	already login succeed
         * //		1	dialog return OK
         * //		0	dialog return Cancel
         * //		-1	other error
         * public int AskAccountInfo(DtlpChannel channel,
         *  string strPath,
         *  out IWin32Window owner,	// 如果需要出现对话框,这里返回对话框的宿主Form
         *  out string strUserName,
         *  out string strPassword)
         * {
         *  owner = null;
         *  strUserName = "";
         *  strPassword = "";
         *
         *  LoginDlg dlg = new LoginDlg();
         *
         *  AccountItem item = (AccountItem)AccountTable[strPath];
         *  if (item == null)
         *  {
         *      item = new AccountItem();
         *      AccountTable.Add(strPath, item);
         *
         *      // 从配置文件中得到缺省账户
         *      item.UserName = MainForm.applicationInfo.GetString(
         *          "preference",
         *          "defaultUserName",
         *          "public");
         *      item.Password = MainForm.applicationInfo.GetString(
         *          "preference",
         *          "defaultPassword",
         *          "");
         *
         *
         *  }
         *
         *  dlg.textBox_serverAddr.Text = strPath;
         *  dlg.textBox_userName.Text = item.UserName;
         *  dlg.textBox_password.Text = item.Password;
         *
         *  // 先登录一次再说
         *  {
         *      byte[] baResult = null;
         *      int nRet = channel.API_ChDir(dlg.textBox_userName.Text,
         *          dlg.textBox_password.Text,
         *          strPath,
         *          out baResult);
         *
         *      // 登录成功
         *      if (nRet > 0)
         *          return 2;
         *  }
         *
         *
         *
         *
         *  dlg.StartPosition = FormStartPosition.CenterScreen;
         *  dlg.ShowDialog(this);
         *
         *  if (dlg.DialogResult == DialogResult.OK)
         *  {
         *      item.UserName = dlg.textBox_userName.Text;
         *      item.Password = dlg.textBox_password.Text;
         *
         *      strUserName = dlg.textBox_userName.Text;
         *      strPassword = dlg.textBox_password.Text;
         *      owner = this;
         *      return 1;
         *  }
         *
         *  return 0;
         * }
         * */

        void DoStop(object sender, StopEventArgs e)
        {
            if (this.Channel != null)
            {
                this.Channel.Cancel();
            }
        }
Esempio n. 4
0
        private void stop_StatusChanged(StopEventArgs args)
        {
            ATSStop atsStop = args.Stop as ATSStop;

            if (((StopBase)atsStop).Status != null)
            {
                this.activeStops[((StopBase)atsStop).Instrument].Remove(atsStop);
                // ISSUE: method pointer
                atsStop.StatusChanged -= new StopEventHandler(this.stop_StatusChanged);
            }
            if (((StopBase)atsStop).Status != FreeQuant.Trading.StopStatus.Executed)
            {
                return;
            }
            try
            {
                Strategy strategy = (Strategy)null;
                if (!this.strategies.TryGetValue(((StopBase)atsStop).Instrument, out strategy))
                {
                    return;
                }
                strategy.OnStopExecuted(Map.FQ_OQ_Stop[(object)atsStop] as OpenQuant.API.Stop);
            }
            catch (Exception ex)
            {
                this.EmitError(ex);
            }
        }
Esempio n. 5
0
        /*
         * // 在一个节点下级插入"loading...",以便出现+号
         * static void SetLoading(TreeNode node)
         * {
         *  // 新node
         *  TreeNode nodeNew = new TreeNode("loading...", ResTree.RESTYPE_LOADING, ResTree.RESTYPE_LOADING);
         *
         *  node.Nodes.Clear();
         *  node.Nodes.Add(nodeNew);
         * }
         *
         * // 下级是否包含loading...?
         * static bool IsLoading(TreeNode node)
         * {
         *  if (node.Nodes.Count == 0)
         *      return false;
         *
         *  if (node.Nodes[0].Text == "loading...")
         *      return true;
         *
         *  return false;
         * }
         */

        // 回调函数
        void DoStop(object sender, StopEventArgs e)
        {
            if (this.channel != null)
            {
                this.channel.Abort();
            }
        }
Esempio n. 6
0
 private void MediaPlayer1_OnStop(object sender, StopEventArgs e)
 {
     Invoke((Action)(() =>
     {
         tbTimeline.Value = 0;
     }));
 }
Esempio n. 7
0
        private async void _player_OnStop(object sender, StopEventArgs e)
        {
            await _player.CloseAsync();

            tmPosition.Stop();

            videoView1.Invalidate();
            MessageBox.Show("Playback complete.");
        }
Esempio n. 8
0
        void DoGcatStop(object sender, StopEventArgs e)
        {
#if OLD_CODE
            if (this.GcatChannel != null)
            {
                this.GcatChannel.Abort();
            }
#endif
        }
Esempio n. 9
0
        void DoStop(object sender, StopEventArgs e)
        {
#if NO
            if (Program.MainForm.Channel != null)
            {
                Program.MainForm.Channel.Abort();
            }
#endif
        }
        private void Player_OnStop(object sender, StopEventArgs e)
        {
            _tmPosition.Stop();

            Dispatcher.UIThread.InvokeAsync(() =>
            {
                VideoView1.Refresh();
                //ShowMessage("Playback complete.");
            });
        }
Esempio n. 11
0
        static int m_nLockTimeout = 5000;	// 5000=5秒

        internal void DoStop(object sender, StopEventArgs e)
        {

#if NO
            if (this.Channel != null && this.Channel.Channel != null)
                this.Channel.Channel.Abort();
#endif
            if (this.Container != null
                && this.Container._summaryChannel != null
                && this.Container._summaryChannel.Channel != null)
                this.Container._summaryChannel.Channel.Abort();
        }
Esempio n. 12
0
        private void VideoEdit1_OnStop(object sender, StopEventArgs e)
        {
            Invoke((Action)(() => { ProgressBar1.Value = 0; }));

            if (e.Successful)
            {
                MessageBox.Show(this, "Completed successfully", string.Empty, MessageBoxButtons.OK);
            }
            else
            {
                MessageBox.Show(this, "Stopped with error", string.Empty, MessageBoxButtons.OK);
            }
        }
Esempio n. 13
0
        static int m_nLockTimeout   = 5000;     // 5000=5秒

        internal void DoStop(object sender, StopEventArgs e)
        {
#if NO
            if (this.Channel != null && this.Channel.Channel != null)
            {
                this.Channel.Channel.Abort();
            }
#endif
            if (this.Container != null &&
                this.Container._summaryChannel != null &&
                this.Container._summaryChannel.Channel != null)
            {
                this.Container._summaryChannel.Channel.Abort();
            }
        }
Esempio n. 14
0
File: MyForm.cs Progetto: gvhung/dp2
        internal void DoStop(object sender, StopEventArgs e)
        {
            // 兼容旧风格
            if (this.Channel != null)
            {
                this.Channel.Abort();
            }

            foreach (LibraryChannel channel in _channelList)
            {
                if (channel != null)
                {
                    channel.Abort();
                }
            }
        }
Esempio n. 15
0
        private void VideoEdit1_OnStop(object sender, StopEventArgs e)
        {
            Invoke((Action)(() =>
            {
                ProgressBar1.Value = 0;
                lbFiles.Items.Clear();
            }));

            if (e.Successful)
            {
                MessageBox.Show("Completed successfully", string.Empty, MessageBoxButtons.OK);
            }
            else
            {
                MessageBox.Show("Stopped with error", string.Empty, MessageBoxButtons.OK);
            }

            VideoEdit1.Input_Clear_List();

            VideoEdit1.Video_Transition_Clear();
        }
Esempio n. 16
0
 void DoStop(object sender, StopEventArgs e)
 {
     if (this.DtlpChannel != null)
         this.DtlpChannel.Cancel();
 }
Esempio n. 17
0
 void new_stop_OnStop(object sender, StopEventArgs e)
 {
     if (this.m_gcatClient != null)
     {
         this.m_gcatClient.Abort();
     }
 }
Esempio n. 18
0
 protected override void OnStopEvent(object sender, StopEventArgs e)
 {
     base.OnStopEvent(sender, e);
 }
Esempio n. 19
0
 // 目录检索停止按钮被触发
 void m_stopDir_OnStop(object sender, StopEventArgs e)
 {
     lock (this)
     {
         /*
         for (int i = 0; i < this.m_stops.Count; i++)
         {
             Stop stop = this.m_stops[i];
             if (stop.State == 0)
                 stop.DoStop(false);
         }*/
         StopDirSearchStops(false);
     }
 }
Esempio n. 20
0
 void DoStop(object sender, StopEventArgs e)
 {
     if (this.Channel != null)
         this.Channel.Abort();
 }
Esempio n. 21
0
 void DoStop(object sender, StopEventArgs e)
 {
 }
Esempio n. 22
0
 private void MediaPlayer1_OnStop(object sender, StopEventArgs e)
 {
     BeginInvoke(new StopDelegate(StopDelegateMethod), null);
 }
Esempio n. 23
0
 private void stop_StatusChanged(StopEventArgs args)
 {
 }
Esempio n. 24
0
        void DoNewStop(object sender, StopEventArgs e)
        {
            Stop current_stop = (Stop)sender;
            if (current_stop == null)
                return;
            DtlpChannel channel = (DtlpChannel)current_stop.Tag;
            if (channel == null)
                return;

            channel.Cancel();
        }
Esempio n. 25
0
 protected override void OnStopEvent(object sender, StopEventArgs e)
 {
     base.OnStopEvent(sender, e);
 }
Esempio n. 26
0
 public void StopShowMessage(object sender, StopEventArgs e)
 {
     MessageBox.Show("Download Stops, Final Percentage is " + e.percent);
 }
Esempio n. 27
0
        new void DoStop(object sender, StopEventArgs e)
        {
            if (this.Channel != null)
                this.Channel.Abort();

            if (this._channels != null)
            {
                lock (this._channels)
                {
                    foreach (LibraryChannel channel in this._channels)
                    {
                        if (channel != null)
                            channel.Abort();
                    }
                }
            }
        }
Esempio n. 28
0
 void DoStop(object sender, StopEventArgs e)
 {
     /*
     if (this.Channel != null)
         this.Channel.Cancel();
      * */
 }
Esempio n. 29
0
 void DoStop(object sender, StopEventArgs e)
 {
     if (this.webClient != null)
         this.webClient.CancelAsync();
 }
Esempio n. 30
0
 private void _mp3_Stopped(object sender, StopEventArgs e)
 {
     if (e.StopCase != StopEventArgs.StopCases.Finished) return;
     Mp3File nextFile = _mp3List.ElementAtOrDefault(_mp3List.IndexOf(_mp3) + 1);
     if (nextFile != null)
     {
         _mp3 = nextFile;
         PlaylistListBox.SelectedItem = _mp3;
         PlayTrack();
     }
 }
Esempio n. 31
0
 private void MediaPlayer1_OnStop(object sender, StopEventArgs e)
 {
     tbTimeline.Value = 0;
 }
Esempio n. 32
0
        void DoStop(object sender, StopEventArgs e)
        {
#if NO
            if (this.MainForm.Channel != null)
                this.MainForm.Channel.Abort();
#endif
        }
Esempio n. 33
0
		private void stop_StatusChanged(StopEventArgs args)
		{
		}
Esempio n. 34
0
        internal void DoStop(object sender, StopEventArgs e)
        {
            // 兼容旧风格
            if (this.Channel != null)
                this.Channel.Abort();

            foreach (LibraryChannel channel in _channelList)
            {
                if (channel != null)
                    channel.Abort();
            }
        }
Esempio n. 35
0
 void DoStopPrint(object sender, StopEventArgs e)
 {
 }
Esempio n. 36
0
        internal void DoStop(object sender, StopEventArgs e)
        {
            if (this._channel != null)
                this._channel.Abort();
#if NO
            if (this.Channel != null)
                this.Channel.Abort();
#endif
        }
Esempio n. 37
0
        // 停止,被StopManager调
        // locks: 写锁定
        // parameters:
        //      bHalfStop   是否为一半中断。所谓一般中断,就是不触发Stop事件,而只修改Stop状态。
        public void DoStop(object sender = null)
        {
            this.m_stoplock.AcquireWriterLock(Stop.m_nLockTimeout);
            try
            {
                bool bHalfStop = false;

                if ((this.Style & StopStyle.EnableHalfStop) != 0
                    && this.nStop == 0)
                {
                    bHalfStop = true;
                }

                if (bHalfStop == false)
                {
                    if (this.OnStop != null)
                    {
                        // OnStop()是在已经锁定的情况下调用的
                        StopEventArgs e = new StopEventArgs();
                        this.OnStop(sender == null ? this : sender, e);
                    }
                }

                nStop = 1;
            }
            finally
            {
                this.m_stoplock.ReleaseWriterLock();
            }
        }
Esempio n. 38
0
 // 停止当前的一个Z连接
 void DoStop(object sender, StopEventArgs e)
 {
     /*
     if (this.ZChannel.Connected == true)
     {
         CloseConnection();
     }
     else if (this.ZChannel != null)
     {
         // 如果处在没有连接的状态
         this.ZChannel.Stop();
     }
      * */
     ZConnection connection = this.FindCurrentZConnection();
     if (connection != null)
     {
         connection.DoStop();
     }
 }
Esempio n. 39
0
        internal new void DoStop(object sender, StopEventArgs e)
        {
            if (this.Channel != null)
                this.Channel.Abort();
#if NO
            if (sender == this.browseWindow)
                this._browseWindowSelected = true;
#endif
        }
Esempio n. 40
0
 void DoStop(object sender, StopEventArgs e)
 {
 }