/// <summary> /// 数据刷新 /// </summary> /// <param name="folder"></param> public void RefleshSpaceData(BreadLine bread_Line) { try { //面包线是否为null if (bread_Line == null) { return; } if (bread_Line.Folder != null) { //等待提示 this.ShowTip(); this.listView.Items.Clear(); //获取文件夹 SPVirtualFolder folder = bread_Line.Folder; TimerJob.StartRun_Sync(new Action(() => { DataLoad_All(folder.Folders, folder.Files); })); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 获取信息失败 /// </summary> private void GetClientAppConfigFailedDealWidth() { try { this.Dispatcher.BeginInvoke(new Action(() => { if (this.loginWindow != null) { this.loginWindow.txtInitializtionColor.Foreground = new SolidColorBrush(Colors.Red); this.loginWindow.LoginEnviromentTip = "无法连接到服务器。。。"; #region 重置(先判断计时器是否已经在监测) if (CheckLoginInitCompleatetimer == null) { TimerJob.StartRun(new Action(() => { this.LoginEnviromentInit3(); }), 2500, out CheckLoginInitCompleatetimer); } #endregion } })); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 打开文件框并选择图片格式的文件进行甩屏操作 /// </summary> private void OpenFile() { try { OpenFileDialog dialog = new OpenFileDialog(); //打开选项对话框 dialog.Filter = "图片文件(*.jpg,*.jpeg,*.png,*.gif)|*.jpeg;*.gif;*.png;*.jpg;)"; //设置为多选 dialog.Multiselect = true; if (dialog.ShowDialog() == true) { var files = dialog.FileNames; foreach (var file in files) { tb.AddItem(new Conference.Control.DragView.DragTabItem() { Element = new Controls.Image() { Source = new BitmapImage(new Uri(file, UriKind.RelativeOrAbsolute)) } }); } TimerJob.StartRun(new Action(() => { //投影到大屏幕 this.CutToOtherClient(); })); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 修复会话 /// </summary> private void RepairConversationCallBack() { try { if (!string.IsNullOrEmpty(this.meetAddress)) { MainWindow.mainWindow.Topmost = true; TimerJob.StartRun(new Action(() => { //取消置顶 MainWindow.mainWindow.Topmost = false; }), 2000); LyncHelper.CloseAllConversation(new Action(() => { })); LyncHelper.JoinConversationByWebBrowser(this.meetAddress); //释放dns(改为自由获取),主窗体状态还原(非置顶) } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 改语音节点的UI渲染 /// </summary> public void AudioItemMesaure() { try { //先进行隐藏,UI动态加载完成之后再显示 this.Visibility = System.Windows.Visibility.Hidden; TimerJob.StartRun(new Action(() => { double iMMActualWidth = ConferenceAudio_View.conferenceAudio_View.GetIMMView_ActualWidth(); //设置IMM信息的宽度最大值 var conversationWidth = iMMActualWidth - 260; //不能为负值 if (conversationWidth > 0) { //最多约束宽度设置 this.txtAudio.MaxWidth = conversationWidth; } //显示该语音节点可见 this.Visibility = System.Windows.Visibility.Visible; })); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 图例点击 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ConferenceRoomItem_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { try { if (e.ClickCount == 2 && conferenceInformationEntityPC != null) { if (conferenceInformationEntityPC.BeginTime < DateTime.Now.AddMinutes(-30)) { ConferenceRoom_View.conferenceRoom_View.RoomCardInit(this, conferenceInformationEntityPC); } else { this.gridTip.Visibility = System.Windows.Visibility.Visible; TimerJob.StartRun(new Action(() => { this.gridTip.Visibility = System.Windows.Visibility.Collapsed; }), 1000); } } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 树视图加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ConferenceTreeView_Loaded(object sender, RoutedEventArgs e) { try { TimerJob.StartRun(new Action(() => { //初始化视图容器的宽度 this.ViewBoxWidth = this.borDiscussTheme.ActualWidth; //初始化视图容器的高度 this.ViewBoxHeigth = this.borDiscussTheme.ActualHeight; ///长加宽 var widthAddHeigth = this.ViewBoxWidth + this.ViewBoxHeigth; //设置视图缩放的宽度比例 this.constratParameterAboutWidth = this.ViewBoxWidth / widthAddHeigth; //设置视图缩放的高度比例 this.constratParameterAboutHeight = this.ViewBoxHeigth / widthAddHeigth; }), 1000); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 文本框编辑权限控制器(标题) /// </summary> public void TittleLimitControlCenter() { try { //一个节点对应一个计时器 if (TittleEditControlTimer == null) { TimerJob.StartRun(new Action(() => { foreach (var item in ConferenceAudioItemList) { //完毕敲键盘 if (!item.txtAudio.IsKeyboardFocused) { //编辑完毕 item.IsEditNow = false; } } }), 1000, out TittleEditControlTimer); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 附加到新窗体 /// </summary> /// <param name="handle"></param> public static void DockToNewParentWindow(IntPtr handle, Action<bool> callBack) { try { if (Constant.lyncClient != null && Constant.lyncClient.State == ClientState.SignedIn && LyncHelper.MainConversation != null && !LyncHelper.MainConversation.IsDocked) { if (LyncHelper.MainConversation != null) { if (LyncHelper.MainConversation.IsFullScreen) { //先退出全屏 LyncHelper.ExitFullScreen(); } TimerJob.StartRun(new Action(() => { if (!LyncHelper.MainConversation.IsDocked && LyncHelper.MainConversation.State == ConversationWindowState.Initialized) { LyncHelper.MainConversation.Dock(handle); LyncHelper.FullScreen(); callBack(true); } })); } } } catch (Exception ex) { LogManage.WriteLog(typeof(LyncHelper), ex); } finally { } }
private void DoTimer(ref Int64 startTick) { Int64 currentTick = DateTime.Now.Ticks; if (currentTick - startTick < MinimumIntervalTick) { return; } startTick = currentTick; TimerJob timer = JobScheduler.PopTimer(); if (timer == null) { return; } timer.OnTick(DateTime.Now.Ticks); if (timer.Finished == false) { JobScheduler.AddTimer(timer); } }
/// <summary> /// 自动登陆 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void LoginWindow_ContentRendered(object sender, EventArgs e) { try { //是否为自动登陆(私人模式启用) if (this.IsAutoLogin) { //是否自动登陆 DispatcherTimer timer = null; TimerJob.StartRun(new Action(() => { if (this.IsLogining == System.Windows.Visibility.Hidden) { //开始登陆 this.Login(); } else { timer.Stop(); } }), 50, out timer); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 点击选择自己填充静态实例 /// </summary> public void ConversationResourceItemPoint() { try { if (ConversationResourceItem.currentConversationResourceItem != null) { //将之前的会话卡片恢复为默认的背景色 ConversationResourceItem.currentConversationResourceItem.bor.Background = new SolidColorBrush(Colors.Transparent); } //点击选择自己填充静态实例 ConversationResourceItem.currentConversationResourceItem = this; //设置选择后的背景色 this.SetCardBackColor(); TimerJob.StartRun(new Action(() => { //资源属性刷新 //MainWindow.conversationResourceWindow.RefleshJustView(); }), 700); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
public void LoginButtonIsEnable() { try { if (!this.LoginPanelIsEnable) { DispatcherTimer timer = null; TimerJob.StartRun(new Action(() => { if (this.CanThrow) { this.LoginPanelIsEnable = true; timer.Stop(); } }), 800, out timer); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
private void buttonTaskStop_Click(object sender, EventArgs e) { //Выключил задачи TimerJob.Stop(); CurrentTask = 0; ModifyColor(); playSimpleSound(0); }
private void buttonTask3_Click(object sender, EventArgs e) { //Переключился на задачу №3 TimerJob.Start(); CurrentTask = 3; ModifyColor(); playSimpleSound(1); }
/// <summary> /// 弹出软键盘 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnkeyBoard_Click(object sender, RoutedEventArgs e) { try { //switch (mainPage.ViewSelectedItemEnum) //{ // case ViewSelectedItemEnum.Meet: // break; // case ViewSelectedItemEnum.Tree: // this.UsingTouchKeyBoard(); // break; // case ViewSelectedItemEnum.Space: // this.OpenTheTouchKeyBoard(); // break; // case ViewSelectedItemEnum.Resource: // this.OpenTheTouchKeyBoard(); // break; // case ViewSelectedItemEnum.IMM: // this.UsingTouchKeyBoard(); // break; // case ViewSelectedItemEnum.PersonNote: // this.OpenTheTouchKeyBoard(); // break; // case ViewSelectedItemEnum.MeetVote: // this.OpenTheTouchKeyBoard(); // break; // case ViewSelectedItemEnum.U_Disk: // break; // case ViewSelectedItemEnum.Meet_Change: // break; // case ViewSelectedItemEnum.Chair: // break; // case ViewSelectedItemEnum.Studiom: // break; // case ViewSelectedItemEnum.SystemSetting: // break; // case ViewSelectedItemEnum.Tool: // break; // default: // break; //} this.OpenTheTouchKeyBoard(); //使用计时器执行软键盘透明设置 TimerJob.StartRun(new Action(() => { //设置键盘透明度 this.TouchKeyBoardOpacitySetting(); }), 1000); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
public void UPloadMeetAddressAndCancelLock(bool successed) { try { #region 获取会议地址并上传到服务器 //只有会话初始化完毕才有的结果 DispatcherTimer lynTimer = null; TimerJob.StartRun(new Action(() => { if (LyncHelper.MainConversation != null && LyncHelper.MainConversation.Conversation.Properties.ContainsKey(ConversationProperty.ConferenceAccessInformation)) { ConferenceAccessInformation conferenceAccessInformation = (ConferenceAccessInformation)LyncHelper.MainConversation.Conversation.Properties[ConversationProperty.ConferenceAccessInformation]; if (!string.IsNullOrEmpty(conferenceAccessInformation.InternalUrl)) { //开启会话 ModelManage.ConferenceLyncConversation.FillConversation(Constant.ConferenceName, conferenceAccessInformation.InternalUrl, new Action <bool>((issuccessed) => { if (successed) { #region 允许其他成员进行会议查询并进行初始化 ModelManage.ConferenceLyncConversation.AllowConversationInit(Constant.ConferenceName, new Action <bool>((flg) => { })); #endregion } })); #region 释放dns(改为自由获取),主窗体状态还原(非置顶) TimerJob.StartRun(new Action(() => { //设置DNS NetWorkAdapter.SetNetworkAdapter(Constant.RouteIp); //取消置顶 MainWindow.mainWindow.Topmost = false; })); #endregion lynTimer.Stop(); } } }), 500, out lynTimer); #endregion } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// Starts the timer job. /// </summary> private void StartTimerJob() { timerJob = new TimerJob { StartTime = 0, MaxTime = timeLimit[currentLevel] }; timerHandle = timerJob.Schedule(); JobHandle.ScheduleBatchedJobs(); }
public ConferenceAudioItem() { try { //UI加载 InitializeComponent(); //设置当前上下文 this.DataContext = this; //当前为会议主持人可以进行节点删除 if (Constant.IsMeetingPresenter) { //删除按钮可用 this.DeleteEnable = true; } else { //删除按钮是不可用 this.DeleteEnable = false; } #region 注册事件 //播放 this.btnItemPlay.PreviewMouseLeftButtonDown += btnItemPlay_PreviewMouseLeftButtonDown; //删除 this.btnRemove.PreviewMouseLeftButtonDown += btnRemove_PreviewMouseLeftButtonDown; //语音转文字 this.btnAudioTransfer.Click += btnAudioTransfer_Click; //文本更改 this.txtAudio.TextChanged += txtAudio_TextChanged; #endregion this.Visibility = System.Windows.Visibility.Hidden; TimerJob.StartRun(new Action(() => { double iMMActualWidth = MainWindow.MainPageInstance.ConferenceAudio_View.GetIMMView_ActualWidth(); //设置IMM信息的宽度最大值 var conversationWidth = iMMActualWidth - 260; //不能为负值 if (conversationWidth > 0) { this.txtAudio.MaxWidth = conversationWidth; } this.Visibility = System.Windows.Visibility.Visible; })); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 上传图片 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void imgUPload(string UploadImg) { try { if (string.IsNullOrEmpty(UploadImg)) { return; } //生成一个ftp辅助类() FtpManage ftpHelper = new FtpManage(); //头像地址 string personImgUri = Constant.ConferenceFtpWebAddressFront + Constant.FtpServercePersonImgName; //删除文件 FtpManage.DeleteFile(personImgUri, Constant.FtpUserName, Constant.FtpPassword); //上传头像 ftpHelper.UploadFtp(UploadImg, Constant.LoginUserName + ".png", Constant.ConferenceFtpWebAddressFront + Constant.FtpServercePersonImgName, "/", Constant.FtpUserName, Constant.FtpPassword, delegate(long Length, double progress) { }, delegate(System.Exception error, bool result) { if (result) { //使用异步委托 this.Dispatcher.BeginInvoke(new Action(() => { try { //显示状态 this.txtUPloadTip.Visibility = System.Windows.Visibility.Visible; //过渡一端时间隐藏提示状态 TimerJob.StartRun(new Action(() => { this.txtUPloadTip.Visibility = System.Windows.Visibility.Collapsed; }), 2000); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } })); } }); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
protected override JobHandle OnUpdate(JobHandle inputDeps) { var job = new TimerJob { DeltaTime = Time.deltaTime, Entity = _group.Entity, Timer = _group.Timer, CommandBuffer = _timerSystemBarrier.CreateCommandBuffer(), }; return(job.Schedule(inputDeps)); }
/// <summary> /// 登陆 /// </summary> private void Login() { try { if (string.IsNullOrEmpty(this.txtUser.Text)) { this.CodeOrUserIsNull("请输入用户名"); return; } if (string.IsNullOrEmpty(this.pwd.Password)) { this.CodeOrUserIsNull("请输入密码"); return; } TimerJob.StartRun(new Action(() => { //显示登陆提示(旋转) this.IsLogining = vy.Visible; //登陆编辑区域设置为不可用 this.LoginPanelIsEnable = false; }), 100); // 登陆前先进行判断(是否连接网络,是否能够连接服务器) bool networkIsOk = this.Check_NetWorkEnviroment(); if (!networkIsOk) { TimerJob.StartRun(new Action(() => { //显示登陆提示(旋转) this.IsLogining = vy.Hidden; //登陆编辑区域设置为不可用 this.LoginPanelIsEnable = true; }), 100); return; } //判断用户是否在线 this.Check_UserIsOnline(); } catch (Exception ex) { //出现异常,关闭登陆提示 this.IsLogining = vy.Collapsed; //将登陆编辑区域恢复为可用状态 this.LoginPanelIsEnable = true; LogManage.WriteLog(this.GetType(), ex); } finally { } }
public ConferenceRoomItem(ConferenceInformationEntityPC conferenceInformationEntity) : this() { try { //绑定当前上下文 this.DataContext = conferenceInformationEntity; ConferenceInformationEntity = conferenceInformationEntity; if (conferenceInformationEntity.EndTime > DateTime.Now) { this.borImg.Background = Application.Current.Resources["brush_Room2"] as ImageBrush; } else { this.borImg.Background = Application.Current.Resources["brush_Room"] as ImageBrush; } //鼠标进入启动动画 this.MouseEnter += ConferenceRoomItem_MouseEnter; //鼠标移除启动反向动画 this.MouseLeave += ConferenceRoomItem_MouseLeave; #region 注册事件 //图例点击 this.MouseLeftButtonDown += ConferenceRoomItem_MouseLeftButtonDown; #endregion DispatcherTimer timer = null; TimerJob.StartRun(new Action(() => { if (Constant.DicParticipant.Count > 0) { //参会人绑定 if (conferenceInformationEntity.ApplyPeople != null && Constant.DicParticipant.ContainsKey(conferenceInformationEntity.ApplyPeople)) { conferenceInformationEntity.ApplyPeople = Constant.DicParticipant[conferenceInformationEntity.ApplyPeople]; } timer.Stop(); } }), 600, out timer); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 消息提示(闪烁) /// </summary> public void IMMReceivMessageFlash() { try { //停止计时器工作 if (this.IMMFlashTimer != null) { this.IMMFlashTimer.Stop(); } //闪烁次数 int flashCount = 0; TimerJob.StartRun(new Action(() => { //闪烁次数递增 flashCount++; //标准模式 if (!this.isSimpleModel) { //显示状态转为隐藏 this.ShowOrDisplay(this.borImmTip); if (flashCount >= 8) { this.borImmTip.Visibility = vy.Visible; //停止计时器工作 this.IMMFlashTimer.Stop(); } } else { //显示状态转为隐藏 this.ShowOrDisplay(this.borImmTip2); if (flashCount >= 8) { this.borImmTip2.Visibility = vy.Visible; //停止计时器工作 this.IMMFlashTimer.Stop(); } } }), 500, out this.IMMFlashTimer); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
public void Add(TimerJob job) { if (Last is null) { First = Last = job; } else { Last.Next = job; job.Previous = Last; job.Next = null; Last = job; } }
/// <summary> /// 数据刷新 /// </summary> /// <param name="folder"></param> public void RefleshSpaceData(BreadLine bread_Line) { try { //面包线是否为null if (bread_Line == null) { return; } if (bread_Line.Folder != null) { //等待提示 this.ShowTip(); TimerJob.StartRun(new Action(() => { //清除书架 this.Items_Clear(); //获取文件夹 SP.Folder folder = bread_Line.Folder; ThreadPool.QueueUserWorkItem((o) => { try { //加载当前会议文件夹 SpaceCodeEnterEntity.ClientContextManage.LoadMethod(folder.Folders); //获取当会议文件夹 List <SP.Folder> folderList = folder.Folders.ToList <SP.Folder>(); //加载当前所有文件 SpaceCodeEnterEntity.ClientContextManage.LoadMethod(folder.Files); //获取当前所有文件 List <SP.File> fileList = folder.Files.ToList <SP.File>(); DataLoad_All(folderList, fileList); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }); })); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
static void Main(string[] args) { PublishTest publishTest = new PublishTest(); // publishTest.RunEachPush(); // publishTest.RunOncePush(); // publishTest.RunDelayTimePush(); TimerJob.SetAction(() => { Console.WriteLine("hha" + DateTime.Now); }); TimerJob.Start(); Console.ReadLine(); }
/// <summary> /// 键盘弹出 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void KeyBoard_UP(object sender, TouchEventArgs e) { try { TimerJob.StartRun(new Action(() => { //显示触摸键盘 TouchKeyBoard.ShowInputPanel(); }), 100); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 拖动完成事件 /// </summary> void tb_DragViewCompleateEvent() { try { TimerJob.StartRun(new Action(() => { //投影到大屏幕 this.CutToOtherClient(); })); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 会话加载完成事件 /// </summary> void ConversationAddCompleateEvent() { try { //取消置顶 TimerJob.StartRun(new Action(() => { MainWindow.mainWindow.Topmost = false; }), 1000); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }