protected void DropDownListMark_SelectedIndexChanged(object sender, EventArgs e) { bool status = false; foreach (GridViewRow row in GridViewMessageBox.Rows) { CheckBox checkBox = (CheckBox)row.Cells[0].FindControl("CheckBoxMessage"); if (checkBox.Checked) { HiddenField hiddenField = (HiddenField)row.Cells[0].FindControl("HiddenFieldMessage"); string messageUserOID = hiddenField.Value; MessageCenter messageCenter = new MessageCenter(); if ((DropDownListMark.SelectedItem.Text == "Mark") || (DropDownListMark.SelectedItem.Text == "Star")) { if (messageCenter.UpdateMessageUserUMark(Convert.ToInt32(messageUserOID), 1)) status = true; } else { if (messageCenter.UpdateMessageUserUStatus(Convert.ToInt32(messageUserOID), DropDownListMark.SelectedItem.Text)) status = true; } } } if (status) { PopulateMessageBox(); } }
public Form1(MessageCenter m) { mc = m; mc.nMessage += new MessageCenter.NewMessage(mc_nMessage); mc.Connect(); InitializeComponent(); }
public static MessageCenter getInstance () { if ( _meInstance == null ) { _meInstance = GameObject.Find ( "_MainObject" ).GetComponent < MessageCenter > (); } return _meInstance; }
public MainWindow() { this.messenger = App.Messenger; this.buddyManager = ComponentManager.GetBuddyManager(); this._messageCenter = App.Messenger.MessageCenter; InitializeComponent(); this.messenger.LoginCompleted += new EventHandler<LoginEventArgs>(this.OnLogin); this.messenger.ConnectionStatusChanged += new EventHandler<ConnectionStatusChangeEventArgs>(this.messenger_ConnectionStatusChanged); this.messagemonitor = InstanceAnswerPro.Core.ComponentManager.GetMessageMonitor(); Buddy.BuddyPropertyChanged += new PropertyChangedEventHandler(this.Buddy_BuddyPropertyChanged); }
public void PublishToAltSubscribedTest() { //arrange MessageCenter target = new MessageCenter(); string res = null; target.Subscribe<string>(a => { res = a; }); var msg = new message() { txt = "hi" }; //act target.Publish(msg); //assert Assert.AreNotEqual(res, "hi"); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MessageCenter mc = new MessageCenter(); ConnectToCore ctc = new ConnectToCore(); ctc.ShowDialog(); mc.server = ctc.server; mc.user = ctc.user; mc.password = ctc.password; Form1 f1 = new Form1(mc); f1.ShowDialog(); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["mid"] != null) { string OID = Request.QueryString["mid"].ToString(); //TextBox1.Text = tmp; Populate(Convert.ToInt32(OID)); } if (Request.QueryString["muoid"] != null) { string MUOID = Request.QueryString["muoid"].ToString(); MessageCenter messageCenter = new MessageCenter(); messageCenter.UpdateMessageUserUStatus(Convert.ToInt32(MUOID), "Read"); } }
protected void ButtonDelete_Click(object sender, EventArgs e) { bool status = false; foreach (GridViewRow row in GridViewMessageBox.Rows) { CheckBox checkBox = (CheckBox)row.Cells[0].FindControl("CheckBoxMessage"); if (checkBox.Checked) { HiddenField hiddenField = (HiddenField)row.Cells[0].FindControl("HiddenFieldMessage"); string messageOID = hiddenField.Value; MessageCenter messageCenter = new MessageCenter(); if (messageCenter.UpdateMessageCenterStatus(Convert.ToInt32(messageOID), "Trashed")) status = true; } } if (status) { PopulateMessageBox(); } }
protected void ButtonDelete_Click(object sender, EventArgs e) { bool status = false; foreach (GridViewRow row in GridViewTask.Rows) { CheckBox checkBox = (CheckBox)row.Cells[0].FindControl("CheckBoxTask"); if (checkBox.Checked) { HiddenField hiddenField = (HiddenField)row.Cells[0].FindControl("HiddenFieldTask"); string taskOID = hiddenField.Value; MessageCenter messageCenter = new MessageCenter(); Task task = new Task(); if (task.UpdateTaskStatus(Convert.ToInt32(taskOID), "Completed")) status = true; } } if (status) { PopulateGridview(); } }
private void PopulateMessageBox() { try { //int totalRecords; //string numberOfRows = "10"; //string pageIndex = "1"; //string sortColumnName = "CreatedDate"; //string sortOrderBy = "desc"; //Collection<User> users = GetUsers(numberOfRows, pageIndex, sortColumnName, sortOrderBy, out totalRecords); User u = (User)Session["CurrentUser"]; int OID = (u != null) ? u.UserOID : 0; MessageCenter mess = new MessageCenter(); GridViewMessageBox.DataSource = mess.GetSentMessageByUser(OID);//mess.GetMessages(numberOfRows, pageIndex, sortColumnName, sortOrderBy, out totalRecords); GridViewMessageBox.DataBind(); } catch (Exception ex) { } }
public static string InsertMessage(string Recipient, string Mark,string BoyContent, string Subject,string from) { try { //User u = new User(); //Collection<User> list = u.GetAllUser(); MessageCenter messCenter = new MessageCenter(); messCenter.Mark = (Mark=="Mark")?1:0;//Convert.ToInt32(Mark); messCenter.MessageBody = BoyContent; messCenter.Recipient = Recipient; messCenter.Subject = Subject; messCenter.SendFrom = Convert.ToInt32(from); messCenter.Status = "Unread";//Status; messCenter.AddMessage(); } catch (Exception ex) { return "false"; } return "true"; }
private void Populate(int OID) { try { MessageCenter m = new MessageCenter(); m = m.GetMessageByOID(OID); if (m != null) { LabelDate.Text = m.CreatedDate.ToShortDateString(); LabelFrom.Text = "";//m.SendFrom; LabelMessage.Text = m.MessageBody;//System.Text.RegularExpressions.Regex.Replace(m.MessageBody, "<[^>]*>", string.Empty); ; LabelSubject.Text = m.Subject; LabelTime.Text = m.CreatedDate.ToShortTimeString(); User u = new User(); u=u.GetUserByOID(m.SendFrom); if(u!=null) { LabelFrom.Text = u.LastName + ", " + u.FirstName; } } } catch (Exception ex) { } }
//private void OnMsgStepTimeOver() //{ // GameLogic.Instance.GameStartAction -= TimeRunning; // StepTime.gameObject.SetActive(false); // StepOver.gameObject.SetActive(true); // UIMainAnimator.Play("UIMain_StepOver"); // MessageCenter.SendMessage((int)MsgEnum.StepTimeOver); // Invoke("OnMsgStepOver", 1); //} public void OnMsgStepOver() { StepOver.gameObject.SetActive(false); MessageCenter.SendMessage((int)MsgEnum.StepOneOver); GameLogic.Instance.GameStartAction -= TimeRunning; }
public MsgType(MsgId msgId) { this.msgId = msgId; MessageCenter.BindType(msgId, type); }
private void ls_songs_ItemClick(object sender, ItemClickEventArgs e) { var item = e.ClickedItem as MusicHomeSongModel; MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(MusicInfoPage), item.id); }
private async void webview_WebView_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args) { if (args.Uri == null) { return; } if (await MessageCenter.HandelUrl(args.Uri.AbsoluteUri)) { args.Cancel = true; } try { this.webView.AddWebAllowedObject("biliapp", _biliapp); } catch (Exception ex) { LogHelper.WriteLog("初始化JSbridge失败", LogType.ERROR, ex); } //string ban = Regex.Match(args.Uri.AbsoluteUri, @"^http://bangumi.bilibili.com/anime/(.*?)$").Groups[1].Value; //if (ban.Length != 0) //{ // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(BanInfoPage), ban.Replace("/", "")); // return; //} //string ban2 = Regex.Match(args.Uri.AbsoluteUri, @"^http://www.bilibili.com/bangumi/i/(.*?)$").Groups[1].Value; //if (ban2.Length != 0) //{ // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(BanInfoPage), ban2.Replace("/", "")); // return; //} ////bilibili://?av=4284663 //string ban3 = Regex.Match(args.Uri.AbsoluteUri, @"^bilibili://?av=(.*?)$").Groups[1].Value; //if (ban3.Length != 0) //{ // //args.Handled = true; // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(VideoViewPage), ban3.Replace("/", "")); // //this.Frame.Navigate(typeof(VideoViewPage), ban3.Replace("/", "")); // return; //} ////https://bangumi.bilibili.com/anime/6499 //string ban4 = Regex.Match(args.Uri.AbsoluteUri+"/", @"/anime/(.*?)/",RegexOptions.Singleline).Groups[1].Value; //if (ban4.Length != 0) //{ // //args.Handled = true; // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(BanInfoPage), ban4.Replace("/", "")); // // this.Frame.Navigate(typeof(BanInfoPage), ban2.Replace("/", "")); // return; //} //string live = Regex.Match(args.Uri.AbsoluteUri, @"^bilibili://live/(.*?)$").Groups[1].Value; //if (live.Length != 0) //{ // MessageCenter.SendNavigateTo(NavigateMode.Play, typeof(LiveRoomPage), live); // return; //} //string live2 = Regex.Match(args.Uri.AbsoluteUri, @"^http://live.bilibili.com/(.*?)$").Groups[1].Value; //if (live2.Length != 0) //{ // long roomid = 0; // if (long.TryParse(live2.Replace("/",""),out roomid)) // { // MessageCenter.SendNavigateTo(NavigateMode.Play, typeof(LiveRoomPage), live2.Replace("/", "").Replace("h5/","")); // return; // } //} //string minivideo = Regex.Match(args.Uri.AbsoluteUri+"/", @"vc=(.*?)/").Groups[1].Value; //if (minivideo.Length != 0) //{ // //MessageCenter.SendNavigateTo(NavigateMode.Play, typeof(LiveRoomPage), minivideo); // MessageCenter.ShowMiniVideo(minivideo); // return; //} ////text .Text= args.Uri.AbsoluteUri; //webview_progressBar.Visibility = Visibility.Visible; //if (Regex.IsMatch(args.Uri.AbsoluteUri, "/video/av(.*)?[/|+](.*)?")) //{ // string a = Regex.Match(args.Uri.AbsoluteUri, "/video/av(.*)?[/|+](.*)?").Groups[1].Value; // //this.Frame.Navigate(typeof(VideoViewPage), a); // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(VideoViewPage), a); //} }
private void cb_BGOpacity_SelectionChanged(object sender, SelectionChangedEventArgs e) { SettingHelper.Set_BGOpacity(cb_BGOpacity.SelectedIndex + 1); MessageCenter.SendChangedBg(); }
public void SubscribeTest() { MessageCenter target = new MessageCenter(); target.Subscribe<message>(msg => { }); }
public void Load(object root) { Messenger = (CoreMessenger)root; this._contactSessionManager = InstanceAnswerPro.Core.ComponentManager.GetContactSessionManager(); this._contactSessionManager.ImageTransferStatusChanged += new EventHandler<ImageTransferStatusChangedrEventArgs>(this.ContactSessionManager_ImageTransferStatusChanged); this._communitySessionManager = InstanceAnswerPro.Core.ComponentManager.GetCommunitySessionManager(); this._messageCenter = Messenger.MessageCenter; this._messageCenter.AddMessageProcessor(this); this.InitXaml(); }
internal Silo(string name, SiloType siloType, ClusterConfiguration config, ILocalDataStore keyStore) { SystemStatus.Current = SystemStatus.Creating; CurrentSilo = this; var startTime = DateTime.UtcNow; this.siloType = siloType; Name = name; siloTerminatedEvent = new ManualResetEvent(false); OrleansConfig = config; globalConfig = config.Globals; config.OnConfigChange("Defaults", () => nodeConfig = config.GetConfigurationForNode(name)); if (!TraceLogger.IsInitialized) { TraceLogger.Initialize(nodeConfig); } config.OnConfigChange("Defaults/Tracing", () => TraceLogger.Initialize(nodeConfig, true), false); LimitManager.Initialize(nodeConfig); ActivationData.Init(config); StatisticsCollector.Initialize(nodeConfig); SerializationManager.Initialize(globalConfig.UseStandardSerializer); initTimeout = globalConfig.MaxJoinAttemptTime; if (Debugger.IsAttached) { initTimeout = StandardExtensions.Max(TimeSpan.FromMinutes(10), globalConfig.MaxJoinAttemptTime); stopTimeout = initTimeout; } IPEndPoint here = nodeConfig.Endpoint; int generation = nodeConfig.Generation; if (generation == 0) { generation = SiloAddress.AllocateNewGeneration(); nodeConfig.Generation = generation; } TraceLogger.MyIPEndPoint = here; logger = TraceLogger.GetLogger("Silo", TraceLogger.LoggerType.Runtime); logger.Info(ErrorCode.SiloInitializing, "-------------- Initializing {0} silo on {1} at {2}, gen {3} --------------", siloType, nodeConfig.DNSHostName, here, generation); logger.Info(ErrorCode.SiloInitConfig, "Starting silo {0} with runtime Version='{1}' Config= " + Environment.NewLine + "{2}", name, RuntimeVersion.Current, config.ToString(name)); if (keyStore != null) { // Re-establish reference to shared local key store in this app domain LocalDataStoreInstance.LocalDataStore = keyStore; } healthCheckParticipants = new List <IHealthCheckParticipant>(); BufferPool.InitGlobalBufferPool(globalConfig); PlacementStrategy.Initialize(globalConfig); UnobservedExceptionsHandlerClass.SetUnobservedExceptionHandler(UnobservedExceptionHandler); AppDomain.CurrentDomain.UnhandledException += (obj, ev) => DomainUnobservedExceptionHandler(obj, (Exception)ev.ExceptionObject); typeManager = new GrainTypeManager(here.Address.Equals(IPAddress.Loopback)); // Performance metrics siloStatistics = new SiloStatisticsManager(globalConfig, nodeConfig); config.OnConfigChange("Defaults/LoadShedding", () => siloStatistics.MetricsTable.NodeConfig = nodeConfig, false); // The scheduler scheduler = new OrleansTaskScheduler(globalConfig, nodeConfig); healthCheckParticipants.Add(scheduler); // Initialize the message center var mc = new MessageCenter(here, generation, globalConfig, siloStatistics.MetricsTable); if (nodeConfig.IsGatewayNode) { mc.InstallGateway(nodeConfig.ProxyGatewayEndpoint); } messageCenter = mc; // Now the router/directory service // This has to come after the message center //; note that it then gets injected back into the message center.; localGrainDirectory = new LocalGrainDirectory(this); // Now the activation directory. // This needs to know which router to use so that it can keep the global directory in synch with the local one. activationDirectory = new ActivationDirectory(); // Now the consistent ring provider RingProvider = GlobalConfig.UseVirtualBucketsConsistentRing ? (IConsistentRingProvider) new VirtualBucketsRingProvider(SiloAddress, GlobalConfig.NumVirtualBucketsConsistentRing) : new ConsistentRingProvider(SiloAddress); Action <Dispatcher> setDispatcher; catalog = new Catalog(Constants.CatalogId, SiloAddress, Name, LocalGrainDirectory, typeManager, scheduler, activationDirectory, config, out setDispatcher); var dispatcher = new Dispatcher(scheduler, messageCenter, catalog, config); setDispatcher(dispatcher); RuntimeClient.Current = new InsideRuntimeClient( dispatcher, catalog, LocalGrainDirectory, SiloAddress, config, RingProvider, typeManager); messageCenter.RerouteHandler = InsideRuntimeClient.Current.RerouteMessage; messageCenter.SniffIncomingMessage = InsideRuntimeClient.Current.SniffIncomingMessage; siloStatistics.MetricsTable.Scheduler = scheduler; siloStatistics.MetricsTable.ActivationDirectory = activationDirectory; siloStatistics.MetricsTable.ActivationCollector = catalog.ActivationCollector; siloStatistics.MetricsTable.MessageCenter = messageCenter; DeploymentLoadPublisher.CreateDeploymentLoadPublisher(this, globalConfig); PlacementDirectorsManager.CreatePlacementDirectorsManager(globalConfig); // Now the incoming message agents incomingSystemAgent = new IncomingMessageAgent(Message.Categories.System, messageCenter, activationDirectory, scheduler, dispatcher); incomingPingAgent = new IncomingMessageAgent(Message.Categories.Ping, messageCenter, activationDirectory, scheduler, dispatcher); incomingAgent = new IncomingMessageAgent(Message.Categories.Application, messageCenter, activationDirectory, scheduler, dispatcher); membershipFactory = new MembershipFactory(); reminderFactory = new LocalReminderServiceFactory(); SystemStatus.Current = SystemStatus.Created; StringValueStatistic.FindOrCreate(StatisticNames.SILO_START_TIME, () => TraceLogger.PrintDate(startTime)); // this will help troubleshoot production deployment when looking at MDS logs. TestHookup = new TestHookups(this); logger.Info(ErrorCode.SiloInitializingFinished, "-------------- Started silo {0}, ConsistentHashCode {1:X} --------------", SiloAddress.ToLongString(), SiloAddress.GetConsistentHashCode()); }
private void OnApplicationQuit() { MessageCenter.Send("Quit", this); }
private void Button_Click(object sender, RoutedEventArgs e) { cd.Hide(); MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(UserInfoPage), ((sender as Button).DataContext as LiveVideoModel).user.uid); }
protected void cmdOK_ServerClick(object sender, System.EventArgs e) { SessionHelper sessionHelper = SessionHelper.Current(this.Session); _facade = new SecurityFacade(base.DataProvider); try { // 未输入用户名 if (this.txtUserCode.Text.Trim() == string.Empty) { ExceptionManager.Raise(this.GetType(), "$Error_User_Code_Empty"); } //用户输入密码错误5次 if (this.loguser.Value != this.txtUserCode.Text.Trim() && this.loguser.Value != string.Empty) { this.logintimes.Value = "0"; //登陆用户与上一次的用户不同且不是第一次登陆,输入密码错误次数清零 } if (this.loguser.Value == this.txtUserCode.Text.Trim() || this.loguser.Value == string.Empty) //登陆用户第一次或者和上次登陆的相同 { this.loguser.Value = this.txtUserCode.Text.Trim(); int logtimes = Convert.ToInt32(this.logintimes.Value); logtimes = logtimes + 1; this.logintimes.Value = logtimes.ToString(); ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.OpenConnection(); DataProvider.BeginTransaction(); try { string login = "******" + txtUserCode.Text.Trim().ToUpper() + "'"; if (logtimes > 5) { ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.Execute(login); //密码错误5次将userstat改为L,锁定账户 DataProvider.CommitTransaction(); this.logintimes.Value = "0"; return; } } catch { DataProvider.RollbackTransaction(); } finally { ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection(); } } // 未输入密码 if (this.txtPassword.Text.Trim() == string.Empty) { ExceptionManager.Raise(this.GetType(), "$Error_Password_Empty"); } BenQGuru.eMES.Domain.BaseSetting.User user = this._facade.LoginCheck(FormatHelper.CleanString(this.txtUserCode.Text.ToUpper()), FormatHelper.CleanString(this.txtPassword.Text.ToUpper())); // 用户名不存在 if (user == null) { ExceptionManager.Raise(this.GetType(), "$Error_User_Not_Exist"); } //新用户必须更改密码,用户限制,锁定账户 string userstat = "select userstat from tbluser where usercode ='" + txtUserCode.Text.Trim().ToUpper() + "'"; DataSet ds = ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider) this.DataProvider).PersistBroker.Query(userstat); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0][0].ToString() == "C") //用户限制 { ExceptionManager.Raise(this.GetType(), "$Error_User_Confined"); return; } else if (ds.Tables[0].Rows[0][0].ToString() == "L") //锁定账户 { ExceptionManager.Raise(this.GetType(), "$Error_User_Locked"); return; } /* * else if (ds.Tables[0].Rows[0][0].ToString() == "N")//新用户必须更改密码 * { * ExceptionManager.Raise(this.GetType(), "$Error_User_New"); * return; * } */ } // Added By Hi1/Venus.Feng on 20080627 for Hisense Version : Add OrgID // 只将User默认的Org放进Session中去 BaseModelFacade baseFacade = new BaseModelFacade(this.DataProvider); object org = baseFacade.GetUserDefaultOrgByUser(user.UserCode); if (org == null) { ExceptionManager.Raise(this.GetType(), "$Error_UserDefaultOrg_NotDefined"); return; } GlobalVariables.CurrentOrganizations.Clear(); GlobalVariables.CurrentOrganizations.Add((Organization)org); // End Added sessionHelper.IsBelongToAdminGroup = this._facade.IsBelongToAdminGroup(this.txtUserCode.Text.ToUpper()); sessionHelper.UserName = user.UserName; sessionHelper.UserCode = user.UserCode; sessionHelper.UserMail = user.UserEmail; sessionHelper.Language = this.drpLanguage.Value; // //sammer kong 20050408 statisical for account of loggin user // if( sessionHelper.UserCode != null ) // { // WebStatisical.Instance()["user"].Add( (sessionHelper.UserCode ) ); // } this.Response.Redirect(this.MakeRedirectUrl("./Warehouse/FMaterialQuery.aspx"), false); } catch (Exception ex) { this.lblMessage.Text = MessageCenter.ParserMessage(ex.Message, this.languageComponent1); } }
public void OnDrop(PointerEventData eventData) { if (canDrag == false) { if (eventData.pointerDrag != null) { BagListitem bagListitem = eventData.pointerDrag.GetComponent <BagListitem>(); DropItem dropItem = eventData.pointerDrag.GetComponent <DropItem>(); switch (equippedItemType) { case EquippedItem.BodyGem1: case EquippedItem.BodyGem2: case EquippedItem.HeadGem1: case EquippedItem.HeadGem2: case EquippedItem.Weapon1_Gem1: case EquippedItem.Weapon1_Gem2: case EquippedItem.Weapon2_Gem1: case EquippedItem.Weapon2_Gem2: if (bagListitem != null) { if (bagListitem.Item.itemType == ItemType.Gem) { image.sprite = bagListitem.img.sprite; object[] param = new object[2]; param[0] = equippedItemType; param[1] = bagListitem.Item; MessageCenter.Send_Multparam(Meaningless.EMessageType.EquipItem, param); ItemInfo = bagListitem.Item; bagListitem.UseItem(); canDrag = true; } } if (dropItem != null) { if (dropItem.ItemInfo.itemType == ItemType.Gem) { image.sprite = dropItem.image.sprite; MessageCenter.Send(Meaningless.EMessageType.UnEquipItem, dropItem.equippedItemType); object[] param = new object[2]; param[0] = equippedItemType; param[1] = dropItem.ItemInfo; MessageCenter.Send_Multparam(Meaningless.EMessageType.EquipItem, param); ItemInfo = dropItem.ItemInfo; canDrag = true; dropItem.DropedToOtherSlot(); } } break; case EquippedItem.Head: if (bagListitem != null) { if (bagListitem.Item.itemType == ItemType.Armor) { if (bagListitem.Item.armorProperties.armorType == ArmorType.Head) { image.sprite = bagListitem.img.sprite; BagManager.Instance.EquipItem(equippedItemType, bagListitem.Item); ItemInfo = bagListitem.Item; bagListitem.Equip(); CameraBase.Instance.player.GetComponent <PlayerController>().EquipHelmet(bagListitem.Item.ItemID); NetworkManager.SendPlayerEquipHelmet(bagListitem.Item.ItemID); //发送戴头盔消息 canDrag = true; } } } break; case EquippedItem.Body: if (bagListitem != null) { if (bagListitem.Item.itemType == ItemType.Armor) { if (bagListitem.Item.armorProperties.armorType == ArmorType.Body) { image.sprite = bagListitem.img.sprite; BagManager.Instance.EquipItem(equippedItemType, bagListitem.Item); ItemInfo = bagListitem.Item; bagListitem.Equip(); CameraBase.Instance.player.GetComponent <PlayerController>().EquipClothes(bagListitem.Item.ItemID); NetworkManager.SendPlayerEquipClothe(bagListitem.Item.ItemID); //发送着衫消息 canDrag = true; } } } break; case EquippedItem.Weapon1: if (bagListitem != null) { if (bagListitem.Item.itemType == ItemType.Weapon) { if (bagListitem.Item.weaponProperties.weaponType != WeaponType.Shield) { image.sprite = bagListitem.img.sprite; // MessageCenter.Send_Multparam(Meaningless.EMessageType.EquipItem, param); BagManager.Instance.EquipItem(equippedItemType, bagListitem.Item); BagManager.Instance.CurrentSelected = 1; CameraBase.Instance.player.GetComponent <PlayerController>().ChangeWeapon(1); NetworkManager.SendPlayerEquipWeapon(bagListitem.Item.ItemID); //发送换武器消息 ItemInfo = bagListitem.Item; bagListitem.Equip(); canDrag = true; } } } break; case EquippedItem.Weapon2: if (bagListitem != null) { if (bagListitem.Item.itemType == ItemType.Weapon) { if (bagListitem.Item.weaponProperties.weaponType != WeaponType.Shield) { image.sprite = bagListitem.img.sprite; BagManager.Instance.EquipItem(equippedItemType, bagListitem.Item); BagManager.Instance.CurrentSelected = 2; CameraBase.Instance.player.GetComponent <PlayerController>().ChangeWeapon(2); NetworkManager.SendPlayerEquipWeapon(bagListitem.Item.ItemID); //发送换武器消息 ItemInfo = bagListitem.Item; bagListitem.Equip(); canDrag = true; } } } break; case EquippedItem.Magic1: case EquippedItem.Magic2: if (bagListitem != null) { if (bagListitem.Item.itemType == ItemType.Magic) { image.sprite = bagListitem.img.sprite; BagManager.Instance.EquipItem(equippedItemType, bagListitem.Item); ItemInfo = bagListitem.Item; bagListitem.Equip(); canDrag = true; } } break; } } } }
private void cb_FrostedGlass_SelectionChanged(object sender, SelectionChangedEventArgs e) { SettingHelper.Set_FrostedGlass(cb_FrostedGlass.SelectedIndex); MessageCenter.SendChangedBg(); }
public void PublishTopicalTest() { MessageCenter target = new MessageCenter(); var msg = new message(); target.Publish(msg, "topic"); }
public void MessageCenterConstructorTest() { MessageCenter target = new MessageCenter(); }
private void user_GridView_Bangumi_ItemClick(object sender, ItemClickEventArgs e) { MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(BanInfoPage), (e.ClickedItem as UserInfoModel).param); //this.Frame.Navigate(typeof(MyCollectPage), ); }
private float _percent = 0; // 0 -> 1 #endregion Fields #region Constructors public HidingEffect(MessageCenter ower) { _owner = ower; }
private void list_ASubit_ItemClick(object sender, ItemClickEventArgs e) { MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(VideoViewPage), (e.ClickedItem as UserInfoModel).param); }
private void list_ASubit_ItemClick_1(object sender, ItemClickEventArgs e) { canB = false; MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(VideoViewPage), (e.ClickedItem as GetUserSubmit).aid); }
private void HyperlinkButton_Click(object sender, RoutedEventArgs e) { switch (int.Parse((sender as HyperlinkButton).Tag.ToString())) { case 0: //pivot_Home.SelectedIndex = 0; this.Frame.GoBack(); MessageCenter.SendNavigateTo(NavigateMode.Home, typeof(LiveV2Page)); break; case 1: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.bangumi); //infoFrame.Navigate(typeof(PartPage), ); break; case 2: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.douga); break; case 3: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.music); break; case 4: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.dance); //infoFrame.Navigate(typeof(PartPage), Parts.dance); break; case 5: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.technology); // infoFrame.Navigate(typeof(PartPage), Parts.technology); break; case 6: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.game); //infoFrame.Navigate(typeof(PartPage), Parts.game); break; case 7: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.kichiku); //infoFrame.Navigate(typeof(PartPage), Parts.kichiku); break; case 8: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.ent); //infoFrame.Navigate(typeof(PartPage), Parts.ent); break; case 9: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.movie); //infoFrame.Navigate(typeof(PartPage), Parts.movie); break; case 10: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.tv); //infoFrame.Navigate(typeof(PartPage), Parts.tv); break; case 11: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.fashion); //infoFrame.Navigate(typeof(PartPage), Parts.fashion); break; case 12: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.life); //infoFrame.Navigate(typeof(PartPage), Parts.life); break; case 13: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.ad); //infoFrame.Navigate(typeof(PartPage), Parts.ad); break; case 167: MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(PartsPage), Parts.cn); //infoFrame.Navigate(typeof(PartPage), Parts.ad); break; default: break; } }
private void btn_miniVideo_Click(object sender, RoutedEventArgs e) { MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(LiveVideoPage)); }
private void gv1_ItemClick(object sender, ItemClickEventArgs e) { MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(BanInfoPage), (e.ClickedItem as AllBanModel).season_id); }
private async void webview_WebView_NewWindowRequested(WebView sender, WebViewNewWindowRequestedEventArgs args) { args.Handled = true; var re = await MessageCenter.HandelUrl(args.Uri.AbsoluteUri); if (!re) { var md = new MessageDialog("是否调用外部浏览器打开此链接?"); md.Commands.Add(new UICommand("确定", new UICommandInvokedHandler(async(e) => { await Windows.System.Launcher.LaunchUriAsync(args.Uri); }))); md.Commands.Add(new UICommand("取消", new UICommandInvokedHandler((e) => { }))); await md.ShowAsync(); } //string ban = Regex.Match(args.Uri.AbsoluteUri, @"^http://bangumi.bilibili.com/anime/(.*?)$").Groups[1].Value; //if (ban.Length != 0) //{ // args.Handled = true; // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(BanInfoPage), ban.Replace("/", "")); // // this.Frame.Navigate(typeof(BanInfoPage), ban.Replace("/", "")); // return; //} //string ban2 = Regex.Match(args.Uri.AbsoluteUri, @"^http://www.bilibili.com/bangumi/i/(.*?)$").Groups[1].Value; //if (ban2.Length != 0) //{ // args.Handled = true; // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(BanInfoPage), ban2.Replace("/", "")); // //this.Frame.Navigate(typeof(BanInfoPage), ban2.Replace("/", "")); // return; //} //string ban3 = Regex.Match(args.Uri.AbsoluteUri, @"^bilibili://?av=(.*?)$").Groups[1].Value; //if (ban3.Length != 0) //{ // args.Handled = true; // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(VideoViewPage), ban3.Replace("/", "")); // //this.Frame.Navigate(typeof(VideoViewPage), ban3.Replace("/", "")); // return; //} //string ban4 = Regex.Match(args.Uri.AbsoluteUri, @"^bilibili.com/anime/(.*?)$").Groups[1].Value; //if (ban4.Length != 0) //{ // //args.Handled = true; // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(BanInfoPage), ban4.Replace("/", "")); // // this.Frame.Navigate(typeof(BanInfoPage), ban2.Replace("/", "")); // return; //} //string live = Regex.Match(args.Uri.AbsoluteUri, @"^bilibili://live/(.*?)$").Groups[1].Value; //if (live.Length != 0) //{ // args.Handled = true; // MessageCenter.SendNavigateTo(NavigateMode.Play, typeof(LiveRoomPage), live); // return; //} //string minivideo = Regex.Match(args.Uri.AbsoluteUri + "/", @"vc=(.*?)/").Groups[1].Value; //if (minivideo.Length != 0) //{ // args.Handled = true; // //MessageCenter.SendNavigateTo(NavigateMode.Play, typeof(LiveRoomPage), minivideo); // MessageCenter.ShowMiniVideo(minivideo); // return; //} //string video = Regex.Match(args.Uri.AbsoluteUri + "?", @"av(.*?)\?").Groups[1].Value; //if (video.Length != 0) //{ // args.Handled = true; // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(VideoViewPage), video); // return; //} ////乱写一通的正则 ////正则真的真的真的不会啊- - //if (Regex.IsMatch(args.Uri.AbsoluteUri, "/video/av(.*)?[/|+](.*)?")) //{ // args.Handled = true; // string a = Regex.Match(args.Uri.AbsoluteUri, "/video/av(.*)?[/|+](.*)?").Groups[1].Value; // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(VideoViewPage), a); // //this.Frame.Navigate(typeof(VideoViewPage), a); //} //else //{ // if (Regex.IsMatch(args.Uri.AbsoluteUri + "+", "/video/av(.*)[/|+]")) // { // args.Handled = true; // string a = Regex.Match(args.Uri.AbsoluteUri + "+", "/video/av(.*)[/|+]").Groups[1].Value; // //this.Frame.Navigate(typeof(VideoViewPage), a); // MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(VideoViewPage), a); // } // else // { // if (Regex.IsMatch(args.Uri.AbsoluteUri, @"live.bilibili.com/(.*?)")) // { // args.Handled = true; // string a = Regex.Match(args.Uri.AbsoluteUri + "a", "live.bilibili.com/(.*?)a").Groups[1].Value; // // livePlayVideo(a); // MessageCenter.SendNavigateTo(NavigateMode.Play, typeof(LiveRoomPage), a.Replace("h5/", "")); // } // else // { // args.Handled = true; // var md = new MessageDialog("是否调用外部浏览器打开此链接?"); // md.Commands.Add(new UICommand("确定", new UICommandInvokedHandler(async (e) => { await Windows.System.Launcher.LaunchUriAsync(args.Uri); }))); // md.Commands.Add(new UICommand("取消", new UICommandInvokedHandler((e) => { }))); // await md.ShowAsync(); // //Utils.ShowMessageToast("已禁止跳转:" + args.Uri.AbsoluteUri + "\r\n请点击右上角使用浏览器打开", 3000); // //text.Text = "已禁止跳转:" + args.Uri.AbsoluteUri; // } // } //} }
private void list_Users_ItemClick(object sender, ItemClickEventArgs e) { var item = e.ClickedItem as MusicSearchUserModel; MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(MusicianPage), item.id); }
private void btn_OpenUser_Click(object sender, RoutedEventArgs e) { MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(UserInfoPage), _mid); }
public Silo(ILocalSiloDetails siloDetails, IServiceProvider services) { string name = siloDetails.Name; // Temporarily still require this. Hopefuly gone when 2.0 is released. this.siloDetails = siloDetails; this.SystemStatus = SystemStatus.Creating; var startTime = DateTime.UtcNow; IOptions <ClusterMembershipOptions> clusterMembershipOptions = services.GetRequiredService <IOptions <ClusterMembershipOptions> >(); initTimeout = clusterMembershipOptions.Value.MaxJoinAttemptTime; if (Debugger.IsAttached) { initTimeout = StandardExtensions.Max(TimeSpan.FromMinutes(10), clusterMembershipOptions.Value.MaxJoinAttemptTime); stopTimeout = initTimeout; } var localEndpoint = this.siloDetails.SiloAddress.Endpoint; services.GetService <SerializationManager>().RegisterSerializers(services.GetService <IApplicationPartManager>()); this.Services = services; this.Services.InitializeSiloUnobservedExceptionsHandler(); //set PropagateActivityId flag from node config IOptions <SiloMessagingOptions> messagingOptions = services.GetRequiredService <IOptions <SiloMessagingOptions> >(); RequestContext.PropagateActivityId = messagingOptions.Value.PropagateActivityId; this.loggerFactory = this.Services.GetRequiredService <ILoggerFactory>(); logger = this.loggerFactory.CreateLogger <Silo>(); logger.Info(ErrorCode.SiloGcSetting, "Silo starting with GC settings: ServerGC={0} GCLatencyMode={1}", GCSettings.IsServerGC, Enum.GetName(typeof(GCLatencyMode), GCSettings.LatencyMode)); if (!GCSettings.IsServerGC) { logger.Warn(ErrorCode.SiloGcWarning, "Note: Silo not running with ServerGC turned on - recommend checking app config : <configuration>-<runtime>-<gcServer enabled=\"true\">"); logger.Warn(ErrorCode.SiloGcWarning, "Note: ServerGC only kicks in on multi-core systems (settings enabling ServerGC have no effect on single-core machines)."); } if (logger.IsEnabled(LogLevel.Debug)) { var highestLogLevel = logger.IsEnabled(LogLevel.Trace) ? nameof(LogLevel.Trace) : nameof(LogLevel.Debug); logger.LogWarning( new EventId((int)ErrorCode.SiloGcWarning), $"A verbose logging level ({highestLogLevel}) is configured. This will impact performance. The recommended log level is {nameof(LogLevel.Information)}."); } logger.Info(ErrorCode.SiloInitializing, "-------------- Initializing silo on host {0} MachineName {1} at {2}, gen {3} --------------", this.siloDetails.DnsHostName, Environment.MachineName, localEndpoint, this.siloDetails.SiloAddress.Generation); logger.Info(ErrorCode.SiloInitConfig, "Starting silo {0}", name); var siloMessagingOptions = this.Services.GetRequiredService <IOptions <SiloMessagingOptions> >(); BufferPool.InitGlobalBufferPool(siloMessagingOptions.Value); try { grainFactory = Services.GetRequiredService <GrainFactory>(); } catch (InvalidOperationException exc) { logger.Error(ErrorCode.SiloStartError, "Exception during Silo.Start, GrainFactory was not registered in Dependency Injection container", exc); throw; } // Performance metrics siloStatistics = Services.GetRequiredService <SiloStatisticsManager>(); // The scheduler LocalScheduler = Services.GetRequiredService <OrleansTaskScheduler>(); runtimeClient = Services.GetRequiredService <InsideRuntimeClient>(); // Initialize the message center messageCenter = Services.GetRequiredService <MessageCenter>(); var dispatcher = this.Services.GetRequiredService <Dispatcher>(); messageCenter.RerouteHandler = dispatcher.RerouteMessage; messageCenter.SniffIncomingMessage = runtimeClient.SniffIncomingMessage; // Now the router/directory service // This has to come after the message center //; note that it then gets injected back into the message center.; localGrainDirectory = Services.GetRequiredService <LocalGrainDirectory>(); // Now the activation directory. activationDirectory = Services.GetRequiredService <ActivationDirectory>(); // Now the consistent ring provider RingProvider = Services.GetRequiredService <IConsistentRingProvider>(); catalog = Services.GetRequiredService <Catalog>(); // Now the incoming message agents var messageFactory = this.Services.GetRequiredService <MessageFactory>(); var messagingTrace = this.Services.GetRequiredService <MessagingTrace>(); messageCenter.RegisterLocalMessageHandler(new IncomingMessageHandler( messageCenter, activationDirectory, LocalScheduler, catalog.Dispatcher, messageFactory, this.loggerFactory.CreateLogger <IncomingMessageHandler>(), messagingTrace)); siloStatusOracle = Services.GetRequiredService <ISiloStatusOracle>(); this.membershipService = Services.GetRequiredService <IMembershipService>(); this.SystemStatus = SystemStatus.Created; StringValueStatistic.FindOrCreate(StatisticNames.SILO_START_TIME, () => LogFormatter.PrintDate(startTime)); // this will help troubleshoot production deployment when looking at MDS logs. this.siloLifecycle = this.Services.GetRequiredService <ISiloLifecycleSubject>(); // register all lifecycle participants IEnumerable <ILifecycleParticipant <ISiloLifecycle> > lifecycleParticipants = this.Services.GetServices <ILifecycleParticipant <ISiloLifecycle> >(); foreach (ILifecycleParticipant <ISiloLifecycle> participant in lifecycleParticipants) { participant?.Participate(this.siloLifecycle); } // register all named lifecycle participants IKeyedServiceCollection <string, ILifecycleParticipant <ISiloLifecycle> > namedLifecycleParticipantCollection = this.Services.GetService <IKeyedServiceCollection <string, ILifecycleParticipant <ISiloLifecycle> > >(); foreach (ILifecycleParticipant <ISiloLifecycle> participant in namedLifecycleParticipantCollection ?.GetServices(this.Services) ?.Select(s => s.GetService(this.Services))) { participant?.Participate(this.siloLifecycle); } // add self to lifecycle this.Participate(this.siloLifecycle); logger.Info(ErrorCode.SiloInitializingFinished, "-------------- Started silo {0}, ConsistentHashCode {1:X} --------------", SiloAddress.ToLongString(), SiloAddress.GetConsistentHashCode()); }
private async void LaunchUrl(object paramenter) { await MessageCenter.HandelUrl(paramenter.ToString()); return; }
public RemoteMainControlViewModel(MainWindowViewModel windowViewModel) : base(windowViewModel) { this.AddProfileCommand = this.CreateCommand(async(x) => { string name = await DialogHelper.ShowTextEntry("Name of Profile:"); if (!string.IsNullOrEmpty(name)) { if (ChannelSession.Settings.RemoteProfiles.Any(p => p.Name.Equals(name))) { await DialogHelper.ShowMessage("A profile with the same name already exists"); return; } RemoteProfileModel profile = new RemoteProfileModel(name.ToString()); ChannelSession.Settings.RemoteProfiles.Add(profile); ChannelSession.Settings.RemoteProfileBoards[profile.ID] = new RemoteProfileBoardsModel(profile.ID); this.RefreshProfiles(); this.ProfileSelected(this.Profiles.FirstOrDefault(p => p.ID.Equals(profile.ID))); } }); this.DeleteProfileCommand = this.CreateCommand(async(x) => { if (this.Profile != null) { if (await DialogHelper.ShowConfirmation("Are you sure you want to delete this profile?")) { ChannelSession.Settings.RemoteProfiles.Remove(this.Profile.GetModel()); ChannelSession.Settings.RemoteProfileBoards.Remove(this.profile.ID); this.RefreshProfiles(); this.ProfileSelected(null); this.Item = null; } } }); this.ConnectDeviceCommand = this.CreateCommand(async(parameter) => { if (ChannelSession.Settings.RemoteHostConnection == null || (!await ChannelSession.Services.RemoteService.ValidateConnection(ChannelSession.Settings.RemoteHostConnection))) { ChannelSession.Settings.RemoteHostConnection = await ChannelSession.Services.RemoteService.NewHost(ChannelSession.User.username); ChannelSession.Settings.RemoteClientConnections.Clear(); } if (ChannelSession.Settings.RemoteHostConnection != null) { if (!ChannelSession.Services.RemoteService.IsConnected) { if (!await ChannelSession.Services.RemoteService.InitializeConnection(ChannelSession.Settings.RemoteHostConnection)) { await DialogHelper.ShowMessage("Could not connect to Remote service, please try again"); return; } } string shortCode = await DialogHelper.ShowTextEntry("Device 6-Digit Code:"); if (!string.IsNullOrEmpty(shortCode)) { if (shortCode.Length != 6) { await DialogHelper.ShowMessage("The code entered is not valid"); return; } RemoteConnectionModel clientConnection = await ChannelSession.Services.RemoteService.ApproveClient(ChannelSession.Settings.RemoteHostConnection, shortCode, rememberClient: true); if (clientConnection != null) { if (!clientConnection.IsTemporary) { ChannelSession.Settings.RemoteClientConnections.Add(clientConnection); } await DialogHelper.ShowMessage(string.Format("The device {0} has been approved." + Environment.NewLine + Environment.NewLine + "To configure it, head to Settings -> Remote.", clientConnection.Name)); } else { await DialogHelper.ShowMessage("A client device could not be found with the specified code"); return; } } } else { await DialogHelper.ShowMessage("Could not connect to Remote service, please try again"); } }); this.DownloadAppleCommand = this.CreateCommand((x) => { Process.Start("https://itunes.apple.com/us/app/mix-it-up-remote/id1459364145"); return(Task.FromResult(0)); }); this.DownloadAndroidCommand = this.CreateCommand((x) => { Process.Start("https://play.google.com/store/apps/details?id=com.MixItUpApp.Remote.Beta"); return(Task.FromResult(0)); }); MessageCenter.Register <RemoteCommandItemViewModel>(RemoteEmptyItemControlViewModel.NewRemoteCommandEventName, this, (command) => { if (this.Board != null) { this.Board.AddItem(command); this.RefreshBoardItem(command.XPosition, command.YPosition); this.Item = this.GetItem(command.XPosition, command.YPosition); } }); MessageCenter.Register <RemoteFolderItemViewModel>(RemoteEmptyItemControlViewModel.NewRemoteFolderEventName, this, async(folder) => { if (this.NavigationNames.Count() > 2) { await DialogHelper.ShowMessage("Boards can only be up to 2 layers deep"); return; } if (this.Board != null) { RemoteBoardModel newBoard = new RemoteBoardModel(isSubBoard: true); folder.BoardID = newBoard.ID; ChannelSession.Settings.RemoteProfileBoards[this.Profile.ID].Boards[folder.BoardID] = newBoard; this.Board.AddItem(folder); this.RefreshBoardItem(folder.XPosition, folder.YPosition); this.Item = this.GetItem(folder.XPosition, folder.YPosition); } }); MessageCenter.Register <RemoteCommandItemControlViewModel>(RemoteCommandItemControlViewModel.RemoteCommandDetailsEventName, this, (command) => { this.Item = command; }); MessageCenter.Register <RemoteFolderItemControlViewModel>(RemoteFolderItemControlViewModel.RemoteFolderDetailsEventName, this, (folder) => { this.Item = folder; }); MessageCenter.Register <RemoteFolderItemViewModel>(RemoteFolderItemControlViewModel.RemoteFolderNavigationEventName, this, (folder) => { if (ChannelSession.Settings.RemoteProfileBoards[this.Profile.ID].Boards.ContainsKey(folder.BoardID)) { this.Board = new RemoteBoardViewModel(ChannelSession.Settings.RemoteProfileBoards[this.Profile.ID].Boards[folder.BoardID], this.Board); this.RefreshBoard(); this.AddRemoveNavigationName(folder.Name); this.Item = null; } }); MessageCenter.Register <RemoteBoardViewModel>(RemoteBackItemControlViewModel.RemoteBackNavigationEventName, this, (board) => { this.Board = board; this.RefreshBoard(); this.AddRemoveNavigationName(null); this.Item = null; }); MessageCenter.Register <RemoteItemViewModelBase>(RemoteItemControlViewModelBase.RemoteDeleteItemEventName, this, (item) => { this.Board.RemoveItem(item.XPosition, item.YPosition); this.RefreshBoardItem(item.XPosition, item.YPosition); this.Item = null; }); }
/// <summary> /// UIMain_StepOne动画片段结尾事件绑定 /// </summary> private void OnMsgOneOver() { MessageCenter.SendMessage((int)MsgEnum.StepOneOver); }
private float _percent = 0; // 0 -> 1 #endregion Fields #region Constructors public ShowingEffect(MessageCenter ower) { _owner = ower; }
public void PublishTest() { MessageCenter target = new MessageCenter(); var msg = new message(); target.Publish(msg); }
public Collection<MessageCenter> GetMessages(string numberOfRows, string pageIndex, string sortColumnName, string sortOrderBy, out int totalRecords) { Collection<MessageCenter> messages = new Collection<MessageCenter>(); using (OdbcConnection connection = new OdbcConnection(connectionString)) { using (OdbcCommand command = new OdbcCommand()) { command.Connection = connection; command.CommandText = "{CALL MessageCenter_Search{0}(?,?,?,?,?)}"; command.CommandType = CommandType.StoredProcedure; OdbcParameter paramPageIndex = new OdbcParameter("@PageIndex", OdbcType.Int); paramPageIndex.Value = Convert.ToInt32(pageIndex); command.Parameters.Add(paramPageIndex); OdbcParameter paramColumnName = new OdbcParameter("@SortColumnName", OdbcType.VarChar, 50); paramColumnName.Value = sortColumnName; command.Parameters.Add(paramColumnName); OdbcParameter paramSortorderBy = new OdbcParameter("@SortOrderBy", OdbcType.VarChar, 4); paramSortorderBy.Value = sortOrderBy; command.Parameters.Add(paramSortorderBy); OdbcParameter paramNumberOfRows = new OdbcParameter("@NumberOfRows", OdbcType.Int); paramNumberOfRows.Value = Convert.ToInt32(numberOfRows); command.Parameters.Add(paramNumberOfRows); OdbcParameter paramTotalRecords = new OdbcParameter("@TotalRecords", OdbcType.Int); totalRecords = 0; paramTotalRecords.Value = totalRecords; paramTotalRecords.Direction = ParameterDirection.Output; command.Parameters.Add(paramTotalRecords); //OdbcParameter paramfield = new OdbcParameter("@field", OdbcType.VarChar,200); //paramfield.Value=field; //command.Parameters.Add(paramfield); //OdbcParameter paramvalue = new OdbcParameter("@val", OdbcType.VarChar,200); //paramvalue.Value=val; //command.Parameters.Add(paramvalue); connection.Open(); using (OdbcDataReader dataReader = command.ExecuteReader()) { MessageCenter message; while (dataReader.Read()) { //MessageOID, SendFrom, Recipient, Subject, Status, Mark, MessageBody, CreatedDate message = new MessageCenter(); message.MessageOID = (int)dataReader["MessageOID"]; message.CreatedDate = Convert.ToDateTime(dataReader["CreatedDate"]); message.Mark = Convert.ToString(dataReader["Mark"]) == "Mark" ? 1 : 0; message.MessageBody = Convert.ToString(dataReader["MessageBody"]); message.Recipient = Convert.ToString(dataReader["Recipient"]); message.SendFrom = Convert.ToInt32(dataReader["SendFrom"]); message.Status = Convert.ToString(dataReader["Status"]); message.Subject = Convert.ToString(dataReader["Subject"]); message.MarkURL = (message.Mark == 1) ? "~/images/StarIconGold.png" : ""; messages.Add(message); } } totalRecords = (int)paramTotalRecords.Value; } return messages; } }
private float _percent = 0; // 0 -> 1 #endregion Fields #region Constructors public HidingEffect(MessageCenter ower) { _owner = ower; Font = SCSServices.Instance.DebugFont; }
private async Task StreamingInitialize() { var implicitSubscriberTable = await MessageCenter.GetImplicitStreamSubscriberTable(this.InternalGrainFactory); clientProviderRuntime.StreamingInitialize(implicitSubscriberTable); }
public void ClearSubscriptionsTest() { MessageCenter target = new MessageCenter(); target.ClearSubscriptions(); }
private void btn_User_Click(object sender, RoutedEventArgs e) { MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(UserInfoPage), (sender as HyperlinkButton).Tag.ToString()); }
public void SubscribeTopicalTest() { MessageCenter target = new MessageCenter(); target.Subscribe<message>(msg => { }, "topic"); }
private void gridview_Hot_ItemClick(object sender, ItemClickEventArgs e) { MessageCenter.SendNavigateTo(NavigateMode.Play, typeof(LiveRoomPage), (e.ClickedItem as HomeLiveModel).room_id); //PlayEvent((e.ClickedItem as HomeLiveModel).room_id); }
public Collection<MessageCenter> GetSentMessageByUser(int userOID) { Collection<MessageCenter> messages = new Collection<MessageCenter>(); using (OdbcConnection connection = new OdbcConnection(connectionString)) { using (OdbcCommand command = new OdbcCommand()) { //command.Connection = connection; ////command.CommandText = "UPDATE dbo.Users SET " + "UserName='******', " + " FirstName='" + firstName + "', " + " MiddleName='" + middleName + "'," + "LastName='" + lastName + "'," + "EmailID='" + emailID + "'" + " where UserID='" + userid + "' "; //command.CommandText = "INSERT INTO Users (UserName, FirstName, LastName, MiddleName, EmailID) VALUES (" + "'" + userName + "','" + firstName + "','" + lastName + "','" + middleName + "','" + emailID + "')"; //connection.Open(); //command.ExecuteNonQuery(); command.Connection = connection; command.CommandText = "{CALL Message_GetByUserOID(?)}"; command.CommandType = CommandType.StoredProcedure; OdbcParameter paramODI = new OdbcParameter("@UserOID", OdbcType.Int); paramODI.Value = Convert.ToInt32(userOID); command.Parameters.Add(paramODI); connection.Open(); using (OdbcDataReader dataReader = command.ExecuteReader()) { MessageCenter message; while (dataReader.Read()) { //MessageOID, SendFrom, Recipient, Subject, Status, Mark, MessageBody, CreatedDate message = new MessageCenter(); message.MessageOID = (int)dataReader["MessageOID"]; message.CreatedDate = Convert.ToDateTime(dataReader["CreatedDate"]); //message.Mark = Convert.ToString(dataReader["Mark"]) == "Mark" ? 1 : 0; message.Mark = Convert.ToInt32(dataReader["Mark"]); //This must comes from "Mark" message.MessageBody = Convert.ToString(dataReader["MessageBody"]); message.Recipient = Convert.ToString(dataReader["Recipient"]); message.SendFrom = Convert.ToInt32(dataReader["SendFrom"]); message.Status = Convert.ToString(dataReader["Status"]); message.Subject = Convert.ToString(dataReader["Subject"]); message.MarkURL = (message.Mark == 1) ? "~/images/StarIconGold.png" : ""; messages.Add(message); } } } return messages; } }
private void btn_search_Click(object sender, RoutedEventArgs e) { MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(LiveSearchPage)); }
private void User_ListView_FavouriteVideo_ItemClick(object sender, ItemClickEventArgs e) { MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(VideoViewPage), (e.ClickedItem as GetFavouriteBoxsVideoModel).aid); }
public void PublishTopicalToSubscribedAltTopicalTest() { //arrange MessageCenter target = new MessageCenter(); string res = null; target.Subscribe<message>(a => { res = a.txt; }, "topic"); var msg = new message { txt = "hi" }; //act target.Publish(msg, "topica"); //assert Assert.AreNotEqual(res, "hi"); }
protected void Page_Load(object sender, System.EventArgs e) { PostBackTrigger trigger = new PostBackTrigger(); trigger.ControlID = this.txtItemCodeQuery.ID; (this.Form1.FindControl("up1") as UpdatePanel).Triggers.Add(trigger); //this.imgItemCode.Attributes["onclick"] = "return SelectItem();"; string path = this.Request.Url.AbsoluteUri; path = path.Substring(0, path.LastIndexOf("/") + 1); ClientScript.RegisterHiddenField("_server", path); ClientScript.RegisterHiddenField("_Error_Input_Empty", MessageCenter.ParserMessage("$Error_Input_Empty", this.languageComponent1)); ClientScript.RegisterHiddenField("_Error_Number_Format_Error", MessageCenter.ParserMessage("$Error_Number_Format_Error", this.languageComponent1)); ClientScript.RegisterHiddenField("_Error_Number_TooLittle", MessageCenter.ParserMessage("$Error_Number_TooLittle", this.languageComponent1)); //日期控件多语言 string strDatepickLangType = string.Empty; switch (this.languageComponent1.Language) { case "CHS": strDatepickLangType = "zh-CN"; break; case "CHT": strDatepickLangType = "zh-TW"; break; case "ENU": break; default: break; } string strDatepickerScript = @" if($('.datepicker').html()!=null) { //JqueryUi 日期控件 $('.datepicker').datepicker({ showOn: 'both', buttonImage: '" + this.VirtualHostRoot + @"skin/images/calendar.gif', buttonImageOnly: true, changeMonth: true, changeYear: true, showButtonPanel: true, dateFormat: 'yy-mm-dd', buttonText: 'Choose Date', //closeText: 'Close', constrainInput: true, beforeShow: function (input, inst) { $(this).select(); //只读或者不可用的时候,不弹出 if ($(this).attr('disabled') == 'disabled' || $(this).attr('readOnly') == 'readOnly') { return false; } $('#SPC_Chart').css('margin-top','220px'); }, onClose: function (input, inst) { $('#SPC_Chart').css('margin-top','0px'); } }).datepicker('option', $.datepicker.regional['" + strDatepickLangType + @"']); $('.datepicker').addClass('textbox'); }"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "strDatepickerScript", strDatepickerScript, true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "strDatepickerScript", strDatepickerScript, true); if (!Page.IsPostBack) { // 初始化页面语言 this.InitPageLanguage(this.languageComponent1, false); this.txtDateQuery.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.chbAuto.Checked = true; SetLanguage(); } }
public MessageCenter GetMessageByOID(int mOID) { MessageCenter msg = null; using (OdbcConnection connection = new OdbcConnection(connectionString)) { using (OdbcCommand command = new OdbcCommand()) { command.Connection = connection; command.CommandText = "{CALL MessageCenter_GetByOID(?)}"; command.CommandType = CommandType.StoredProcedure; OdbcParameter paramODI = new OdbcParameter("@MessageOID", OdbcType.Int); paramODI.Value = Convert.ToInt32(mOID); command.Parameters.Add(paramODI); connection.Open(); using (OdbcDataReader dataReader = command.ExecuteReader()) { dataReader.Read(); //MessageOID, SendFrom, Recipient, Subject, Status, Mark, MessageBody, CreatedDate msg = new MessageCenter(); msg.MessageOID = (int)dataReader["MessageOID"]; msg.CreatedDate = Convert.ToDateTime(dataReader["CreatedDate"]); //msg.Mark = Convert.ToString(dataReader["Mark"]) == "Mark" ? 1 : 0; msg.Mark = Convert.ToInt32(dataReader["Mark"]); msg.MessageBody = Convert.ToString(dataReader["MessageBody"]); msg.Recipient = Convert.ToString(dataReader["Recipient"]); msg.SendFrom = Convert.ToInt32(dataReader["SendFrom"]); msg.Status = Convert.ToString(dataReader["Status"]); msg.Subject = Convert.ToString(dataReader["Subject"]); msg.MarkURL = (msg.Mark == 1) ? "~/images/StarIconGold.png" : ""; } } } return msg; }