private void Pay_Click(object sender, RoutedEventArgs e) { if (MessageBox.Show("결제하시겠습니까?", "결제 확인", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { TotalData totalData = App.totalData; Chatting chatting = App.chatting; foreach (Food food in payingSeat.lstOrderFood) { setMenuList(totalData, food); setCategoryList(totalData, food); setTotalMoney(totalData, food); } string sendingMoney = "@2104#총액 " + totalData.paymentMoney.ToString() + "원"; chatting.Send(sendingMoney); totalData.paymentMoney = 0; MainWindow main = new MainWindow(); App.seatDataSource.lstSeatData[payingSeat.id - 1].lstOrderFood.Clear(); App.seatDataSource.lstSeatData[payingSeat.id - 1].lstOrderTime.Clear(); main.Refresh(); this.Close(); main.Show(); } }
public MainWindowViewModel() { message = new List <Message>(); chatting = new Chatting(OnReceiveMessage); Messages = CollectionViewSource.GetDefaultView(message); }
void ChattingLog(string txt) { if (Chatting != null) { Chatting.Chat_Message(txt); } }
static void Main(string[] args) { Chatting chat = new Chatting((receivedMessage) => { Console.WriteLine("{0}: {1}", receivedMessage.Nickname, receivedMessage.Text); }); Console.Write("Input your nickname: "); string nickName = Console.ReadLine(); chat.StartMessaging(); Console.WriteLine("Welcome to MiveChat! Say hello to your new friends!"); Message message = new Message(); string messageToSend = null; while (true) { messageToSend = Console.ReadLine(); message.Text = messageToSend; message.Nickname = nickName; // Checking semding message for whitespaces and NULL. If messagecontains only spoaces it also won't be sent if (!string.IsNullOrEmpty(messageToSend) && !string.IsNullOrEmpty(messageToSend.Trim())) { chat.SendMessage(message); } } }
public ServiceStarter() { Console.WriteLine("\nEnter ServiceStarter ctor\n"); #region Use SQLite using (DB db = new DB("OpenALPRQueueMilestone", true)) { settings = db.GetSettings(); } Console.WriteLine("\nDB setup exit\n"); ProxySingleton.Port = settings.ServicePort.ToString(); #endregion currentPerson = new User(User.AutoExporterServiceName); ProxySingleton.HostName = Dns.GetHostName(); Chatting.Initialize(currentPerson); Chatting.UserEnter += ServerConnection_UserEnter; Chatting.UserLeave += ServerConnection_UserLeave; Chatting.InfoArrived += ServerConnection_MessageArrived; Task.Run(() => Chatting.MonitorClientToServerQueue()); Chatting.WhisperGui(new Info { MsgId = MessageId.ConnectedToMilestoneServer, Bool = true }); Console.WriteLine("\nExit ServiceStarter ctor\n"); }
private DataTable dtAccountCheckIn() { DataTable dtReturn = new DataTable(); DataTable dt = new Chatting().SelectUserCheckIn(); dtReturn = dt.Clone(); foreach (DataRow dr in dt.Rows) { string vung_line = dr["Line_Vung"].ToString(); if (vung_line.Contains(";")) { string[] arrVung_Line = vung_line.Split(';'); if (arrVung_Line.Length > 0) { for (int i = 0; i < arrVung_Line.Length; i++) { dr["Line_Vung"] = arrVung_Line[i]; dtReturn.Rows.Add(dr.ItemArray); } } } else { dtReturn.Rows.Add(dr.ItemArray); } } return(dtReturn); }
private static void Init() { try { if (Orbwalker.MovementDelay < 200) { Orbwalker.MovementDelay += new Random().Next(200, 400); } if (AutoShop.Setup.CurrentChampionBuild.BuildData.Length > 0) { var i = 0; foreach (var item in AutoShop.Setup.CurrentChampionBuild.BuildData) { i++; BuildMenu.AddLabel(i + " - " + item); } } if (EnableCustomPlugins) { try { if ((Base)Activator.CreateInstance(null, "AramBuddy.Plugins.Champions." + Player.Instance.Hero + "." + Player.Instance.Hero).Unwrap() != null) { CustomChamp = true; Logger.Send("Loaded Custom Champion " + Player.Instance.Hero); } } catch (Exception) { CustomChamp = false; Logger.Send("There Is No Custom Plugin For " + Player.Instance.Hero, Logger.LogLevel.Warn); } } // Sends Start / End Msg Chatting.Init(); // Initialize Bot Functions. Brain.Init(); // Inits Activator if (EnableActivator) { Plugins.Activator.Load.Init(); } Chat.Print("AramBuddy Loaded !"); Chat.Print("AramBuddy Version: " + version); } catch (Exception ex) { Logger.Send("Program Error At Init", ex, Logger.LogLevel.Error); } }
private void ServerConnection_MessageArrived(object sender, ChatEventArgs e) { switch (e.Message.MessageInfo.MsgId) { case MessageId.ConnectedToMilestoneToServer: Chatting.WhisperGui(new Info { MsgId = MessageId.ConnectedToMilestoneServer, Bool = IsConnectedToMilestoneServer }); break; } }
private void CreateChat() { chatConnection = new Chatting(); chatConnection.Initialize(); chatConnection.InfoReceived += InfoReceived; chatConnection.InfoWhispreReceived += InfoWhispreReceived; chatConnection.UserEnter += UserEnter; chatConnection.UserLeave += UserLeft; Task.Run(() => CreateChatConnection()); }
private void gridControl1_DoubleClick(object sender, EventArgs e) { Chatting chatting = bdsChatting.Current as Chatting; if (chatting == null) { return; } bdsChatting.DataSource = DataRepository.Chatting.GetAll(); }
private void XmppOnOnRosterItem(object sender, RosterItem item) { //Friends.Add(item.); switch (item.Subscription) { case SubscriptionType.none: if (item.Jid.Server == "conference." + Host) { Chatting.GetRoom(new NewUser(item.Jid), true); } break; case SubscriptionType.to: if (item.Jid.User == Me.User.User) { break; } if (Friends.Count(x => x.User.User == item.Jid.User) == 0) { Friends.Add(new NewUser(item.Jid)); } break; case SubscriptionType.from: if (item.Jid.User == Me.User.User) { break; } if (Friends.Count(x => x.User.User == item.Jid.User) == 0) { Friends.Add(new NewUser(item.Jid)); } break; case SubscriptionType.both: if (item.Jid.User == Me.User.User) { break; } if (Friends.Count(x => x.User.User == item.Jid.User) == 0) { Friends.Add(new NewUser(item.Jid)); } break; case SubscriptionType.remove: if (Friends.Contains(new NewUser(item.Jid))) { Friends.Remove(new NewUser(item.Jid)); } break; } }
private void LoginClick(object sender, RoutedEventArgs e) { Chatting chatting = App.chatting; if (chatting.isLogin) { MessageBox.Show("이미 로그인 되어 있습니다."); } else { chatting.Create(); } }
private void btnSend_Click(object sender, EventArgs e) { Chatting chatting = new Chatting(); chatting.Checked = false; chatting.Sent = true; chatting.Text = txbText.Text; chatting.SendTIme = DateTime.Now; chatting.SeatID = SeatId; DataRepository.Chatting.Insert(chatting); txbText.Text = ""; txbText.Select(0, 0); }
public void OnChattingTest() { dashLog("Chatting Test"); buttons_["chatting"].interactable = false; Chatting chatting = new Chatting(); chatting.FinishedCallback += delegate() { chatting = null; buttons_["chatting"].interactable = true; }; StartCoroutine(chatting.Start(session_, encoding, sendingCount)); }
private void SendTotalMoney(object sender, RoutedEventArgs e) { Chatting chatting = App.chatting; if (chatting.isLogin) { string message = "@2104#하루총액 " + totalData.AllMoney.ToString() + "원"; chatting.Send(message); } else { MessageBox.Show("로그인부터 하세용"); } }
void Start() { sr = GetComponent <SpriteRenderer>(); cur_anim = idle_d; InvokeRepeating("Animate", 0, 0.1f); rb = GetComponent <Rigidbody2D>(); chat = FindObjectOfType <Chatting>(); if (isLocalPlayer) { var inputfield = chat.GetComponentInChildren <InputField>(); inputfield.onEndEdit.AddListener(delegate { AddChat(inputfield.textComponent.text); }); } npcs = FindObjectsOfType <NpcScript>(); }
public void setLogTimes() { Chatting chatting = App.chatting; App.Current.Dispatcher.Invoke(() => { if (chatting.isLogin) { logTime.Text = "최근 로그인 시간: " + chatting.loginDate; } else { logTime.Text = "최근 로그아웃 시간: " + chatting.logoutDate; } }); }
private void btnSend_Click(object sender, EventArgs e) { if (cbbSeat.SelectedValue == null) { return; } Chatting chatting = new Chatting(); chatting.Checked = false; chatting.Sent = false; chatting.Text = txbText.Text; chatting.SendTIme = DateTime.Now; chatting.SeatID = (int)cbbSeat.SelectedValue; DataRepository.Chatting.Insert(chatting); txbText.Text = ""; txbText.Select(0, 0); }
private void reloadDataGrid() { DataTable dt = new DataTable(); dt = new Chatting().SelectMessageTemplate(); dgvListMessageTemplate.DataSource = dt; if (dgvListMessageTemplate.RowCount > 0) { dgvListMessageTemplate.Columns[0].Visible = false; dgvListMessageTemplate.Columns[1].HeaderText = "Tiêu đề"; dgvListMessageTemplate.Columns[1].Width = 200; dgvListMessageTemplate.Columns[2].HeaderText = "Nội dung"; dgvListMessageTemplate.Columns[2].Width = 340; } }
private static void Init() { try { if (Orbwalker.MovementDelay < 200) { Orbwalker.MovementDelay += new Random().Next(200, 400); } if (Setup.CurrentChampionBuild.BuildData.Length > 0) { var i = 0; foreach (var item in Setup.CurrentChampionBuild.BuildData) { i++; BuildMenu.AddLabel(i + " - " + item); } } if (EnableCustomPlugins) { loadPlugin(); } // Sends Start / End Msg Chatting.Init(); // Initialize Bot Functions. Brain.Init(); // Inits Activator if (EnableActivator) { Plugins.Activator.Load.Init(); } Chat.Print("AramBuddy Loaded !"); Chat.Print("AramBuddy Version: " + version); } catch (Exception ex) { Logger.Send("Program Error At Init", ex, Logger.LogLevel.Error); } }
private void Order_Click(object sender, RoutedEventArgs e) { Chatting chatting = App.chatting; if (!chatting.isLogin) { MessageBox.Show("로그인부터 하세용"); } else { Window orderPage = null; var seatControl = (sender as ListViewItem).Content as SeatControl; int id = int.Parse(seatControl.id.Text); orderPage = new Order(id); Window.GetWindow(this).Close(); orderPage.Show(); } }
private void SetDataDetail() { string ToUserName = ""; string Contents = ""; string Subject = ""; int Priority = 1; DateTime date = G_TimeServer; DataTable dt = new Chatting().SelectByID(g_idMessage); ToUserName = dt.Rows[0]["ListToUserName"].ToString(); Contents = dt.Rows[0]["Contents"].ToString(); Subject = dt.Rows[0]["Subject"].ToString(); Priority = Int32.TryParse(dt.Rows[0]["Priority"].ToString(), out Priority) ? Priority : 1; DateTime.TryParse(dt.Rows[0]["Date"].ToString(), out date); txtTieuDe.Text = Subject; txtNoiDung1.Text = Contents; txtTaiKhoan1.Text = ToUserName; cbCapDo.SelectedValue = Priority; dateTime_ThoiGianGui.SetValue(date); }
private void reloadDataGrid() { DataTable dt = new DataTable(); dt = new Chatting().SelectMessageTemplate(); dgvMessageTemplate.DataSource = dt; if (dgvMessageTemplate.RowCount > 0) { dgvMessageTemplate.Columns[0].Visible = true; dgvMessageTemplate.Columns[0].Resizable = DataGridViewTriState.False; dgvMessageTemplate.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable; dgvMessageTemplate.Columns[0].Width = 0; dgvMessageTemplate.Columns[1].HeaderText = "Tiêu đề"; dgvMessageTemplate.Columns[1].Width = 200; dgvMessageTemplate.Columns[2].HeaderText = "Nội dung"; dgvMessageTemplate.Columns[2].Width = 315; } refreshForm(); }
public void OnStop() { Chatting.WhisperGui(new Info { MsgId = MessageId.ConnectedToMilestoneServer, Bool = false }); IsClosing = true; Program.Log.Debug("On stop"); Program.Log.Info($"Stopping {Program.ProductName} service"); if (worker != null) { worker.Close(); } if (workerTask != null && workerTask.Status != TaskStatus.RanToCompletion) { workerTask.Dispose(); workerTask = null; } if (milestoneServer != null) { milestoneServer.Close(); } try { Chatting.UserEnter -= ServerConnection_UserEnter; Chatting.UserLeave -= ServerConnection_UserLeave; Chatting.InfoArrived -= ServerConnection_MessageArrived; Chatting.Close(); } catch (Exception ex) { Program.Log.Error("OnStop", ex); } }
void app_OnLogin(Chatting.Protocol.Response response) { if (response.Success) { Dispatcher.Invoke(new Action(() => { this.Visibility = Visibility.Hidden; this.notifyIcon = new System.Windows.Forms.NotifyIcon(); this.notifyIcon.BalloonTipText = "托盘应用程序正在运行!"; this.notifyIcon.Text = "托盘应用程序!"; this.notifyIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.Windows.Forms.Application.ExecutablePath); this.notifyIcon.Visible = true; this.notifyIcon.ShowBalloonTip(1000); wf.MenuItem mi = new wf.MenuItem("退出", (p, q) => { this.Close(); App.Current.Shutdown(); }); wf.MenuItem mi2 = new wf.MenuItem("显示登录窗口", (p, q) => { this.Visibility = Visibility.Visible; }); wf.MenuItem mi3 = new wf.MenuItem("打开聊天窗口", (p, q) => { App.ChatWin.Show(); }); this.notifyIcon.ContextMenu = new wf.ContextMenu(new wf.MenuItem[] { mi, mi2, mi3 }); }), null); } else { MessageBox.Show(response.Data.ToString()); } }
private static void Init() { try { if (Orbwalker.MovementDelay < 200) { Orbwalker.MovementDelay = new Random().Next(200, 500) + Game.Ping; } MenuIni = MainMenu.AddMenu("AramBuddy", "AramBuddy"); var build = MenuIni.AddSubMenu("Current Build"); SpellsMenu = MenuIni.AddSubMenu("Spells"); MenuIni.AddGroupLabel("AramBuddy Version: " + version); MenuIni.AddGroupLabel("AramBuddy Settings"); var debug = MenuIni.CreateCheckBox("debug", "Enable Debugging Mode"); var activator = MenuIni.CreateCheckBox("activator", "Enable Built-In Activator"); var DisableSpells = MenuIni.CreateCheckBox("DisableSpells", "Disable Built-in Casting Logic", false); var quit = MenuIni.CreateCheckBox("quit", "Quit On Game End"); var stealhr = MenuIni.CreateCheckBox("stealhr", "Dont Steal Health Relics From Allies", false); var chat = MenuIni.CreateCheckBox("chat", "Send Start / End msg In-Game Chat", false); var texture = MenuIni.CreateCheckBox("texture", "Disable In-Game Texture (Less RAM/CPU)", false); MenuIni.AddSeparator(0); var Safe = MenuIni.CreateSlider("Safe", "Safe Slider (Recommended 1250)", 1250, 0, 2500); MenuIni.AddLabel("More Safe Value = more defensive playstyle"); MenuIni.AddSeparator(0); var HRHP = MenuIni.CreateSlider("HRHP", "Health Percent To Pick Health Relics (Recommended 75%)", 75); var HRMP = MenuIni.CreateSlider("HRMP", "Mana Percent To Pick Health Relics (Recommended 15%)", 15); MenuIni.AddSeparator(0); var Reset = MenuIni.CreateCheckBox("reset", "Reset All Settings To Default", false); Reset.OnValueChange += delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args) { if (args.NewValue) { Reset.CurrentValue = false; debug.CurrentValue = true; activator.CurrentValue = true; DisableSpells.CurrentValue = false; quit.CurrentValue = true; stealhr.CurrentValue = false; chat.CurrentValue = true; texture.CurrentValue = false; Safe.CurrentValue = 1250; HRHP.CurrentValue = 75; HRMP.CurrentValue = 15; } }; SpellsMenu.AddGroupLabel("SummonerSpells"); SpellsMenu.Add("Heal", new CheckBox("Use Heal")); SpellsMenu.Add("Barrier", new CheckBox("Use Barrier")); SpellsMenu.Add("Clarity", new CheckBox("Use Clarity")); SpellsMenu.Add("Ghost", new CheckBox("Use Ghost")); SpellsMenu.Add("Flash", new CheckBox("Use Flash")); SpellsMenu.Add("Cleanse", new CheckBox("Use Cleanse")); if (AutoShop.Setup.CurrentChampionBuild.BuildData.Length > 0) { var i = 0; foreach (var item in AutoShop.Setup.CurrentChampionBuild.BuildData) { i++; build.AddLabel(i + " - " + item); } } if (!DisableSpellsCasting) { try { if ((Base)Activator.CreateInstance(null, "AramBuddy.Plugins.Champions." + Player.Instance.Hero + "." + Player.Instance.Hero).Unwrap() != null) { CustomChamp = true; Logger.Send("Loaded Custom Champion " + Player.Instance.Hero, Logger.LogLevel.Info); } } catch (Exception) { CustomChamp = false; Logger.Send("There Is No Custom Plugin For " + Player.Instance.Hero, Logger.LogLevel.Warn); } } // Sends Start / End Msg Chatting.Init(); // Initialize Bot Functions. Brain.Init(); // Inits Activator if (EnableActivator) { Plugins.Activator.Load.Init(); } if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\EloBuddy\\AramBuddy\\temp\\DisableTexture.dat")) { if (DisableTexture) { File.Create(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\EloBuddy\\AramBuddy\\temp\\DisableTexture.dat"); } } else { if (!DisableTexture) { File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\EloBuddy\\AramBuddy\\temp\\DisableTexture.dat"); } } Drawing.OnEndScene += Drawing_OnEndScene; Chat.Print("AramBuddy Loaded !"); Chat.Print("AramBuddy Version: " + version); } catch (Exception ex) { Logger.Send("Program Error At Init", ex, Logger.LogLevel.Error); } }
public void SetChatting(Chatting chatting) { m_chatting = chatting; }
void app_OnRegister(Chatting.Protocol.Response response) { if (response.Success) { User user = response.Data as User; App.CurrentUser = user; MessageBox.Show("注册成功"); } else { MessageBox.Show(response.Data.ToString()); } }
public void SendFile(string uname, Chatting.Protocol.FileInfo fi) { Request reques = new Request(); reques.SourceUserName = CurrentUser.UserName; reques.TargetUserName = uname; reques.Data = fi; reques.ProcessType = ProcessType.File; CliendSocket.SocketSend(reques); }
private void XmppOnOnPresence(object sender, Presence pres) { //if (pres.From.User != "lobby") Debugger.Break(); if (pres.From.User == Xmpp.MyJID.User) { if (pres.Type == PresenceType.subscribe) { Xmpp.PresenceManager.ApproveSubscriptionRequest(pres.From); } else { myPresence = pres; myPresence.Type = PresenceType.available; if (pres.Show != ShowType.NONE) { myPresence.Show = pres.Show; } Xmpp.Status = myPresence.Status ?? Xmpp.Status; if (OnDataRecieved != null) { OnDataRecieved.Invoke(this, DataRecType.MyInfo, pres); } } return; } switch (pres.Type) { case PresenceType.available: if (pres.From.Server == "conference." + Host) { var rm = Chatting.GetRoom(new NewUser(pres.From), true); rm.AddUser(new NewUser(pres.MucUser.Item.Jid), false); } break; case PresenceType.unavailable: { if (pres.From.Server == "conference." + Host) { if (pres.MucUser.Item.Jid == null) { break; } if (pres.MucUser.Item.Jid.Bare == Me.User.Bare) { break; } var rm = Chatting.GetRoom(new NewUser(pres.From), true); rm.UserLeft(new NewUser(pres.MucUser.Item.Jid)); } break; } case PresenceType.subscribe: if (!Friends.Contains(new NewUser(pres.From.Bare))) { Notifications.Add(new FriendRequestNotification(pres.From.Bare, this, _noteId)); _noteId++; if (OnFriendRequest != null) { OnFriendRequest.Invoke(this, pres.From.Bare); } } else { AcceptFriendship(pres.From.Bare); } break; case PresenceType.subscribed: break; case PresenceType.unsubscribe: break; case PresenceType.unsubscribed: break; case PresenceType.error: break; case PresenceType.probe: break; } for (int i = 0; i < Friends.Count; i++) { if (Friends[i].User.User == pres.From.User) { Friends[i].CustomStatus = pres.Status ?? ""; Friends[i].SetStatus(pres); break; } } XmppOnOnRosterEnd(this); }
public UI_Chat_Active(Chatting controller) { this.controller = controller; }
public UI_Chat_Write(Chatting controller) { this.controller = controller; }
private void LogoutClick(object sender, RoutedEventArgs e) { Chatting chatting = App.chatting; chatting.Close(); }