public void Delete() { MessageWindow window = new MessageWindow { Caption = "Delete entry", Message = "Delete the selected menu entry?", Type = MessageBoxButtons.YesNo }; window.Show(); if (window.Result != DialogResult.Yes) { return; } if (_state.IsMenuSelected) { DeleteMenu(); } else { DeleteExecutableItem(); } }
void OnLocationClicked(MessageWindow.MessageItem item) { Vector3 messageLocation = ((MessageWindow.LocationMessageItem)item).GetLocation(); Camera.main.transform.position = new Vector3(messageLocation.x, Camera.main.transform.position.y, messageLocation.z); }
public Form1() { InitializeComponent(); this.g = new Global(); msgWindow = new MyMessageWindow(g); loadU(); }
// Use this for initialization void Start () { checkifgotcode = GameObject.Find ("MasterMind").GetComponent<ItemUseStates>(); // hascard = GetComponent<ItemUseStates>().; renderer.material.mainTexture = idle; //quest = gameObject.GetComponent<MessageWindow>(); quest = GameObject.Find ("MasterMind").GetComponent<MessageWindow>(); }
/// <summary> /// A class representing each IM session and its associated button and window objects /// </summary> public MessageBarButton(string targetName, UUID targetID, UUID imSessionID) { TargetName = targetName; TargetID = targetID; IMSessionID = imSessionID; this.Text = targetName; Window = new MessageWindow(targetName); Window.FormClosing += new FormClosingEventHandler(Window_FormClosing); Window.OnTextInput += new MessageWindow.TextInputCallback(Window_OnTextInput); }
void Start () { inventoryList = new List<Item>(); nullItem = new Item("null",null,-1); holdingItem = nullItem; paddingFromEdge = new Vector2(Screen.width/100,Screen.width/100); startPosition = new Vector2(Screen.width,Screen.height); quest = GameObject.Find ("MasterMind").GetComponent<MessageWindow>(); //slidyUnpacked = new Texture2D(1500,156); //slidyUnpacked.SetPixels(slidyThingie.GetPixels(547,1893,1500,156)); //slidyThingie.pixelInset = new Rect(547,1893,1500,156); //seans holding item icon thingy mo_anim = GetComponent<Mouse_Animation>(); }
// Use this for initialization void Start () { m_mastermind = GameObject.Find("MasterMind"); loggedin = m_mastermind.GetComponent<ItemUseStates>().isLoggedIn; screen = GameObject.Find ("computerscreen"); screen.renderer.enabled = false; if(loggedin){ screen.renderer.material.SetTexture("_MainTex",inboxLayout); addemails(); } played = m_mastermind.GetComponent<ItemUseStates>().poweroutOcurred; quest = GameObject.Find ("MasterMind").GetComponent<MessageWindow>(); }
private static void WatchAll() { MessageWindow messageWindow = new MessageWindow(); messageWindow.MessageReceived += (IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) => { if (msg == (int)MessageWindow.Messages.WM_DEVICECHANGE) { DelayedRefresh(); handled = true; return new IntPtr(1); } return IntPtr.Zero; }; SetupDevice.RegisterDeviceNotification(messageWindow.Handle); }
/// <summary> /// Private constructor. The public way to access this class is through the static Current property. /// </summary> private SystemParameters2() { // This window gets used for calculations about standard caption button locations // so it has WS_OVERLAPPEDWINDOW as a style to give it normal caption buttons. // This window may be shown during calculations of caption bar information, so create it at a location that's likely offscreen. _messageHwnd = new MessageWindow((CS)0, WS.OVERLAPPEDWINDOW | WS.DISABLED, (WS_EX)0, new Rect(-16000, -16000, 100, 100), "", _WndProc); _messageHwnd.Dispatcher.ShutdownStarted += (sender, e) => Utility.SafeDispose(ref _messageHwnd); // Fixup the default values of the DPs. _InitializeIsGlassEnabled(); _InitializeGlassColor(); _InitializeCaptionHeight(); _InitializeWindowNonClientFrameThickness(); _InitializeWindowResizeBorderThickness(); _InitializeCaptionButtonLocation(); _InitializeSmallIconSize(); _InitializeHighContrast(); _InitializeThemeInfo(); // WindowCornerRadius isn't exposed by true system parameters, so it requires the theme to be initialized first. _InitializeWindowCornerRadius(); _UpdateTable = new Dictionary<WM, List<_SystemMetricUpdate>> { { WM.THEMECHANGED, new List<_SystemMetricUpdate> { _UpdateThemeInfo, _UpdateHighContrast, _UpdateWindowCornerRadius, _UpdateCaptionButtonLocation, } }, { WM.SETTINGCHANGE, new List<_SystemMetricUpdate> { _UpdateCaptionHeight, _UpdateWindowResizeBorderThickness, _UpdateSmallIconSize, _UpdateHighContrast, _UpdateWindowNonClientFrameThickness, _UpdateCaptionButtonLocation, } }, { WM.DWMNCRENDERINGCHANGED, new List<_SystemMetricUpdate> { _UpdateIsGlassEnabled } }, { WM.DWMCOMPOSITIONCHANGED, new List<_SystemMetricUpdate> { _UpdateIsGlassEnabled } }, { WM.DWMCOLORIZATIONCOLORCHANGED, new List<_SystemMetricUpdate> { _UpdateGlassColor } }, }; }
protected override async void OnStart() { var controller = new KeyboardController<int>(); controller.BindKey(Keys.Z, 0); var window = new MessageWindow() { Texture = Engine.Graphics.CreateTexture2D("TextWindow.png"), Scale = new Vector2DF(0.5f, 1), }; window.TextObject.Font = Engine.Graphics.CreateDynamicFont("", 32, new Color(0, 0, 0, 255), 0, new Color(0, 0, 0, 0)); window.TextObject.Position = new Vector2DF(30, 25); window.WaitIndicator.Texture = Engine.Graphics.CreateTexture2D("ZKey.png"); window.WaitIndicator.Position = new Vector2DF(500, 110); window.SetReadControl(controller, 0); Engine.AddObject2D(window); await window.TalkMessageAsync(new string[] { "あいうえお", "かきくけこ", "口から\n魚の骨が\nどんどん出てくる" }); window.Clear(); }
// Use this for initialization void Start() { consolePosition.y = Screen.height - consoleSize.y; consoleRect = new Rect(consolePosition.x, consolePosition.y, consoleSize.x, consoleSize.y); consoleWindow = new MessageWindow(consoleSize, consoleSkin); consoleWindow.AddMessage( new MessageWindow.StringMessageItem(20, "This is an extra long message. This will show the messgaes will" + " simply wrap around and the message below will be placed right after," + " despite the wrapping")); consoleWindow.AddMessage( new MessageWindow.StringMessageItem(20, "We can also force a line break with \\n" + " anywhere we \n want \n the \n breaks to be.")); consoleWindow.AddMessage( new MessageWindow.StringMessageItem(20, "Press Space to add more messages!")); }
static void EnsureInitialized() { lock (lockObject) { if (window == null) { context = AsyncOperationManager.SynchronizationContext; using (ManualResetEvent mre = new ManualResetEvent(false)) { Thread t = new Thread(() => { window = new MessageWindow(); handle = window.Handle; mre.Set(); Application.Run(); }); t.Name = "MessageEvents"; t.IsBackground = true; t.Start(); mre.WaitOne(); } } } }
/// <summary> /// Initializes a new instance of the <see cref="ShellContextMenu"/> class. /// </summary> /// <param name="shellView">The ShellView the ContextMenu is associated with</param> /// <param name="Use_GetNewContextMenu"></param> public ShellContextMenu(ShellView shellView, bool Use_GetNewContextMenu) { this._ShellView = shellView; IntPtr iContextMenu = IntPtr.Zero; if (Use_GetNewContextMenu) this.GetNewContextMenu(_ShellView.CurrentFolder, out iContextMenu, out m_ComInterface); else this.GetOpenWithContextMenu(_ShellView.SelectedItems.ToArray(), out iContextMenu, out m_ComInterface); m_ComInterface2 = m_ComInterface as IContextMenu2; m_ComInterface3 = m_ComInterface as IContextMenu3; m_MessageWindow = new MessageWindow(this); }
void OnMouseClicked() { GameObject clickTgt = GetObjectAt(Mouse.PositionOnScreen); if (clickTgt != null && clickTgt.Tag is string) { string stag = clickTgt.Tag as string; if (stag.Contains("_indicator")) { string author = stag.Replace("_indicator", ""); if (stateQueueMutex.WaitOne(3000)) { StringBuilder allMsgs = new StringBuilder(); // MessageWindow does not have vertical scroll, so limit to 20 or so last messages for (int i = Math.Max(0, detailedMessages[author].Count-SHOW_THIS_MANY_MESSAGES); i < detailedMessages[author].Count; i++) { allMsgs.Append(detailedMessages[author][i]+ "\n"); } stateQueueMutex.ReleaseMutex(); // Show error messages. MessageWindow ikkuna = new MessageWindow(allMsgs.ToString()); Add(ikkuna); } } } }
void Initialize(IListItemEx[] items) { this._Items = items; IntPtr[] pidls = new IntPtr[items.Length]; IListItemEx parent = null; for (int n = 0; n < items.Length; ++n) { pidls[n] = Shell32.ILFindLastID(items[n].PIDL); if (parent == null) { if (items[n].ParsingName.Equals(ShellItem.Desktop.ParsingName)) { parent = FileSystemListItem.ToFileSystemItem(IntPtr.Zero, ShellItem.Desktop.Pidl); } else { parent = items[n].Parent; } } else if (!items[n].Parent.Equals(parent)) { throw new Exception("All shell items must have the same parent"); } } if (items.Length == 0) { var desktop = KnownFolders.Desktop as ShellItem; var ishellViewPtr = desktop.GetIShellFolder().CreateViewObject(IntPtr.Zero, typeof(IShellView).GUID); var view = Marshal.GetObjectForIUnknown(ishellViewPtr) as IShellView; view.GetItemObject(SVGIO.SVGIO_BACKGROUND, typeof(IContextMenu).GUID, out _Result); Marshal.ReleaseComObject(view); } else { parent.GetIShellFolder().GetUIObjectOf(IntPtr.Zero, (uint)pidls.Length, pidls, typeof(IContextMenu).GUID, 0, out _Result); } m_ComInterface = (IContextMenu)Marshal.GetTypedObjectForIUnknown(_Result, typeof(IContextMenu)); m_ComInterface2 = m_ComInterface as IContextMenu2; m_ComInterface3 = m_ComInterface as IContextMenu3; m_MessageWindow = new MessageWindow(this); }
public void Show() { _VerifyMutability(); Stream imageStream = null; try { // Try to use the filepath first. If it's not provided or not available, use the embedded resource. if (!string.IsNullOrEmpty(ImageFileName) && File.Exists(ImageFileName)) { try { imageStream = new FileStream(ImageFileName, FileMode.Open); } catch (IOException) { } } if (imageStream == null) { imageStream = _resourceManager.GetStream(ResourceName, CultureInfo.CurrentUICulture); if (imageStream == null) { throw new IOException("The resource could not be found."); } } Size bitmapSize; _hBitmap = _CreateHBITMAPFromImageStream(imageStream, out bitmapSize); Point location = new Point( (NativeMethods.GetSystemMetrics(SM.CXSCREEN) - bitmapSize.Width) / 2, (NativeMethods.GetSystemMetrics(SM.CYSCREEN) - bitmapSize.Height) / 2); // Pass a null WndProc. Let the MessageWindow use DefWindowProc. _hwndWrapper = new MessageWindow( CS.HREDRAW | CS.VREDRAW, WS.POPUP | WS.VISIBLE, WS_EX.WINDOWEDGE | WS_EX.TOOLWINDOW | WS_EX.LAYERED | (IsTopMost ? WS_EX.TOPMOST : 0), new Rect(location, bitmapSize), "Splash Screen", null); byte opacity = (byte)(FadeInDuration > TimeSpan.Zero ? 0 : 255); using (SafeDC hScreenDC = SafeDC.GetDesktop()) { using (SafeDC memDC = SafeDC.CreateCompatibleDC(hScreenDC)) { IntPtr hOldBitmap = NativeMethods.SelectObject(memDC, _hBitmap); RECT hwndRect = NativeMethods.GetWindowRect(_hwndWrapper.Handle); POINT hwndPos = hwndRect.Position; SIZE hwndSize = hwndRect.Size; POINT origin = new POINT(); BLENDFUNCTION bf = _BaseBlendFunction; bf.SourceConstantAlpha = opacity; NativeMethods.UpdateLayeredWindow(_hwndWrapper.Handle, hScreenDC, ref hwndPos, ref hwndSize, memDC, ref origin, 0, ref bf, ULW.ALPHA); NativeMethods.SelectObject(memDC, hOldBitmap); } } if (CloseOnMainWindowCreation) { Dispatcher.CurrentDispatcher.BeginInvoke( DispatcherPriority.Loaded, (DispatcherOperationCallback)delegate(object splashObj) { var splashScreen = (SplashScreen)splashObj; if (!splashScreen._isClosed) { splashScreen.Close(); } return null; }, this); } _dispatcher = Dispatcher.CurrentDispatcher; if (FadeInDuration > TimeSpan.Zero) { _fadeInEnd = DateTime.UtcNow + FadeInDuration; _dt = new DispatcherTimer(FadeInDuration, DispatcherPriority.Normal, _FadeInTick, _dispatcher); _dt.Start(); } } finally { Utility.SafeDispose(ref imageStream); } }
public override void buttonEventBase(GameObject gameObj) { if (gameObj.name == "close") { msg.msgEvent = msg_event.dialogCancel; this.dialogCloseUnlockUI = true; finishWindow(); callback(msg); } //最小值 else if (gameObj.name == "min") { now = min; updateDisplayeNumber(); coverDistanceToOne(); MaskWindow.UnlockUI(); } //最大值 else if (gameObj.name == "max") { now = max; updateDisplayeNumber(); coverDistanceToOne(); MaskWindow.UnlockUI(); } //加 else if (gameObj.name == "add") { addNumber(); MaskWindow.UnlockUI(); } //减 else if (gameObj.name == "reduce") { reduceNumber(); MaskWindow.UnlockUI(); } calculateTotal(); //选定确认 if (gameObj.name == "buttonOk") { GuideManager.Instance.doGuide(); if (item.GetType() == typeof(Goods) || item.GetType() == typeof(NoticeActiveGoods)) { if (!canBuy()) { //MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage ("s0355", costStr)); if (costType == PrizeType.PRIZE_RMB) { finishWindow(); EventDelegate.Add(OnHide, () => { MessageWindow.ShowRecharge(LanguageConfigManager.Instance.getLanguage("s0355", costStr)); }); } else { UiManager.Instance.openDialogWindow <MessageWindow> ( (win) => { win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("s0355", costStr), null); }); } return; } if (!checkSotreFull()) { msg.msgEvent = msg_event.dialogOK; } else { UiManager.Instance.openDialogWindow <MessageWindow> ( (win) => { win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, str + "," + LanguageConfigManager.Instance.getLanguage("s0207"), null); }); } } else { if (item.GetType() == typeof(Prop)) { Prop prop = item as Prop; PropSample sample = PropSampleManager.Instance.getPropSampleBySid(prop.sid); //精灵宝箱 if (sample.sid == 71070) { if (StorageManagerment.Instance.isRoleStorageFull(StringKit.toInt(numberText.text))) { str = LanguageConfigManager.Instance.getLanguage("s0192", LanguageConfigManager.Instance.getLanguage("cardName")); MessageWindow.ShowAlert(str); return; } } } else if (item.GetType() == typeof(BuyStruct)) { msg.msgNum = now; } else if (item.GetType() == typeof(BossAttackTimeBuyStruct)) { msg.msgNum = now; } msg.msgEvent = msg_event.dialogOK; } finishWindow(); EventDelegate.Add(OnHide, () => { callback(msg); }); } //MaskWindow.UnlockUI (); }
public override void buttonEventBase(GameObject gameObj) { base.buttonEventBase(gameObj); if (gameObj.name == "close") { FPortManager.Instance.getFPort <PvpGetInfoFPort> ().access((hasPvp) => { if (BattleManager.Instance != null) { if (isWin && !hasPvp) { setAwardCallBack(); } else { BattleManager.Instance .awardFinfish(); } } else { finishWindow(); MaskWindow.UnlockUI(); } if (MissionManager.instance != null) { MissionManager.instance.showAll(); MissionManager.instance.setBackGround(); } }); } else if (gameObj.name == "friendButton") { if (FriendsManagerment.Instance.isFull()) { return; } applyFriend(); } else if (gameObj.name == "nextButton") { if (!isWin) { PvpInfoManagerment.Instance.clearDate(); BattleManager.Instance.awardFinfish(); return; } FPortManager.Instance.getFPort <PvpGetInfoFPort> ().access((hasPvp) => { //如果没pvp,表示三胜出局 if (!hasPvp) { setAwardCallBack(); } else if (PvpInfoManagerment.Instance.getPvpInfo().rule == "cup") { if (PvpInfoManagerment.Instance.getCurrentRound() < 3) { //这里可能一直等到pvp超时 if (PvpInfoManagerment.Instance.getPvpTime(null) <= 0) { MessageWindow.ShowAlert(Language("s0215"), (msg) => { if (BattleManager.Instance != null) { BattleManager.Instance.awardFinfish(); } else { finishWindow(); } }); } else { UiManager.Instance.switchWindow <PvpCupWindow> (); } } else { setAwardCallBack(); } } else if (PvpInfoManagerment.Instance.getPvpInfo().rule == "match") { if (PvpInfoManagerment.Instance.getCurrentRound() < 3) { //这里可能一直等到pvp超时 if (PvpInfoManagerment.Instance.getPvpTime(null) <= 0) { MessageWindow.ShowAlert(Language("s0215"), (msg) => { if (BattleManager.Instance != null) { BattleManager.Instance.awardFinfish(); } else { finishWindow(); } }); } else { UiManager.Instance.switchWindow <PvpMainWindow> (); } } else { setAwardCallBack(); } } }); } }
private void Start() { message = BattleMessage.GetWindow(); }
private void UnlockUser() { CurrentUser.IsLocked = false; MessageWindow.GetInstance("Пользователь разблокирован.", MessageType.Info); }
/// <summary> 命令通用方法 </summary> protected override async void RelayMethod(object obj) { string command = obj?.ToString(); // Do:对话消息 if (command == "Button.ShowDialogMessage") { await MessageService.ShowSumitMessge("这是消息对话框?"); } // Do:等待消息 else if (command == "Button.ShowWaittingMessge") { await MessageService.ShowWaittingMessge(() => Thread.Sleep(2000)); } // Do:百分比进度对话框 else if (command == "Button.ShowPercentProgress") { Action <IPercentProgress> action = l => { for (int i = 0; i < 100; i++) { l.Value = i; Thread.Sleep(50); } Thread.Sleep(1000); MessageService.ShowSnackMessageWithNotice("加载完成!"); }; await MessageService.ShowPercentProgress(action); } // Do:文本进度对话框 else if (command == "Button.ShowStringProgress") { Action <IStringProgress> action = l => { for (int i = 1; i <= 100; i++) { l.MessageStr = $"正在提交当前页第{i}份数据,共100份"; Thread.Sleep(50); } Thread.Sleep(1000); MessageService.ShowSnackMessageWithNotice("提交完成:成功100条,失败0条!"); }; await MessageService.ShowStringProgress(action); } // Do:确认取消对话框 else if (command == "Button.ShowResultMessge") { var result = await MessageService.ShowResultMessge("确认要退出系统?"); if (result) { MessageService.ShowSnackMessageWithNotice("你点击了取消"); } else { MessageService.ShowSnackMessageWithNotice("你点击了确定"); } } // Do:提示消息 else if (command == "Button.ShowSnackMessage") { MessageService.ShowSnackMessageWithNotice("这是提示消息?"); } // Do:气泡消息 else if (command == "Button.ShowNotifyMessage") { MessageService.ShowNotifyMessage("你有一条报警信息需要处理,请检查", "Notify By HeBianGu"); } // Do:气泡消息 else if (command == "Button.ShowIdentifyNotifyMessage") { MessageService.ShowNotifyDialogMessage("自定义气泡消息" + DateTime.Now.ToString("yyyy-mm-dd HH:mm:ss"), "友情提示", 5); } // Do:气泡消息 else if (command == "Button.ShowWindowSumitMessage") { MessageWindow.ShowSumit("这是窗口提示消息"); } // Do:气泡消息 else if (command == "Button.ShowWindowResultMessage") { MessageWindow.ShowDialog("这是窗口提示消息"); } // Do:气泡消息 else if (command == "Button.ShowWindowIndentifyMessage") { List <Tuple <string, Action <MessageWindow> > > acts = new List <Tuple <string, Action <MessageWindow> > >(); Action <MessageWindow> action = l => { l.CloseAnimation(l); l.Result = true; MessageService.ShowSnackMessageWithNotice("你点到我了!"); }; acts.Add(Tuple.Create("按钮一", action)); acts.Add(Tuple.Create("按钮二", action)); acts.Add(Tuple.Create("按钮三", action)); MessageWindow.ShowDialogWith("这是自定义按钮提示消息", "好心提醒", acts.ToArray()); } // Do:气泡消息 else if (command == "Button.Upgrade") { UpgradeWindow window = new UpgradeWindow(); window.TitleMessage = "发现新版本:V3.0.1"; List <string> message = new List <string>(); message.Add("1、增加了检验更新和版本下载"); message.Add("2、增加了Mvc跳转页面方案"); message.Add("3、修改了一些已知BUG"); window.Message = message; var find = window.ShowDialog(); if (find.HasValue && find.Value) { DownLoadWindow downLoad = new DownLoadWindow(); downLoad.TitleMessage = "正在下载新版本:V3.0.1"; downLoad.Url = @"http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4"; downLoad.Message = message; downLoad.ShowDialog(); } //UpgradeWindow.BeginUpgrade("发现新版本:V3.0.1", @"http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4", // message.ToArray()); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Error")) { ErrorMessage message = new ErrorMessage(); message.Message = "错误信息!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Info")) { InfoMessage message = new InfoMessage(); message.Message = "提示信息!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Success")) { SuccessMessage message = new SuccessMessage(); message.Message = "保存成功!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Fatal")) { FatalMessage message = new FatalMessage(); message.Message = "问题很严重!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Warn")) { WarnMessage message = new WarnMessage(); message.Message = "警告信息!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Dailog")) { DailogMessage message = new DailogMessage(); message.Message = "可以保存了么?"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.ShowCoverMessge")) { SettingControl setting = new SettingControl(); MessageService.ShowWithLayer(setting); } }
private static void EnsureInitialized() { lock (lockObj) { if (window == null) { context = AsyncOperationManager.SynchronizationContext; using (ManualResetEvent mre = new ManualResetEvent(false)) { Thread t = new Thread((ThreadStart)delegate { window = new MessageWindow(); hwnd = window.Handle; mre.Set(); AppDomain.CurrentDomain.UnhandledException += (sender, args) => { var e = (Exception)args.ExceptionObject; log.ErrorFormat("Unhandled exception: {0}\n{1}", e.Message, e.StackTrace); }; Application.Run(); }); t.Name = "MessageEvents message loop"; t.IsBackground = true; t.Start(); mre.WaitOne(); } } } }
private void LockUser() { CurrentUser.IsLocked = true; MessageWindow.GetInstance("Пользователь заблокирован.", MessageType.Info); }
/// <summary> /// 把xml里每个unit的数据加载进mapGenerator /// </summary> /// <param name="xml"></param> /// <param name="mapGenerator"></param> private static void loadUnitToGeneratorXML(XmlDocument xmlFile, MapGenerator generator) { List <Unit> units = new List <Unit>(); foreach (Unit unit in Resources.FindObjectsOfTypeAll <Unit>()) { if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(unit)) && unit.transform.parent == generator.transform) { units.Add(unit); } } units.Reverse(); Debug.Log(generator.Index + "有" + units.Count + "个units"); int index = 0; XmlNodeList items = xmlFile.SelectSingleNode("MonsterPackConfig").SelectSingleNode("ary").SelectNodes("item"); Debug.Log(generator.Index + "有" + items.Count + "个items"); if (items.Count != units.Count) { MessageWindow.CreateMessageBox( "Unit需要重置", delegate(EditorWindow window) { foreach (XmlNode item in items) { // 更新数据 if (units.Count <= index) { // item数量多于unit, 新建unit Unit newUnit = InitializeUnit(units.Count + 1, generator.gameObject); units.Add(newUnit); } loadItemToUnitXML(units[index++], item); } if (units.Count > index) { // 有多余的unit for (int i = index; i < units.Count; i++) { UnityEngine.Object.DestroyImmediate(units[i].gameObject); } } window.Close(); }, delegate(EditorWindow window) { window.Close(); return; } ); } else { foreach (XmlNode item in items) { loadItemToUnitXML(units[index++], item); } } }
/// <summary> /// 加载xml里面generator的数据 /// </summary> /// <param name="mapID"></param> private static void loadGeneratorXML(string mapID) { Dictionary <int, MapGenerator> oldGenerators = new Dictionary <int, MapGenerator>(); Dictionary <int, MapGenerator> newGenerators = new Dictionary <int, MapGenerator>(); foreach (MapGenerator generator in Resources.FindObjectsOfTypeAll <MapGenerator>()) { if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(generator))) { oldGenerators.Add(generator.ID, generator); } } if (Directory.Exists(MAP_ID_PATH + "/" + mapID + "/MapGenerator")) { foreach (var path in Directory.GetFiles(MAP_ID_PATH + "/" + mapID + "/MapGenerator")) { if (Path.GetExtension(path) == ".bytes") { // 先判断是否需要重置generator Debug.Log("导入的index" + int.Parse(Path.GetFileNameWithoutExtension(path).Substring(Path.GetFileNameWithoutExtension(path).Length - 3))); if (!oldGenerators.ContainsKey(int.Parse(Path.GetFileNameWithoutExtension(path)))) { MapGenerator mapGenerator = InstantializeGenerator( int.Parse(Path.GetFileNameWithoutExtension(path).Substring(Path.GetFileNameWithoutExtension(path).Length - 3)), int.Parse(Path.GetFileNameWithoutExtension(path)), GameObject.Find("MonsterGenerator")); newGenerators.Add(mapGenerator.ID, mapGenerator); } else { newGenerators.Add(int.Parse(Path.GetFileNameWithoutExtension(path)), oldGenerators[int.Parse(Path.GetFileNameWithoutExtension(path))]); oldGenerators.Remove(int.Parse(Path.GetFileNameWithoutExtension(path))); } } } } if (oldGenerators.Count > 0) { MessageWindow.CreateMessageBox( "Generator需要重置", delegate(EditorWindow window) { foreach (var generator in oldGenerators.Values) { UnityEngine.Object.DestroyImmediate(generator.gameObject); } window.Close(); }, delegate(EditorWindow window) { window.Close(); return; } ); } foreach (var path in Directory.GetFiles(MAP_ID_PATH + "/" + mapID + "/MapGenerator")) { if (Path.GetExtension(path) == ".bytes") { // 依次加载每一个generator XmlDocument xmlFile = new XmlDocument(); FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read); try { xmlFile.Load(fileStream); } catch (XmlException e) { Debug.LogWarning("加载出错" + e.Message); } fileStream.Close(); loadUnitToGeneratorXML(xmlFile, newGenerators[int.Parse(Path.GetFileNameWithoutExtension(path))]); } } }
/// <summary> /// 进行MapGenerator, Unit的index检查[已弃用] /// </summary> private static bool checkValidity() { MapData mapData = UnityEngine.Object.FindObjectOfType <MapData>(); if (mapData == null) { return(true); } HashSet <int> tempHashSet = new HashSet <int>(); Debug.LogWarning("当前有" + UnityEngine.Object.FindObjectsOfType <MapGenerator>().Length + "个MapGenerator"); foreach (var generator in UnityEngine.Object.FindObjectsOfType <MapGenerator>()) { if (!tempHashSet.Add(generator.Index)) { // index already exist MessageWindow.CreateMessageBox( generator.Name + "_" + generator.ID + "命名非法, 是否一键修复", delegate(EditorWindow window) { // 一键修复index int i = UnityEngine.Object.FindObjectsOfType <MapGenerator>().Length; foreach (var item in UnityEngine.Object.FindObjectsOfType <MapGenerator>()) { item.Index = --i; } save(); window.Close(); }, delegate(EditorWindow window) { window.Close(); } ); return(false); } } foreach (var generator in UnityEngine.Object.FindObjectsOfType <MapGenerator>()) { tempHashSet.Clear(); foreach (var unit in generator.GetComponentsInChildren <Unit>()) { if (!tempHashSet.Add(unit.Index)) { // index already exist MessageWindow.CreateMessageBox( unit.Name + "_" + unit.ID + "命名非法, 是否一键修复", delegate(EditorWindow window) { // 一键修复index int i = 0; foreach (var item in generator.GetComponentsInChildren <Unit>()) { item.Index = i++; } save(); window.Close(); }, delegate(EditorWindow window) { window.Close(); } ); return(false); } } tempHashSet.Clear(); } return(true); }
private static void AddEventHandler(object id, EventHandler value) { lock (_lock) { if (_window == null) _window = new MessageWindow(); if (eventHandlerList == null) eventHandlerList = new EventHandlerList(); eventHandlerList.AddHandler(id, value); } }
private void welcome() { console.GoTo(16, 0); console.Write(Pc.Name + ", " + ((VhPc)Pc).Profession.Name); MessageWindow.Clear(); MessageWindow.ShowMessage(Translator.Instance["welcome"] + Pc.Name + "!"); }
static void DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { e.Handled = true; AValue.AddErrorLog(e.Exception); var w = new MessageWindow(e.Exception.ToString()); w.ShowDialog(); }
public override void buttonEventBase(GameObject gameObj) { base.buttonEventBase(gameObj); levelUpSign.alpha = 0; if (gameObj.name == "close") { finishWindow(); // UiManager.Instance.openMainWindow(); } else if (gameObj.name == "intensifyButton") { if (!checkIsMaxLevel()) { MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0348")); // UiManager.Instance.createMessageWindowByOneButton(LanguageConfigManager.Instance.getLanguage("s0348"),null); return; } if (!testHallowsEnough()) { UiManager.Instance.openDialogWindow <MessageWindow> ((MessageWindow win) => { win.initWindow(2, LanguageConfigManager.Instance.getLanguage("s0040"), LanguageConfigManager.Instance.getLanguage("s0014"), LanguageConfigManager.Instance.getLanguage("s0349"), gotoShop); }); return; } GuideManager.Instance.doGuide(); GuideManager.Instance.closeGuideMask(); updateInfo(1); return; } else if (gameObj.name == "oneKeyIntensifyButton") { GuideManager.Instance.doFriendlyGuideEvent(); if (!checkIsMaxLevel()) { MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0348")); // UiManager.Instance.createMessageWindowByOneButton(LanguageConfigManager.Instance.getLanguage("s0348"),null); return; } if (!testHallowsEnough()) { UiManager.Instance.openDialogWindow <MessageWindow> ((win) => { win.initWindow(2, LanguageConfigManager.Instance.getLanguage("s0040"), LanguageConfigManager.Instance.getLanguage("s0014"), LanguageConfigManager.Instance.getLanguage("s0349"), gotoShop); }); return; } updateInfo(2); return; } else if (gameObj.name == "freeIntensifyButton") { if (!checkIsMaxLevel()) { MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0348")); // UiManager.Instance.createMessageWindowByOneButton(LanguageConfigManager.Instance.getLanguage("s0348"),null); return; } count = BeastEvolveManagerment.Instance.getLaveHallowConut(); updateInfo(3); } }
void ShowIntervalMessage(IntervalSettings intervalSettings) { if (intervalSettings.EnableMessage1BeforeStartMeasuring) { if (DataMeasuringType == DataMeasuringType.Signal) { SequenceCtrl.Dispatcher.Invoke(() => { MessageWindow messageWindow = new MessageWindow(); messageWindow.Message = intervalSettings.Message1BeforeStartMeasuring; messageWindow.ShowDialog(); }); } } if (intervalSettings.EnableMessage2BeforeStartMeasuring) { if (DataMeasuringType == DataMeasuringType.Signal) { SequenceCtrl.Dispatcher.Invoke(() => { MessageWindow messageWindow = new MessageWindow(); messageWindow.Message = intervalSettings.Message2BeforeStartMeasuring; messageWindow.ShowDialog(); }); } } if (intervalSettings.EnableMessage3BeforeStartMeasuring) { if (DataMeasuringType == DataMeasuringType.Signal) { SequenceCtrl.Dispatcher.Invoke(() => { MessageWindow messageWindow = new MessageWindow(); messageWindow.Message = intervalSettings.Message3BeforeStartMeasuring; messageWindow.ShowDialog(); }); } } if (intervalSettings.EnableMessage1BeforeStartMeasuringForNoise) { if (DataMeasuringType == DataMeasuringType.Noise) { SequenceCtrl.Dispatcher.Invoke(() => { MessageWindow messageWindow = new MessageWindow(); messageWindow.Message = intervalSettings.Message1BeforeStartMeasuring; messageWindow.ShowDialog(); }); } } if (intervalSettings.EnableMessage2BeforeStartMeasuringForNoise) { if (DataMeasuringType == DataMeasuringType.Noise) { SequenceCtrl.Dispatcher.Invoke(() => { MessageWindow messageWindow = new MessageWindow(); messageWindow.Message = intervalSettings.Message2BeforeStartMeasuring; messageWindow.ShowDialog(); }); } } if (intervalSettings.EnableMessage3BeforeStartMeasuringForNoise) { if (DataMeasuringType == DataMeasuringType.Noise) { SequenceCtrl.Dispatcher.Invoke(() => { MessageWindow messageWindow = new MessageWindow(); messageWindow.Message = intervalSettings.Message3BeforeStartMeasuring; messageWindow.ShowDialog(); }); } } }
private void Save_Click(object sender, RoutedEventArgs e) { bool isNull = false; var message = "Please Enter:"; if (newQuotationData.PowerVoltage == null || newQuotationData.PowerVoltage == "") { message += $"\n Power Voltage."; isNull = true; } if (newQuotationData.Phase == null || newQuotationData.Phase == "") { message += $"\n Phase."; isNull = true; } if (newQuotationData.Frequency == null || newQuotationData.Frequency == "") { message += $"\n Frequency."; isNull = true; } if (newQuotationData.NetworkSystem == null || newQuotationData.NetworkSystem == "") { message += $"\n Network System."; isNull = true; } if (newQuotationData.ControlVoltage == null || newQuotationData.ControlVoltage == "") { message += $"\n Control Voltage."; isNull = true; } if (newQuotationData.TinPlating == null || newQuotationData.TinPlating == "") { message += $"\n Tin Plating."; isNull = true; } if (newQuotationData.NeutralSize == null || newQuotationData.NeutralSize == "") { message += $"\n Neutral Size."; isNull = true; } if (newQuotationData.EarthSize == null || newQuotationData.EarthSize == "") { message += $"\n Earth Size."; isNull = true; } if (newQuotationData.EarthingSystem == null || newQuotationData.EarthingSystem == "") { message += $"\n Earthing System."; isNull = true; } if (!isNull) { using (SqlConnection connection = new SqlConnection(Database.ConnectionString)) { connection.Update <Quotation>(newQuotationData); } QuotationData.Update(newQuotationData); if (OpenPanelsWindow) { var panelsWindow = new PanelsWindow() { UserData = this.UserData, QuotationData = this.QuotationData }; this.Close(); panelsWindow.ShowDialog(); } else { this.Cancel_Click(sender, e); } } else { MessageWindow.Show("Error", message, MessageWindowButton.OK, MessageWindowImage.Information); } }
void Initialize(ShellItem[] items) { IntPtr[] pidls = new IntPtr[items.Length]; ShellItem parent = null; IntPtr result; for (int n = 0; n < items.Length; ++n) { pidls[n] = Shell32.ILFindLastID(items[n].Pidl); if (parent == null) { if (items[n] == ShellItem.Desktop) { parent = ShellItem.Desktop; } else { parent = items[n].Parent; } } else { if (items[n].Parent != parent) { throw new Exception("All shell items must have the same parent"); } } } parent.GetIShellFolder().GetUIObjectOf(IntPtr.Zero, (uint)pidls.Length, pidls, typeof(IContextMenu).GUID, 0, out result); m_ComInterface = (IContextMenu) Marshal.GetTypedObjectForIUnknown(result, typeof(IContextMenu)); m_ComInterface2 = m_ComInterface as IContextMenu2; m_ComInterface3 = m_ComInterface as IContextMenu3; m_MessageWindow = new MessageWindow(this); }
public void ShowWith(string message) { System.Diagnostics.Debug.WriteLine(message); Application.Current.Dispatcher.Invoke(() => MessageWindow.ShowSumit(message, "系统提示!", 5)); }
public override void buttonEventBase(GameObject gameObj) { base.buttonEventBase(gameObj); //切换队伍 if (gameObj.name == "changeArmy") { if (PvpInfoManagerment.Instance.getPvpTime(null) <= 0) { MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0215")); return; } UiManager.Instance.openWindow <TeamViewInMissionWindow1> ((wins) => { wins.comeFrom = TeamViewInMissionWindow1.FROM_PVP; }); } //进入普通战斗 else if (gameObj.name == "commonFight") { if (PvpInfoManagerment.Instance.getPvpTime(null) <= 0) { MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0215")); return; } if (UserManager.Instance.self.getPvPPoint() <= 0) { UiManager.Instance.openDialogWindow <PvpUseWindow> ( (win) => { win.initInfo(1, PvpInfoManagerment.Instance.getOpp().uid, null); }); } else { showBattleInfoWindow(1); } } //进入全力战斗 else if (gameObj.name == "specialFight") { if (PvpInfoManagerment.Instance.getPvpTime(null) <= 0) { MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0215")); return; } if (UserManager.Instance.self.getPvPPoint() < 3) { UiManager.Instance.openDialogWindow <PvpUseWindow> ( (win) => { win.initInfo(2, PvpInfoManagerment.Instance.getOpp().uid, null); }); //destoryWindow(); } else { showBattleInfoWindow(2); //hideWindow(); } } else if (gameObj.name == "close") { if (BattleManager.Instance != null) { BattleManager.Instance.awardFinfish(); } else { finishWindow(); } if (MissionManager.instance != null) { MissionManager.instance.showAll(); MissionManager.instance.setBackGround(); } } }
/// <summary> /// Instantiate windows upon launch. /// </summary> public static void Initialize() { var gameWindow = new GameWindow(Constants.GameWidth, Constants.GameHeight) { IsFocused = true, IsVisible = true }; Add(gameWindow); var characterWindow = new CharacterWindow(Constants.Windows.CharacterWidth, Constants.Windows.CharacterHeight) { IsVisible = false, IsFocused = false }; Add(characterWindow); var statsWindow = new StatsWindow(Constants.Windows.StatsWidth, Constants.Windows.StatsHeight); Add(statsWindow); var inventoryWindow = new InventoryWindow(Constants.Windows.InventoryWidth, Constants.Windows.InventoryHeight) { IsVisible = false, IsFocused = false }; Add(inventoryWindow); var previewWindow = new ItemPreviewWindow(Constants.Windows.ItemPreviewWidth, Constants.Windows.ItemPreviewHeight) { IsVisible = false, IsFocused = false }; Add(previewWindow); var travelWindow = new TravelWindow(Constants.Windows.TravelWidth, Constants.Windows.TravelHeight) { IsVisible = false, IsFocused = false }; Add(travelWindow); var messageWindow = new MessageWindow(Constants.Windows.MessageWidth, Constants.Windows.MessageHeight); Add(messageWindow); // Initialize last so all consoles are instantiated prior to creating keybinding bools for visibility var keybindingsWindow = new KeybindingsWindow(Constants.Windows.KeybindingsWidth, Constants.Windows.KeybindingsHeight); Add(keybindingsWindow); var generalKeybindingsWindow = new GeneralKeybindingsWindow(Constants.Windows.GeneralKeybindingsWidth, Constants.Windows.GeneralKeybindingsHeight); Add(generalKeybindingsWindow); var locationKeybindingsWindow = new LocationKeybindingsWindow(Constants.Windows.LocationKeybindingsWidth, Constants.Windows.LocationKeybindingsHeight); Add(locationKeybindingsWindow); var actionKeybindingsWindow = new ActionKeybindingsWindow(Constants.Windows.ActionKeybindingsWidth, Constants.Windows.ActionKeybindingsHeight); Add(actionKeybindingsWindow); // Action windows var choppingWindow = new ChoppingWindow(Constants.Windows.Actions.ChoppingWidth, Constants.Windows.Actions.ChoppingHeight) { IsVisible = false, IsFocused = false }; Add(choppingWindow); var characterKeybindingsWindow = new CharacterKeybindingsWindow(Constants.Windows.CharacterKeybindingsWidth, Constants.Windows.CharacterKeybindingsHeight) { IsVisible = false }; Add(characterKeybindingsWindow); IsInitialized = true; }
private HotkeyManager() { _messageWindow = new MessageWindow(this); SetHwnd(_messageWindow.Handle); }
public override void read(ErlKVMessage message) { ErlType type = message.getValue("msg") as ErlType; if (type is ErlArray) { ErlArray stateArray = type as ErlArray; string state = stateArray.Value[0].getValueString(); if (t == 0) { if (state == "0") { NoticeManagerment.Instance.setAlchemyNum(NoticeManagerment.Instance.getAlchemyNum() + 1); if (callback != null) { callback(1, 0); } } else if (state == "1") { NoticeManagerment.Instance.setAlchemyNum(NoticeManagerment.Instance.getAlchemyNum() + 1); if (callback != null) { callback(2, 0); } } else { MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("AlchemyContent03")); if (callback != null) { callback(0, 0); } } } else { int index = StringKit.toInt(state); if (index <= 10 && index >= 0) { NoticeManagerment.Instance.setAlchemyNum(NoticeManagerment.Instance.getAlchemyNum() + 10); if (callback != null) { long num = StringKit.toLong(stateArray.Value[1].getValueString()); callback(num, index); } else { MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("AlchemyContent03")); if (callback != null) { callback(-1, 0); } } } } } else { MessageWindow.ShowAlert(type.getValueString()); if (callback != null) { callback = null; } } }
private static void EnsureInitialized() { lock (_lock) { if (_window == null) { _context = AsyncOperationManager.SynchronizationContext; using (ManualResetEvent mre = new ManualResetEvent(false)) { Thread t = new Thread((ThreadStart)delegate { _window = new MessageWindow(); _windowHandle = _window.Handle; mre.Set(); Application.Run(); }); t.Name = "MessageEvents message loop"; t.IsBackground = true; t.Start(); mre.WaitOne(); } } } }
void Start(){ quest = GameObject.Find ("MasterMind").GetComponent<MessageWindow>(); powerON = GetComponent<ItemUseStates>().button; setOn(); }
void Initialize(IListItemEx item) { Guid iise = typeof(IShellExtInit).GUID; var ishellViewPtr = (item.IsDrive || !item.IsFileSystem || item.IsNetworkPath) ? item.GetIShellFolder().CreateViewObject(IntPtr.Zero, typeof(IShellView).GUID) : item.Parent.GetIShellFolder().CreateViewObject(IntPtr.Zero, typeof(IShellView).GUID); var view = Marshal.GetObjectForIUnknown(ishellViewPtr) as IShellView; view?.GetItemObject(SVGIO.SVGIO_BACKGROUND, typeof(IContextMenu).GUID, out _Result); if (view != null) Marshal.ReleaseComObject(view); m_ComInterface = (IContextMenu)Marshal.GetTypedObjectForIUnknown(_Result, typeof(IContextMenu)); m_ComInterface2 = m_ComInterface as IContextMenu2; m_ComInterface3 = m_ComInterface as IContextMenu3; IntPtr iShellExtInitPtr; if (Marshal.QueryInterface(_Result, ref iise, out iShellExtInitPtr) == (int)HResult.S_OK) { var iShellExtInit = Marshal.GetTypedObjectForIUnknown(iShellExtInitPtr, typeof(IShellExtInit)) as IShellExtInit; try { var hhh = IntPtr.Zero; iShellExtInit?.Initialize(_ShellView.CurrentFolder.PIDL, null, 0); if (iShellExtInit != null) Marshal.ReleaseComObject(iShellExtInit); Marshal.Release(iShellExtInitPtr); } catch { } } m_MessageWindow = new MessageWindow(this); }
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Exception error = (Exception)e.ExceptionObject; Application.Current.Dispatcher.Invoke(() => MessageWindow.ShowSumit("当前应用程序遇到一些问题,该操作已经终止,请进行重试,如果问题继续存在,请联系管理员", "意外的操作")); }
bool CheckExecutablePaths() { StringBuilder errorsBuilder = new StringBuilder("Virheitä annetuissa poluissa: "); bool isErrors = false; /* Required */ if (!File.Exists(SettingsFromIni.SvnCliExePath)) { errorsBuilder.Append("Vaadittua ohjelmaa svn.exe ei löydy annetusta polusta. "); isErrors = true; } if (!File.Exists(SettingsFromIni.MsbuildExePath)) { errorsBuilder.Append("Vaadittua ohjelmaa msbuild.exe ei löydy annetusta polusta. "); isErrors = true; } /* Optional */ //if (!File.Exists(SettingsFromIni.VCSExePath)) { } /* Tools */ foreach (var tool in tools) { if (!File.Exists(tool.ToolExe)) { errorsBuilder.Append(String.Format("Työkalua {0} ei löydy annetusta polusta. ", Path.GetFileName(tool.ToolExe))); isErrors = true; } } if (isErrors) { string errors = errorsBuilder.ToString(); MessageWindow message = new MessageWindow(errors); message.Closed+=(sender => Exit()); Add(message, 3); return false; } return true; }
void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { Application.Current.Dispatcher.Invoke(() => MessageWindow.ShowSumit(e.Exception.Message, "系统异常", 5)); e.Handled = true; }
/// <summary> /// we need this to catch device change events in a non-Winforms environment, which we have in MRDS DSS host. /// </summary> private void EnsureEventsWindowInitialized() { lock (_lock) { if (_window == null) { using (ManualResetEvent mre = new ManualResetEvent(false)) { Thread t = new Thread((ThreadStart)delegate { _window = new MessageWindow(); _window.picpxmod = this; WindowHandle = _window.Handle; mre.Set(); Application.Run(); }); t.Name = "MessageEvents"; t.IsBackground = true; t.Start(); mre.WaitOne(); } } } }
// Use this for initialization void Start() { chatInputRect = new Rect(chatInputPosition.x, chatInputPosition.y, chatInputSize.x, chatInputSize.y); chatOutputRect = new Rect(chatOutputPosition.x, chatOutputPosition.y, chatOutputSize.x, chatOutputSize.y); entireChatArea = new Rect(chatInputPosition.x, chatInputPosition.y, Mathf.Max(chatInputSize.x, chatOutputSize.x), chatInputSize.y + chatOutputSize.y); //messageWindow = new MessageWindow(chatOutputSize, chatterSkin); messageWindow = ScriptableObject.CreateInstance<MessageWindow>(); messageWindow.setMessageWindow(chatOutputSize, chatterSkin); manager = GameObject.Find("_Manager").GetComponent<SecondLevel>(); }
public static void ShowMessage(string message, MessageType messageType) { var messageWindow = new MessageWindow(message, messageType); messageWindow.Show(); }
protected override async void OnStartup(StartupEventArgs e) { base.OnStartup(e); InitializeDIContainer(); // Init settings ApplicationSettings settings = null; ISettingsManager <ApplicationSettings> appSettingsManager = Container.Resolve <ISettingsManager <ApplicationSettings> >(); try { var appSettingsDirectory = Path.GetDirectoryName(appSettingsManager.SettingsFilePath); if (!Directory.Exists(appSettingsDirectory)) { Directory.CreateDirectory(appSettingsDirectory); } settings = await appSettingsManager.LoadSettingsAsync().ConfigureAwait(true); // Init localization var culture = new CultureInfo(settings.SelectedUiLanguage); TranslationSource.Instance.CurrentCulture = culture; Thread.CurrentThread.CurrentCulture = culture; Thread.CurrentThread.CurrentUICulture = culture; } catch (Exception exp) { var sb = new StringBuilder(); sb.AppendLine(); sb.AppendLine("Unexpected Error 1 in App.Application_Startup()"); sb.AppendLine($" Message:{exp.Message}"); sb.AppendLine($"StackTrace:{exp.StackTrace}"); sb.AppendLine(); _log.WriteLine(sb.ToString(), LogErrorSeverity.Error); } // Due to implementation constraints, taskbar icon must be instantiated as late as possible Container.RegisterInstance(FindResource("TaskbarIcon") as TaskbarIcon, new ContainerControlledLifetimeManager()); Container.Resolve <ITaskbarIconManager>(); _log.WriteLine("Resolve DI container"); _startupHelper = Container.Resolve <IStartupHelper>(); _workstationManager = Container.Resolve <IWorkstationManager>(); _metaMessenger = Container.Resolve <IMetaPubSub>(); _metaMessenger.Subscribe <ConnectedToServerEvent>(OnConnectedToServer); _serviceWatchdog = Container.Resolve <IServiceWatchdog>(); _serviceWatchdog.Start(); _deviceManager = Container.Resolve <IDeviceManager>(); _userActionHandler = Container.Resolve <UserActionHandler>(); _hotkeyManager = Container.Resolve <IHotkeyManager>(); _hotkeyManager.Enabled = true; _buttonManager = Container.Resolve <IButtonManager>(); _buttonManager.Enabled = true; _messageWindow = Container.Resolve <MessageWindow>(); Container.Resolve <IProximityLockManager>(); Container.Resolve <IVaultLowBatteryMonitor>(); SystemEvents.SessionSwitch += SystemEvents_SessionSwitch; // This will create an instance of password manager view model and allow handling of "Add new account" user action // It is required for subscribtion of PasswordManagerViewModel to the "AddAccountForApp" message // Note: PasswordManagerViewModel is not required for simplified UI Container.Resolve <PasswordManagerViewModel>(); // Public Suffix list loading and updating may take some time (more than 8000 entries) // Better to load it before its required (for main domain extraction) await Task.Run(URLHelper.PreloadPublicSuffixAsync); // Handle first launch if (settings.IsFirstLaunch) { OnFirstLaunch(); settings.IsFirstLaunch = false; appSettingsManager.SaveSettings(settings); } _windowsManager = Container.Resolve <IWindowsManager>(); await _windowsManager.InitializeMainWindowAsync(); await _metaMessenger.TryConnectToServer("HideezServicePipe"); }
// Use this for initialization void Start () { meswin = GameObject.Find("MasterMind").GetComponent<MessageWindow>(); }
//Step 4 modify purchasing public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args) { if (String.Equals(args.purchasedProduct.definition.id, removeAds, StringComparison.Ordinal)) { // Debug.Log("Adds Removed - restart game"); //bannerAds.HideBannerAdd(); LoadInfo.adsRemoved = true; LoadInfo.SaveNonConsumable(LoadInfo.adsRemoved, "removeAds"); } else if (String.Equals(args.purchasedProduct.definition.id, gamePack1, StringComparison.Ordinal)) { //Debug.Log("Game Pack 1"); ++LoadInfo.booster1No; ++LoadInfo.booster4No; ++LoadInfo.booster5No; LoadInfo.Save(LoadInfo.booster1No, "onePieceRemove"); LoadInfo.Save(LoadInfo.booster4No, "switch"); LoadInfo.Save(LoadInfo.booster5No, "meteor"); GameObject booster1; GameObject booster3; GameObject booster4; booster1 = GameObject.FindGameObjectWithTag("GB1"); booster3 = GameObject.FindGameObjectWithTag("GB3"); booster4 = GameObject.FindGameObjectWithTag("GB4"); if (booster1 != null && booster3 != null && booster4 != null) { Booster b1 = booster1.GetComponent <Booster>(); Booster b3 = booster3.GetComponent <Booster>(); Booster b4 = booster4.GetComponent <Booster>(); if (b1 != null && b3 != null && b4 != null) { //Debug.Log("my Debug"); b1.UpdateGameBoosters(); b3.UpdateGameBoosters(); b4.UpdateGameBoosters(); } } } else if (String.Equals(args.purchasedProduct.definition.id, pregamePack1, StringComparison.Ordinal)) { //Debug.Log("Pregame Pack 1"); ++LoadInfo.booster3No; ++LoadInfo.booster6No; ++LoadInfo.booster7No; LoadInfo.Save(LoadInfo.booster3No, "colorBomb"); LoadInfo.Save(LoadInfo.booster6No, "jumping"); LoadInfo.Save(LoadInfo.booster7No, "big"); GameObject window; window = GameObject.FindGameObjectWithTag("messageWindow"); if (window != null) { MessageWindow message = window.GetComponent <MessageWindow>(); if (message != null) { message.UpdatePreGameBoosters(); } } } else if (String.Equals(args.purchasedProduct.definition.id, allBoostersPack1, StringComparison.Ordinal)) { //Debug.Log("All Boosters Pack 1"); ++LoadInfo.booster1No; ++LoadInfo.booster3No; ++LoadInfo.booster4No; ++LoadInfo.booster5No; ++LoadInfo.booster6No; ++LoadInfo.booster7No; LoadInfo.Save(LoadInfo.booster1No, "onePieceRemove"); LoadInfo.Save(LoadInfo.booster3No, "colorBomb"); LoadInfo.Save(LoadInfo.booster4No, "switch"); LoadInfo.Save(LoadInfo.booster5No, "meteor"); LoadInfo.Save(LoadInfo.booster6No, "jumping"); LoadInfo.Save(LoadInfo.booster7No, "big"); GameObject booster1; GameObject booster3; GameObject booster4; booster1 = GameObject.FindGameObjectWithTag("GB1"); booster3 = GameObject.FindGameObjectWithTag("GB3"); booster4 = GameObject.FindGameObjectWithTag("GB4"); if (booster1 != null && booster3 != null && booster4 != null) { Booster b1 = booster1.GetComponent <Booster>(); Booster b3 = booster3.GetComponent <Booster>(); Booster b4 = booster4.GetComponent <Booster>(); if (b1 != null && b3 != null && b4 != null) { b1.UpdateGameBoosters(); b3.UpdateGameBoosters(); b4.UpdateGameBoosters(); } } GameObject window; window = GameObject.FindGameObjectWithTag("messageWindow"); if (window != null) { MessageWindow message = window.GetComponent <MessageWindow>(); if (message != null) { message.UpdatePreGameBoosters(); } } } else if (String.Equals(args.purchasedProduct.definition.id, gamePack3, StringComparison.Ordinal)) { //Debug.Log("Game Pack 3"); LoadInfo.booster1No = LoadInfo.booster1No + 3; LoadInfo.booster4No = LoadInfo.booster4No + 3; LoadInfo.booster5No = LoadInfo.booster5No + 3; LoadInfo.Save(LoadInfo.booster1No, "onePieceRemove"); LoadInfo.Save(LoadInfo.booster4No, "switch"); LoadInfo.Save(LoadInfo.booster5No, "meteor"); GameObject booster1; GameObject booster3; GameObject booster4; booster1 = GameObject.FindGameObjectWithTag("GB1"); booster3 = GameObject.FindGameObjectWithTag("GB3"); booster4 = GameObject.FindGameObjectWithTag("GB4"); if (booster1 != null && booster3 != null && booster4 != null) { Booster b1 = booster1.GetComponent <Booster>(); Booster b3 = booster3.GetComponent <Booster>(); Booster b4 = booster4.GetComponent <Booster>(); if (b1 != null && b3 != null && b4 != null) { b1.UpdateGameBoosters(); b3.UpdateGameBoosters(); b4.UpdateGameBoosters(); } } } else if (String.Equals(args.purchasedProduct.definition.id, pregamePack3, StringComparison.Ordinal)) { //Debug.Log("Pregame Pack 3"); LoadInfo.booster3No = LoadInfo.booster3No + 3; LoadInfo.booster6No = LoadInfo.booster6No + 3; LoadInfo.booster7No = LoadInfo.booster7No + 3; LoadInfo.Save(LoadInfo.booster3No, "colorBomb"); LoadInfo.Save(LoadInfo.booster6No, "jumping"); LoadInfo.Save(LoadInfo.booster7No, "big"); GameObject window; window = GameObject.FindGameObjectWithTag("messageWindow"); if (window != null) { MessageWindow message = window.GetComponent <MessageWindow>(); if (message != null) { message.UpdatePreGameBoosters(); } } } else if (String.Equals(args.purchasedProduct.definition.id, allBoostersPack3, StringComparison.Ordinal)) { //Debug.Log("All Boosters Pack 3"); LoadInfo.booster1No = LoadInfo.booster1No + 3; LoadInfo.booster3No = LoadInfo.booster3No + 3; LoadInfo.booster4No = LoadInfo.booster4No + 3; LoadInfo.booster5No = LoadInfo.booster5No + 3; LoadInfo.booster6No = LoadInfo.booster6No + 3; LoadInfo.booster7No = LoadInfo.booster7No + 3; LoadInfo.Save(LoadInfo.booster1No, "onePieceRemove"); LoadInfo.Save(LoadInfo.booster3No, "colorBomb"); LoadInfo.Save(LoadInfo.booster4No, "switch"); LoadInfo.Save(LoadInfo.booster5No, "meteor"); LoadInfo.Save(LoadInfo.booster6No, "jumping"); LoadInfo.Save(LoadInfo.booster7No, "big"); GameObject booster1; GameObject booster3; GameObject booster4; booster1 = GameObject.FindGameObjectWithTag("GB1"); booster3 = GameObject.FindGameObjectWithTag("GB3"); booster4 = GameObject.FindGameObjectWithTag("GB4"); if (booster1 != null && booster3 != null && booster4 != null) { Booster b1 = booster1.GetComponent <Booster>(); Booster b3 = booster3.GetComponent <Booster>(); Booster b4 = booster4.GetComponent <Booster>(); if (b1 != null && b3 != null && b4 != null) { b1.UpdateGameBoosters(); b3.UpdateGameBoosters(); b4.UpdateGameBoosters(); } } GameObject window; window = GameObject.FindGameObjectWithTag("messageWindow"); if (window != null) { MessageWindow message = window.GetComponent <MessageWindow>(); if (message != null) { message.UpdatePreGameBoosters(); } } } else if (String.Equals(args.purchasedProduct.definition.id, gamePack5, StringComparison.Ordinal)) { //Debug.Log("Game Pack 5"); LoadInfo.booster1No = LoadInfo.booster1No + 5; LoadInfo.booster4No = LoadInfo.booster4No + 5; LoadInfo.booster5No = LoadInfo.booster5No + 5; LoadInfo.Save(LoadInfo.booster1No, "onePieceRemove"); LoadInfo.Save(LoadInfo.booster4No, "switch"); LoadInfo.Save(LoadInfo.booster5No, "meteor"); GameObject booster1; GameObject booster3; GameObject booster4; booster1 = GameObject.FindGameObjectWithTag("GB1"); booster3 = GameObject.FindGameObjectWithTag("GB3"); booster4 = GameObject.FindGameObjectWithTag("GB4"); if (booster1 != null && booster3 != null && booster4 != null) { Booster b1 = booster1.GetComponent <Booster>(); Booster b3 = booster3.GetComponent <Booster>(); Booster b4 = booster4.GetComponent <Booster>(); if (b1 != null && b3 != null && b4 != null) { b1.UpdateGameBoosters(); b3.UpdateGameBoosters(); b4.UpdateGameBoosters(); } } } else if (String.Equals(args.purchasedProduct.definition.id, pregamePack5, StringComparison.Ordinal)) { //Debug.Log("Pregame Pack 5"); LoadInfo.booster3No = LoadInfo.booster3No + 5; LoadInfo.booster6No = LoadInfo.booster6No + 5; LoadInfo.booster7No = LoadInfo.booster7No + 5; LoadInfo.Save(LoadInfo.booster3No, "colorBomb"); LoadInfo.Save(LoadInfo.booster6No, "jumping"); LoadInfo.Save(LoadInfo.booster7No, "big"); GameObject window; window = GameObject.FindGameObjectWithTag("messageWindow"); if (window != null) { MessageWindow message = window.GetComponent <MessageWindow>(); if (message != null) { message.UpdatePreGameBoosters(); } } } else if (String.Equals(args.purchasedProduct.definition.id, allBoostersPack5, StringComparison.Ordinal)) { //Debug.Log("All Boosters Pack 5"); LoadInfo.booster1No = LoadInfo.booster1No + 5; LoadInfo.booster3No = LoadInfo.booster3No + 5; LoadInfo.booster4No = LoadInfo.booster4No + 5; LoadInfo.booster5No = LoadInfo.booster5No + 5; LoadInfo.booster6No = LoadInfo.booster6No + 5; LoadInfo.booster7No = LoadInfo.booster7No + 5; LoadInfo.Save(LoadInfo.booster1No, "onePieceRemove"); LoadInfo.Save(LoadInfo.booster3No, "colorBomb"); LoadInfo.Save(LoadInfo.booster4No, "switch"); LoadInfo.Save(LoadInfo.booster5No, "meteor"); LoadInfo.Save(LoadInfo.booster6No, "jumping"); LoadInfo.Save(LoadInfo.booster7No, "big"); GameObject booster1; GameObject booster3; GameObject booster4; booster1 = GameObject.FindGameObjectWithTag("GB1"); booster3 = GameObject.FindGameObjectWithTag("GB3"); booster4 = GameObject.FindGameObjectWithTag("GB4"); if (booster1 != null && booster3 != null && booster4 != null) { Booster b1 = booster1.GetComponent <Booster>(); Booster b3 = booster3.GetComponent <Booster>(); Booster b4 = booster4.GetComponent <Booster>(); if (b1 != null && b3 != null && b4 != null) { b1.UpdateGameBoosters(); b3.UpdateGameBoosters(); b4.UpdateGameBoosters(); } } GameObject window; window = GameObject.FindGameObjectWithTag("messageWindow"); if (window != null) { MessageWindow message = window.GetComponent <MessageWindow>(); if (message != null) { message.UpdatePreGameBoosters(); } } } else if (String.Equals(args.purchasedProduct.definition.id, gamePack15, StringComparison.Ordinal)) { //Debug.Log("Game Pack 15"); LoadInfo.booster1No = LoadInfo.booster1No + 15; LoadInfo.booster4No = LoadInfo.booster4No + 15; LoadInfo.booster5No = LoadInfo.booster5No + 15; LoadInfo.Save(LoadInfo.booster1No, "onePieceRemove"); LoadInfo.Save(LoadInfo.booster4No, "switch"); LoadInfo.Save(LoadInfo.booster5No, "meteor"); GameObject booster1; GameObject booster3; GameObject booster4; booster1 = GameObject.FindGameObjectWithTag("GB1"); booster3 = GameObject.FindGameObjectWithTag("GB3"); booster4 = GameObject.FindGameObjectWithTag("GB4"); if (booster1 != null && booster3 != null && booster4 != null) { Booster b1 = booster1.GetComponent <Booster>(); Booster b3 = booster3.GetComponent <Booster>(); Booster b4 = booster4.GetComponent <Booster>(); if (b1 != null && b3 != null && b4 != null) { b1.UpdateGameBoosters(); b3.UpdateGameBoosters(); b4.UpdateGameBoosters(); } } } else if (String.Equals(args.purchasedProduct.definition.id, pregamePack15, StringComparison.Ordinal)) { //Debug.Log("Pregame Pack 15"); LoadInfo.booster3No = LoadInfo.booster3No + 15; LoadInfo.booster6No = LoadInfo.booster6No + 15; LoadInfo.booster7No = LoadInfo.booster7No + 15; LoadInfo.Save(LoadInfo.booster3No, "colorBomb"); LoadInfo.Save(LoadInfo.booster6No, "jumping"); LoadInfo.Save(LoadInfo.booster7No, "big"); GameObject window; window = GameObject.FindGameObjectWithTag("messageWindow"); if (window != null) { MessageWindow message = window.GetComponent <MessageWindow>(); if (message != null) { message.UpdatePreGameBoosters(); } } } else if (String.Equals(args.purchasedProduct.definition.id, allBoostersPack15, StringComparison.Ordinal)) { //Debug.Log("All Boosters Pack 15"); LoadInfo.booster1No = LoadInfo.booster1No + 15; LoadInfo.booster3No = LoadInfo.booster3No + 15; LoadInfo.booster4No = LoadInfo.booster4No + 15; LoadInfo.booster5No = LoadInfo.booster5No + 15; LoadInfo.booster6No = LoadInfo.booster6No + 15; LoadInfo.booster7No = LoadInfo.booster7No + 15; LoadInfo.Save(LoadInfo.booster1No, "onePieceRemove"); LoadInfo.Save(LoadInfo.booster3No, "colorBomb"); LoadInfo.Save(LoadInfo.booster4No, "switch"); LoadInfo.Save(LoadInfo.booster5No, "meteor"); LoadInfo.Save(LoadInfo.booster6No, "jumping"); LoadInfo.Save(LoadInfo.booster7No, "big"); GameObject booster1; GameObject booster3; GameObject booster4; booster1 = GameObject.FindGameObjectWithTag("GB1"); booster3 = GameObject.FindGameObjectWithTag("GB3"); booster4 = GameObject.FindGameObjectWithTag("GB4"); if (booster1 != null && booster3 != null && booster4 != null) { Booster b1 = booster1.GetComponent <Booster>(); Booster b3 = booster3.GetComponent <Booster>(); Booster b4 = booster4.GetComponent <Booster>(); if (b1 != null && b3 != null && b4 != null) { b1.UpdateGameBoosters(); b3.UpdateGameBoosters(); b4.UpdateGameBoosters(); } } GameObject window; window = GameObject.FindGameObjectWithTag("messageWindow"); if (window != null) { MessageWindow message = window.GetComponent <MessageWindow>(); if (message != null) { message.UpdatePreGameBoosters(); } } } else { //Debug.Log("Purchase Failed"); } return(PurchaseProcessingResult.Complete); }
public override void buttonEventBase(GameObject gameObj) { base.buttonEventBase(gameObj); if (gameObj.name == "close") { if (pageObj[2].activeSelf && !MiningManagement.Instance.HaveFightPrizes() && isSearchEnemy) { MessageWindow.ShowConfirm(LanguageConfigManager.Instance.getLanguage("mining_exit"), (msgHandle) => { if (msgHandle.buttonID == MessageHandle.BUTTON_RIGHT) { this.finishWindow(); } }, true); } else if (MiningManagement.Instance.HaveFightPrizes()) { UiManager.Instance.createPrizeMessageLintWindow(MiningManagement.Instance.FightPrizes); MiningManagement.Instance.ClearFightPrizes(); balanceInPage[pageIndex].SetActive(false); StartCoroutine(Utils.DelayRun(() => { finishWindow(); }, 1f)); } else { finishWindow(); } } if (gameObj.name == "leftArrow") { LeftDrag(); } if (gameObj.name == "rightArrow") { RightDrag(); } if (gameObj.name == "buttonMining") { UiManager.Instance.openDialogWindow <MiningTypeWindow>(); isChange = true; } if (gameObj.name == "buttonPillage") { // centerOnChild.onFinished = null; if (pageIndex == 2) { //隐藏其他元素,显示动画 fightButtonGroup.SetActive(false); fightInfo.SetActive(false); HideTeam(); searchAnim.transform.parent.gameObject.SetActive(true); searchAnim.Play(); } war_type = 0; isSearchEnemy = true; FPortManager.Instance.getFPort <SearchEnemyFport>().access(ShowEnemyInfo); } if (gameObj.name == "changeArmyButton") { editTeam = true; UiManager.Instance.openWindow <TeamEditWindow>(win => { if (pageIndex == 2) { win.setComeFrom(TeamEditWindow.FROM_LADDERS); } else if (ArmyManager.Instance.getArmy(4) == null) { ArmyManager.Instance.InitMiningTeam(); ArmyManager.Instance.SaveMiningArmy(() => { win.setShowTeam(4); win.setComeFrom(TeamEditWindow.FROM_MINING, false, MiningManagement.Instance.GetMiningSample(pageIndex).sid); isChange = true; }); } else { win.setShowTeam(MiningManagement.Instance.GetMinerals()[pageIndex].armyId); win.setComeFrom(TeamEditWindow.FROM_MINING, false, MiningManagement.Instance.GetMiningSample(pageIndex).sid); isChange = true; } }); } if (gameObj.name == "balanceButton") { if (pageIndex == 0 || pageIndex == 1) { FPortManager.Instance.getFPort <MineralBalanceFport>().access(pageIndex, Balanced); } else { BalanceFightPrize(); } } if (gameObj.name == "buttonPk") { pvpPoint = 1;//先设置好pvp消耗点 //if (ArmyManager.Instance.getArmy(4) == null) { // ArmyManager.Instance.InitMiningTeam(); // ArmyManager.Instance.SaveMiningArmy(Fight); //} else { Fight(); //} } if (gameObj.name == "buttonAllPk") { pvpPoint = 3;//先设置好pvp消耗点 Fight(); } if (gameObj.name == "enemyButton") { isChange = true; MiningManagement.Instance.NewEnemyNum = 0; tips.SetActive(false); newEnemyNum.text = ""; UiManager.Instance.openDialogWindow <MiningEnemiesWindow>(); } if (gameObj.name == "buttonHelp") { helpPanel.Play(true); } if (gameObj.name == "buttonCloseHelp") { helpPanel.Play(false); } }
private void WorkerOnDoWork(object sender, DoWorkEventArgs doWorkEventArgs) { _overallProgressCounter = 0; int totalErrors = 0; while (_tablesForMigration.Count > 0) { FileInfo tableInfo = _tablesForMigration.Dequeue(); string dbFile = tableInfo.FullName; #region -- migrate table to mysql --- try { DataTable table = MigrationHelper.OpenFile(dbFile); if (table == null) { throw new Exception(string.Format("Unable to open {0}.", dbFile)); } int totalRecords = table.Rows.Count; int counter = 0; foreach (DataRow dataRow in table.Rows) { var paramList = new List <SqlParameter>(); var fieldNames = new List <string>(); var fieldParams = new List <string>(); foreach (DataColumn column in table.Columns) { object defaultFieldValue = MigrationHelper.GetDefaultFieldValue(dataRow[column], column.DataType); if (defaultFieldValue == null) { continue; } string fieldParam = "?" + column.ColumnName; paramList.Add(new SqlParameter(fieldParam, defaultFieldValue)); fieldNames.Add("`" + column.ColumnName + "`"); fieldParams.Add(fieldParam); } string tableName = Path.GetFileNameWithoutExtension(dbFile); var sqlBuilder = new StringBuilder(); sqlBuilder.AppendLine(string.Format("INSERT INTO `{0}`", tableName)); sqlBuilder.AppendLine(string.Format("({0})", string.Join(", ", fieldNames))); sqlBuilder.AppendLine(string.Format("VALUES ({0})", string.Join(", ", fieldParams))); DatabaseController.ExecuteInsertQuery(sqlBuilder.ToString(), paramList.ToArray()); counter++; var percent = (int)(counter * (100m / totalRecords)); _worker.ReportProgress(percent); } _overallProgressCounter++; } catch (Exception exception) { totalErrors++; Logger.ExceptionLogger(this, exception); MessageWindow.ShowAlertMessage(exception.Message); _tablesForMigration.Enqueue(tableInfo); if (totalErrors > 10) { _worker.CancelAsync(); } } #endregion -- end migrate table to mysql -- } UpdateJournalVoucherDocumentNumber(); }
public override void read(ErlKVMessage message) { ErlList data = message.getValue("msg") as ErlList; if (data == null) { string msg = (message.getValue("msg") as ErlType).getValueString(); if (msg == "null") { //NO Sweep Info } else if (msg == "already_in_sweep") { } else { MessageWindow.ShowAlert(msg); } if (callback != null) { callback(msg); callback = null; } return; } int sweepTimes = 0; int sweepCDTime = 0; int sweepMissionSid = 0; int sweepMissionLevel = 0; int state = 0; int startTime = 0; int pvpCount = 0; int arrayID = 0; int pvePointCost = 0; int missionId = 0; int length = data.Value.Length; ErlArray itemArray; string key; int value; for (int i = 0; i < length; i++) { itemArray = data.Value[i] as ErlArray; key = itemArray.Value[0].getValueString(); value = StringKit.toInt(itemArray.Value[1].getValueString()); switch (key) { case "pvp_num": pvpCount = value; break; case "start_time": startTime = value; break; case "sweep_pve": pvePointCost = value; break; case "cd": sweepCDTime = value; break; case "sweep_num": sweepTimes = value; break; case "fb_id": sweepMissionSid = value; break; case "fb_lv": sweepMissionLevel = value; break; case "state": state = value; break; case "array_id": arrayID = value; break; } } SweepManagement.Instance.initPvpNum(pvpCount); SweepManagement.Instance.SweepCostTime = sweepCDTime; SweepManagement.Instance.pvePointCost = pvePointCost / sweepTimes; SweepManagement.Instance.M_updateSweepInfo(state, sweepMissionSid, sweepMissionLevel, sweepTimes, startTime, arrayID); ArmyManager.Instance.getArmy(arrayID).state = 1; Mission mission = MissionInfoManager.Instance.getMissionBySid(sweepMissionSid); if (mission != null) { if (mission.getChapterType() == ChapterType.STORY) { UserManager.Instance.self.costPoint(pvePointCost, MissionEventCostType.COST_PVE); FuBenManagerment.Instance.sweepMission(sweepMissionSid, sweepMissionLevel, sweepTimes); } else if (mission.getChapterType() == ChapterType.WAR) { Chapter chapter = FuBenManagerment.Instance.getWarChapter(); if (chapter != null) { chapter.addNum(-sweepTimes); //update(srcNum+sweepTimes); int srcNum = chapter.getNum(); } } } if (callback != null) { callback("ok"); callback = null; } }
/// <summary> 命令通用方法 </summary> protected override async void RelayMethod(object obj) { string command = obj?.ToString(); // Do:对话消息 if (command == "Button.ShowDialogMessage") { await MessageService.ShowSumitMessge("这是消息对话框?"); } // Do:等待消息 else if (command == "Button.ShowWaittingMessge") { await MessageService.ShowWaittingMessge(() => Thread.Sleep(2000)); } // Do:百分比进度对话框 else if (command == "Button.ShowPercentProgress") { Action <IPercentProgress> action = l => { for (int i = 0; i < 100; i++) { l.Value = i; Thread.Sleep(10); } Thread.Sleep(1000); MessageService.ShowSnackMessageWithNotice("加载完成!"); }; await MessageService.ShowPercentProgress(action); } // Do:文本进度对话框 else if (command == "Button.ShowStringProgress") { Action <IStringProgress> action = l => { for (int i = 1; i <= 100; i++) { l.MessageStr = $"正在提交当前页第{i}份数据,共100份"; Thread.Sleep(10); } Thread.Sleep(1000); MessageService.ShowSnackMessageWithNotice("提交完成:成功100条,失败0条!"); }; await MessageService.ShowStringProgress(action); } // Do:文本进度对话框 else if (command == "Button.ShowTakStringProgress") { //Action<IStringProgress> action = l => //{ // for (int i = 1; i <= 100; i++) // { // l.MessageStr = $"正在提交当前页第{i}份数据,共100份"; // Thread.Sleep(10); // } // Thread.Sleep(1000); // MessageService.ShowSnackMessageWithNotice("提交完成:成功100条,失败0条!"); //}; StringProgressDialog dialog = new StringProgressDialog(); MessageService.ShowWithLayer(dialog); } // Do:确认取消对话框 else if (command == "Button.ShowResultMessge") { var result = await MessageService.ShowResultMessge("确认要退出系统?"); if (result) { MessageService.ShowSnackMessageWithNotice("你点击了取消"); } else { MessageService.ShowSnackMessageWithNotice("你点击了确定"); } } // Do:提示消息 else if (command == "Button.ShowSnackMessage") { MessageService.ShowSnackMessageWithNotice("这是提示消息?"); } // Do:气泡消息 else if (command == "Button.ShowNotifyMessage") { MessageService.ShowNotifyMessage("你有一条报警信息需要处理,请检查", "Notify By HeBianGu"); } // Do:气泡消息 else if (command == "Button.ShowIdentifyNotifyMessage") { MessageService.ShowNotifyDialogMessage("自定义气泡消息" + DateTime.Now.ToString("yyyy-mm-dd HH:mm:ss"), "友情提示", 5); } // Do:气泡消息 else if (command == "Button.ShowWindowSumitMessage") { MessageWindow.ShowSumit("这是窗口提示消息", "提示", true); } // Do:气泡消息 else if (command == "Button.ShowWindowResultMessage") { MessageWindow.ShowDialog("这是窗口提示消息", "提示", -1, true); } // Do:气泡消息 else if (command == "Button.ShowWindowIndentifyMessage") { List <Tuple <string, Action <MessageWindow> > > acts = new List <Tuple <string, Action <MessageWindow> > >(); Action <MessageWindow> action = l => { l.CloseAnimation(l); l.Result = true; MessageService.ShowSnackMessageWithNotice("你点到我了!"); }; acts.Add(Tuple.Create("按钮一", action)); acts.Add(Tuple.Create("按钮二", action)); acts.Add(Tuple.Create("按钮三", action)); MessageWindow.ShowDialogWith("这是自定义按钮提示消息", "好心提醒", true, acts.ToArray()); } // Do:气泡消息 else if (command == "Button.Upgrade") { UpgradeWindow window = new UpgradeWindow(); window.TitleMessage = "发现新版本:V3.0.1"; List <string> message = new List <string>(); message.Add("1、增加了检验更新和版本下载"); message.Add("2、增加了Mvc跳转页面方案"); message.Add("3、修改了一些已知BUG"); window.Message = message; var find = window.ShowDialog(); if (find.HasValue && find.Value) { DownLoadWindow downLoad = new DownLoadWindow(); downLoad.TitleMessage = "正在下载新版本:V3.0.1"; downLoad.Url = @"http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4"; downLoad.Message = message; downLoad.ShowDialog(); } //UpgradeWindow.BeginUpgrade("发现新版本:V3.0.1", @"http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4", // message.ToArray()); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Error")) { ErrorMessage message = new ErrorMessage(); message.Message = "错误信息!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Info")) { InfoMessage message = new InfoMessage(); message.Message = "提示信息!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Success")) { SuccessMessage message = new SuccessMessage(); message.Message = "保存成功!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Fatal")) { FatalMessage message = new FatalMessage(); message.Message = "问题很严重!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Warn")) { WarnMessage message = new WarnMessage(); message.Message = "警告信息!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Waitting")) { Func <WaittingMessage, bool> func = l => { l.Message = $"正在加载..."; Thread.Sleep(5000); return(true); }; var result = await MessageService.ShowWinWaittingMessage(func); if (result) { MessageService.ShowSnackMessageWithNotice("加载完成"); } } // Do:气泡消息 else if (command.StartsWith("Button.Message.StringProgrss")) { Func <StringProgressMessage, bool> func = l => { for (int i = 1; i <= 100; i++) { System.Windows.Application.Current.Dispatcher.Invoke(() => { l.Message = $"正在提交当前页第{i}份数据,共100份"; }); Thread.Sleep(50); } return(true); }; var result = await MessageService.ShowWinProgressStrMessage(func); if (result) { MessageService.ShowSnackMessageWithNotice("运行成功"); } } // Do:气泡消息 else if (command.StartsWith("Button.Message.PercentProgrss")) { Func <PercentProgressMessage, bool> func = l => { for (int i = 1; i <= 100; i++) { System.Windows.Application.Current.Dispatcher.Invoke(() => { l.Value = i; }); Thread.Sleep(50); } return(true); }; var result = await MessageService.ShowWinProgressBarMessage(func); if (result) { MessageService.ShowSnackMessageWithNotice("运行成功"); } } // Do:气泡消息 else if (command.StartsWith("Button.Message.Dailog")) { DailogMessage message = new DailogMessage(); message.Message = "可以保存了么?"; message.IsMatch = l => { if (random.Next(1, 3) == 1) { MessageService.ShowSnackMessageWithNotice("保存成功"); return(true); } else { MessageService.ShowSnackMessageWithNotice("保存失败"); return(false); } }; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.ShowCoverMessge")) { SettingControl setting = new SettingControl(); MessageService.ShowWithLayer(setting); } // Do:气泡消息 else if (command.StartsWith("Button.ShowObjectWithPropertyForm")) { Student student = new Student(); await MessageService.ShowObjectWithPropertyForm(student, l => true, "修改学生信息"); } // Do:气泡消息 else if (command == "Button.ShowObjectWithContent") { Student student = new Student(); Predicate <Student> match = l => { if (this.random.Next(3) == 1) { MessageService.ShowSnackMessageWithNotice("随机测试提交失败,请再试几次"); return(false); } else { MessageService.ShowSnackMessageWithNotice("随机测试提交成功,请再试几次"); return(true); } }; await MessageService.ShowObjectWithContent(student, match, "修改学生信息"); } // Do:气泡消息 else if (command == "Button.ShowObjectWithContent.WithValidation") { StudentViewModel student = new StudentViewModel(); Predicate <StudentViewModel> match = l => { //if (ObjectPropertyFactory.ModelState(student.Model,out List<string> errors)) if (student.ModelState(out List <string> errors)) { MessageService.ShowSnackMessageWithNotice("提交成功"); return(true); } else { MessageService.ShowSnackMessageWithNotice(errors?.FirstOrDefault()); return(false); } }; await MessageService.ShowObjectWithContent(student, match, "修改学生信息"); } else if (command == "Button.Add") { if (this.StoryBoardPlayerViewModel.PlayMode) { MessageService.ShowSnackMessageWithNotice("请先停止播放再进行添加!"); return; } this.StoryBoardPlayerViewModel.Create(); } else if (command == "init") { for (int i = 0; i < 60; i++) { ComboBoxItems.Add(new FComboBoxItemModel() { Header = "ComboBoxItem" + (ComboBoxItems.Count + 1), Value = (ComboBoxItems.Count + 1), CanDelete = true }); } } }
public override void buttonEventBase(GameObject gameObj) { base.buttonEventBase(gameObj); if (gameObj.name == "close") { finishWindow(); } else if (gameObj.name == "drawButton1") { if (isStorageFulls()) { return; } if (!isDrawCost(0)) { string str = getMSG(0); if (lucky.ways [0].getCostType() == PrizeType.PRIZE_RMB) { MessageWindow.ShowRecharge(str); } else { MessageWindow.ShowAlert(str); } return; } drawIndex = 0; LuckyDrawFPort port = FPortManager.Instance.getFPort("LuckyDrawFPort") as LuckyDrawFPort; port.luckyDraw(1, lucky.sid, 1, lucky.ways [0], luckyDrawCallBack); } else if (gameObj.name == "drawButton2") { if (isStorageFulls()) { return; } if (isShowPromt && !isDrawCost(1)) { string str = getMSG(1); if (lucky.ways [1].getCostType() == PrizeType.PRIZE_RMB) { MessageWindow.ShowRecharge(str); } else { MessageWindow.ShowAlert(str); } return; } if (isSend) { drawIndex = 1; LuckyDrawFPort port = FPortManager.Instance.getFPort("LuckyDrawFPort") as LuckyDrawFPort; port.luckyDraw(drawTimes, lucky.sid, 1, lucky.ways [0], luckyDrawMultipleCallBack); UiManager.Instance.applyMask(); } else { drawIndex = 1; LuckyDrawFPort ports = FPortManager.Instance.getFPort("LuckyDrawFPort") as LuckyDrawFPort; ports.luckyDraw(10, lucky.sid, 2, lucky.ways [1], luckyDrawMultipleCallBack); } } }
public ButtonsOK(MessageWindow parent) { _parent = parent; InitializeComponent(); }
// Use this for initialization void Start() { mw = window.GetComponent <MessageWindow>(); myText = mw.pauseUI.GetComponentInChildren <Text>(); textCounter = 0; }
public Spec(int modifier, int key, #if PocketPC MessageWindow msgwin
public static void Show(string Msg) { MessageWindow mw = new MessageWindow(Msg); mw.Show(); }