protected override void OnLinkClicked(LinkLabelLinkClickedEventArgs e) { base.OnLinkClicked(e); fp = new FormPopup(this); fp.Show(); fp.FormClosed += new FormClosedEventHandler(fp_FormClosed); }
private void Net_socket_client_AcceptString(HuTcpState object1, string object2) { //接收到服务器发来的字符串数据 string head_code = object2.Substring(0, 4); if (head_code == CommonHeadCode.MultiNetHeadCode.弹窗消息) { if (IsHandleCreated) { Invoke(new Action(() => { FormPopup fpp = new FormPopup(object2.Substring(4), Color.DodgerBlue, 10000); fpp.Show(); })); } } else if (head_code == CommonHeadCode.MultiNetHeadCode.所有客户端在线信息) { if (IsHandleCreated) { Invoke(new Action(() => { listBox1.DataSource = object2.Substring(4).Split('#'); })); } } else if (head_code == CommonHeadCode.MultiNetHeadCode.关闭所有客户端) { if (IsHandleCreated) { Invoke(new Action(() => { Close(); })); } } else if (head_code == CommonHeadCode.SimplifyHeadCode.更新公告) { //此处应用到了同步类的指令头 if (IsHandleCreated) { Invoke(new Action(() => { UserClient.Announcement = object2.Substring(4); label_Announcement.Text = object2.Substring(4); FormPopup fpp = new FormPopup(object2.Substring(4), Color.DodgerBlue, 10000); fpp.Show(); })); } } else if (head_code == CommonHeadCode.MultiNetHeadCode.时间推送) { UserClient.DateTimeServer = Convert.ToDateTime(object2.Substring(4)); } }
public Statistics() { statisticsPage = new ETD.CustomObjects.PopupForms.Statistics(); setNumberOfInterventions(); setAverageResponseTime(); setAverageInterventionDuration(); setInterventionsPerTeam(); setNumberOfInterventionsPerClassification(); statisticsPage.Label_ongoingInterventions.Content = numberOfOngoingInterventions.ToString(); statisticsPage.Label_completedInterventions.Content = numberOfCompletedInterventions.ToString(); statisticsPage.Label_avgResponseTime.Content = averageResponseTime.ToString().Substring(0, 8); statisticsPage.Label_avgDurationTime.Content = averageDuration.ToString().Substring(0, 8); FormPopup statisticsForm = new FormPopup(statisticsPage); }
public MainWindow() { InitializeComponent(); //only attach SelectionChanged event here to avoid the culture being updated twice ComboBox_Languages.SelectedItem = Properties.Settings.Default.DefaultCulture.NativeName; this.ComboBox_Languages.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ComboBox_Languages_SelectionChanged); FormPopup.RegisterMainWindow(this);//Register main window as the master window, used for displaying popups followupSection = new FollowUpSectionForm(); shiftSection = new ShiftsSection(); mapModificationSection = new AdditionalInfoPage(this); teamsSection = new TeamsSectionPage(this); mapSection = new MapSectionPage(this, mapModificationSection); interventionsSection = new InterventionSectionPage(this); previousWidth = MapSection.ActualWidth; previousHeight = MapSection.ActualHeight; //Populating the Map modification section Frame AIFrame = new Frame(); AIFrame.Content = mapModificationSection; AIPSection.Child = AIFrame; //Populating the Teams section Frame teamsFrame = new Frame(); teamsFrame.Content = teamsSection; TeamsSection.Child = teamsFrame; //Populating the Map section Frame mapFrame = new Frame(); mapFrame.Content = mapSection; MapSection.Child = mapFrame; //Populating the Interventions section Frame interventionsFrame = new Frame(); interventionsFrame.Content = interventionsSection; InterventionsSection.Child = interventionsFrame; //Starting GPS Services tasks GPSServices.StartServices(this); }
/// <summary> /// 接收到服务器的字节数据的回调方法 /// </summary> /// <param name="session">网络连接对象</param> /// <param name="customer">用户自定义的指令头,用来区分数据用途</param> /// <param name="data">数据</param> private void Net_socket_client_AcceptString(AppSession session, NetHandle customer, string data) { if (customer == CommonHeadCode.MultiNetHeadCode.弹窗新消息) { if (IsHandleCreated) { Invoke(new Action(() => { FormPopup fpp = new FormPopup(data, Color.DodgerBlue, 10000); fpp.Show(); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.总在线信息) { //if (IsHandleCreated) Invoke(new Action(() => //{ // // listBox1.DataSource = data.Split('#'); // NetAccount[] accounts = JArray.Parse(data).ToObject<NetAccount[]>(); // netClientOnline1.SetOnlineRender(accounts); //})); } else if (customer == CommonHeadCode.MultiNetHeadCode.关闭客户端) { if (IsHandleCreated) { Invoke(new Action(() => { Close(); })); } } else if (customer == CommonHeadCode.SimplifyHeadCode.更新公告) { //此处应用到了同步类的指令头 if (IsHandleCreated) { Invoke(new Action(() => { UserClient.Announcement = data; label_Announcement.Text = data; FormPopup fpp = new FormPopup(data, Color.DodgerBlue, 10000); fpp.Show(); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.初始化数据) { //收到服务器的数据 JObject json = JObject.Parse(data); UserClient.DateTimeServer = json["Time"].ToObject <DateTime>(); List <string> chats = JArray.Parse(json["chats"].ToString()).ToObject <List <string> >(); StringBuilder sb = new StringBuilder(); chats.ForEach(m => { sb.Append(m + Environment.NewLine); }); if (IsHandleCreated) { Invoke(new Action(() => { toolStripStatusLabel_time.Text = UserClient.DateTimeServer.ToString("yyyy-MM-dd HH:mm:ss"); label_file_count.Text = json["FileCount"].ToObject <int>().ToString(); UIControls_Chat.AddChatsHistory(sb.ToString()); UserClient.LogNet?.WriteDebug("Online Clients : " + json["ClientsOnline"].ToString()); NetAccount[] accounts = JArray.Parse(json["ClientsOnline"].ToString()).ToObject <NetAccount[]>(); netClientOnline1.SetOnlineRender(accounts); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.文件总数量) { if (IsHandleCreated) { Invoke(new Action(() => { label_file_count.Text = data; })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.留言版消息) { if (IsHandleCreated) { Invoke(new Action(() => { UIControls_Chat?.DealwithReceive(data); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.新用户上线) { if (IsHandleCreated) { Invoke(new Action(() => { UserClient.LogNet?.WriteDebug("Online Event : " + data); netClientOnline1.ClientOnline(JObject.Parse(data).ToObject <NetAccount>()); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.用户下线) { if (IsHandleCreated) { Invoke(new Action(() => { netClientOnline1.ClinetOffline(data); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.新头像更新) { UserClient.PortraitManager.UpdateSmallPortraitByName(data); if (IsHandleCreated) { Invoke(new Action(() => { if (data == UserClient.UserAccount.UserName) { pictureBox1.Image = UserClient.PortraitManager.GetSmallPortraitByUserName(data); } netClientOnline1.ClientUpdatePortrait(data); })); } } }
/// <summary> /// 接收到服务器的字节数据的回调方法 /// </summary> /// <param name="state">网络连接对象</param> /// <param name="customer">用户自定义的指令头,用来区分数据用途</param> /// <param name="data">数据</param> private void Net_socket_client_AcceptString(AsyncStateOne state, NetHandle customer, string data) { if (customer == CommonHeadCode.MultiNetHeadCode.弹窗新消息) { if (IsWindowShow) { Dispatcher.Invoke(new Action(() => { FormPopup fpp = new FormPopup(data, System.Drawing.Color.DodgerBlue, 10000); fpp.Show(); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.总在线信息) { //if (IsWindowShow) Dispatcher.Invoke(new Action(() => //{ // // ListBox_Onlines.ItemsSource = data.Split('#'); // ClientsOnline.Children.Clear(); // NetAccount[] accounts = JArray.Parse(data).ToObject<NetAccount[]>(); // foreach(var m in accounts) // { // Views.Controls.UserClientRenderItem userClient = new Views.Controls.UserClientRenderItem(); // userClient.SetClientRender(m); // ClientsOnline.Children.Add(userClient); // } //})); } else if (customer == CommonHeadCode.MultiNetHeadCode.关闭客户端) { if (IsWindowShow) { Dispatcher.Invoke(new Action(() => { Close(); })); } } else if (customer == CommonHeadCode.SimplifyHeadCode.更新公告) { //此处应用到了同步类的指令头 if (IsWindowShow) { Dispatcher.Invoke(new Action(() => { UserClient.Announcement = data; TextBlock_Announcement.Text = data; FormPopup fpp = new FormPopup(data, System.Drawing.Color.DodgerBlue, 10000); fpp.Show(); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.初始化数据) { //收到服务器的数据 JObject json = JObject.Parse(data); UserClient.DateTimeServer = json["Time"].ToObject <DateTime>(); List <string> chats = JArray.Parse(json["chats"].ToString()).ToObject <List <string> >(); StringBuilder sb = new StringBuilder(); chats.ForEach(m => { sb.Append(m + Environment.NewLine); }); if (IsWindowShow) { Dispatcher.Invoke(new Action(() => { TextBlock_ServerTime.Text = UserClient.DateTimeServer.ToString("yyyy-MM-dd HH:mm:ss"); TextBlock_FileCount.Text = json["FileCount"].ToObject <int>().ToString(); UIControls_Chat.AddChatsHistory(sb.ToString()); NetAccount[] accounts = JArray.Parse(json["ClientsOnline"].ToString()).ToObject <NetAccount[]>(); foreach (var m in accounts) { Views.Controls.UserClientRenderItem userClient = new Views.Controls.UserClientRenderItem(); userClient.SetClientRender(m); ClientsOnline.Children.Add(userClient); } })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.文件总数量) { if (IsWindowShow) { Dispatcher.Invoke(new Action(() => { TextBlock_FileCount.Text = data; })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.留言版消息) { if (IsWindowShow) { Dispatcher.Invoke(new Action(() => { UIControls_Chat?.DealwithReceive(data); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.新用户上线) { if (IsWindowShow) { Dispatcher.Invoke(new Action(() => { Views.Controls.UserClientRenderItem userClient = new Views.Controls.UserClientRenderItem(); userClient.SetClientRender(JObject.Parse(data).ToObject <NetAccount>()); ClientsOnline.Children.Add(userClient); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.用户下线) { if (IsWindowShow) { Dispatcher.Invoke(new Action(() => { Views.Controls.UserClientRenderItem item = null; foreach (Views.Controls.UserClientRenderItem m in ClientsOnline.Children) { if (m?.UniqueId == data) { item = m; } } if (item != null) { ClientsOnline.Children.Remove(item); } })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.新头像更新) { if (IsWindowShow) { Dispatcher.Invoke(new Action(() => { foreach (Views.Controls.UserClientRenderItem m in ClientsOnline.Children) { m.UpdatePortrait(data); } })); } } }
/// <summary> /// 接收到服务器的字节数据的回调方法 /// </summary> /// <param name="state">网络连接对象</param> /// <param name="customer">用户自定义的指令头,用来区分数据用途</param> /// <param name="data">数据</param> private void Net_socket_client_AcceptString(AsyncStateOne state, int customer, string data) { if (customer == CommonHeadCode.MultiNetHeadCode.弹窗新消息) { if (IsHandleCreated) { Invoke(new Action(() => { FormPopup fpp = new FormPopup(data, Color.DodgerBlue, 10000); fpp.Show(); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.总在线信息) { if (IsHandleCreated) { Invoke(new Action(() => { listBox1.DataSource = data.Split('#'); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.关闭客户端) { if (IsHandleCreated) { Invoke(new Action(() => { Close(); })); } } else if (customer == CommonHeadCode.SimplifyHeadCode.更新公告) { //此处应用到了同步类的指令头 if (IsHandleCreated) { Invoke(new Action(() => { UserClient.Announcement = data; label_Announcement.Text = data; FormPopup fpp = new FormPopup(data, Color.DodgerBlue, 10000); fpp.Show(); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.初始化数据) { //收到服务器的数据 JObject json = JObject.Parse(data); UserClient.DateTimeServer = json["Time"].ToObject <DateTime>(); List <string> chats = JArray.Parse(json["chats"].ToString()).ToObject <List <string> >(); StringBuilder sb = new StringBuilder(); chats.ForEach(m => { sb.Append(m + Environment.NewLine); }); if (IsHandleCreated) { Invoke(new Action(() => { toolStripStatusLabel_time.Text = UserClient.DateTimeServer.ToString("yyyy-MM-dd HH:mm"); label_file_count.Text = json["FileCount"].ToObject <int>().ToString(); UIControls_Chat.AddChatsHistory(sb.ToString()); })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.文件总数量) { if (IsHandleCreated) { Invoke(new Action(() => { label_file_count.Text = data; })); } } else if (customer == CommonHeadCode.MultiNetHeadCode.留言版消息) { if (IsHandleCreated) { Invoke(new Action(() => { UIControls_Chat?.DealwithReceive(data); })); } } }
//Displays Shifts section page private void ShowShiftsSection(object sender, RoutedEventArgs e) { shiftSectionPopupContainer = new FormPopup(shiftSection); }
//Displays follow up section page private void ShowFollowUpSection(object sender, RoutedEventArgs e) { followupSectionFormPopupContainer = new FormPopup(followupSection); }