public static string GetDescription(this InformationMessage message, Context context) { switch (message) { case InformationMessage.GpsDisabled: return(context.GetString(Resource.String.Vernacular_P0_information_message_description_gps_off)); case InformationMessage.GpsUnfixed: return(context.GetString(Resource.String.Vernacular_P0_information_message_description_gps_unfixed)); case InformationMessage.GpsSuspendedStationary: return(context.GetString(Resource.String.Vernacular_P0_information_message_description_gps_suspended_stationary)); case InformationMessage.GpsSuspendedSpeed: return(context.GetString(Resource.String.Vernacular_P0_information_message_description_gps_suspended_speed)); case InformationMessage.UploadFailure: return(context.GetString(Resource.String.Vernacular_P0_information_message_description_upload_failure)); case InformationMessage.InternalEngineError: return(context.GetString(Resource.String.Vernacular_P0_information_message_description_engine_error)); case InformationMessage.OutOfCountry: return(context.GetString(Resource.String.Vernacular_P0_information_message_description_out_of_country)); case InformationMessage.Syncing: return(context.GetString(Resource.String.Vernacular_P0_information_message_description_syncing)); } return(string.Empty); }
public void Hide(InformationMessage message) { //Remove pending messages of same type _messages = new Queue <InformationMessageQueueEntry>(from m in _messages where m.Message != message select m); if (_currentMessage != message) { Log.Debug("Cannot remove message {0} since it is not shown currently", message); return; } if (_animatorSlideOut != null && _animatorSlideOut.IsRunning) { //Message to remove is still animating in, kill animation _animatorSlideOut.Cancel(); _animatorSlideOut = null; _currentMessage = null; } Log.Debug("Hiding currently shown message {0}", _currentMessage); _animatorSlideOut = _viewMessage.SlideOut(500, this); if (_isButtonShown && _viewButton != null) { PrepareButtonAnimation(); _viewButton.DecelerateToY(_buttonStopTranslationOn, 500); } }
public static Drawable GetIcon(this InformationMessage message, Context context) { switch (message) { case InformationMessage.GpsDisabled: case InformationMessage.OutOfCountry: return(context.Resources.GetDrawable(Resource.Drawable.ic_location_off_white_36dp)); case InformationMessage.GpsUnfixed: case InformationMessage.GpsSuspendedStationary: case InformationMessage.GpsSuspendedSpeed: return(context.Resources.GetDrawable(Resource.Drawable.ic_location_on_white_36dp)); case InformationMessage.UploadFailure: return(context.Resources.GetDrawable(Resource.Drawable.ic_sync_problem_red_36dp)); case InformationMessage.InternalEngineError: return(context.Resources.GetDrawable(Resource.Drawable.ic_error_red_36dp)); case InformationMessage.Syncing: return(context.Resources.GetDrawable(Resource.Drawable.ic_sync_white_36dp)); } return(null); }
public static string GetDescription(this InformationMessage message) { switch (message) { case InformationMessage.GpsDisabled: return(NSBundle.MainBundle.LocalizedString("Vernacular_P0_information_message_description_gps_off", null)); case InformationMessage.GpsUnfixed: return(NSBundle.MainBundle.LocalizedString("Vernacular_P0_information_message_description_gps_unfixed", null)); case InformationMessage.GpsSuspendedSpeed: return(NSBundle.MainBundle.LocalizedString("Vernacular_P0_information_message_description_gps_suspended_speed", null)); case InformationMessage.GpsSuspendedStationary: return(NSBundle.MainBundle.LocalizedString("Vernacular_P0_information_message_description_gps_suspended_stationary", null)); case InformationMessage.UploadFailure: return(NSBundle.MainBundle.LocalizedString("Vernacular_P0_information_message_description_upload_failure", null)); case InformationMessage.InternalEngineError: return(NSBundle.MainBundle.LocalizedString("Vernacular_P0_information_message_description_engine_error", null)); case InformationMessage.OutOfCountry: return(NSBundle.MainBundle.LocalizedString("Vernacular_P0_information_message_description_out_of_country", null)); } return(string.Empty); }
private void DisplayModLoadedMessage() { var message = new InformationMessage($"Loaded {Config.ModInfo.Name} {Config.ModInfo.Version}", Color.FromUint(4282569842U)); InformationManager.DisplayMessage(message); }
public void Should_serialize_information_message() { var message = new InformationMessage("information message"); var output = serializeDeserialize <InformationMessage>(message); output.Message.ShouldEqual("information message"); }
private void listen() { listener.Start(); try { while (true) { TcpClient tcpClient = listener.AcceptTcpClient(); Client client = ClientManager.addClient(tcpClient); InformationMessage.show("client connected with endpoint: " + client.TcpClient.Client.RemoteEndPoint.ToString()); Thread receiveThread = new Thread(receive); receiveThread.Start(client); } } catch (ThreadAbortException e) { ErrorMessage.show("listen thread aborting, exception was:\r\n" + e.ToString()); } catch (SocketException e) { ErrorMessage.show("SocketException in listen thread, maybe the socket shut down, exception was:\r\n" + e.ToString()); } finally { listener.Stop(); DebugMessage.show("exiting listen thread"); } }
// Use this for initialization void Start () { im = GameObject.FindGameObjectWithTag("message").GetComponent<InformationMessage>(); GetComponent<customCharController>().OnDie += HandleDying; anim = GetComponent<Animator>(); source = GetComponent<AudioSource>(); amscript = GameObject.Find("AudioManagerCust").GetComponent<CustomAudioManager>(); }
private void DisplayModInactiveWarning() { var message = new InformationMessage( "Better Quicksave failed to initialize. Vanilla quicksave behavior is active!", Color.FromUint(16711680U)); InformationManager.DisplayMessage(message); }
void OnEnable() { im = GameObject.FindGameObjectWithTag("message").GetComponent <InformationMessage>(); enemyCount = 2; deathCount = 0; waveCount = 1; canSpawn = true; }
public MessageInfo(InformationMessage message) : this(message.MessageType) { AddValue("Server Version", GetVersionString(message.ServerVersion)); AddDocument("Recorder Configuration", message.RecorderConfiguration); AddDocument("Site Configuration", message.SiteConfiguration); }
/// <summary> /// Reads studio projects from project.xml /// Adds projects to listbox /// </summary> private void LoadProjectsList(string projectXmlPath, List <string> studioProjectsPaths) { try { var projectXmlDocument = new XmlDocument(); var filePathNames = _projectService.AddFilePaths(studioProjectsPaths); if (!IsNullOrEmpty(projectXmlPath)) { var projectsWithoutAnalysis = new List <string>(); projectXmlDocument.Load(projectXmlPath); var projectsNodeList = projectXmlDocument.SelectNodes("//ProjectListItem"); if (projectsNodeList == null) { return; } var studioProjects = _projectService.GetSelectedStudioProjects(); foreach (XmlNode xmlNode in projectsNodeList) { var projectId = GetAttributeValue(xmlNode, "Guid"); var projectInfo = studioProjects.FirstOrDefault(a => a.GetProjectInfo()?.Id.ToString() == projectId)?.GetProjectInfo(); if (projectInfo == null) { continue; } var reportsFolderPath = Path.Combine(projectInfo.LocalProjectFolder, "Reports"); var projectInfoNode = xmlNode.SelectSingleNode("./ProjectInfo"); if (projectInfoNode?.Attributes != null) { var reportExist = _reportService.ReportFolderExist(xmlNode, _projectService.ProjectsXmlPath); if (reportExist) { SetProjectDetails(reportsFolderPath, projectInfoNode, xmlNode, filePathNames); } else { projectsWithoutAnalysis.Add(projectInfo.Name); } } } SetProjectDataSource(); if (projectsWithoutAnalysis.Count > 0 && !_settingsService.GetSettings().DontShowInfoMessage) { var messageBox = new InformationMessage(_settingsService, projectsWithoutAnalysis); messageBox.ShowDialog(); } } } catch (Exception ex) { _logger.Error($"LoadProjectsList method: {ex.Message}\n {ex.StackTrace}"); } }
public void Should_be_able_to_consume_information_message() { var consumer = new InformationMessageConsumer(_bus); var message = new InformationMessage(""); _bus.Publish <InformationMessage>(message); waitForAsyncCall(); consumer.InformationMessageEventWasCalled.ShouldBeTrue(); }
/// <summary> /// ダイアログ表示 /// </summary> /// <param name="message"></param> private void InformationMessage(InformationMessage message) { _ = TaskDialog.ShowDialog(this._hwnd, new() { Caption = message.Caption, Text = message.Text, Icon = GetDialogIcon(message.Image), }); }
public void RecievingInformationMessage(InformationMessage message) { _syncContext.Post(m => { addToList(m); if (MessageArrived != null) MessageArrived(this, new MessageRecievedEventArgs(MessageType.Information)); }, message.Message); }
private void stop() { InformationMessage.show("stopping listener"); listener.Stop(); InformationMessage.show("stopping sender"); sendThread.Abort(); InformationMessage.show("stopping receivers"); ClientManager.removeAllClients(); }
public void ShowInfo() { InformationMessage msg = new InformationMessage(); msg.ShowDialog(); if (msg.DialogResult != WinForms.DialogResult.OK) { throw new RanorexException("[WIFI-Connection only]: You have to confirm the dialog to allow installing the application on your mobile device!"); } }
public void RecievingInformationMessage(InformationMessage message) { _syncContext.Post(m => { addToList(m); if (MessageArrived != null) { MessageArrived(this, new MessageRecievedEventArgs(MessageType.Information)); } }, message.Message); }
/// <summary> /// Shows a given message if a condition is satisfied. Otherwise the message is removed. /// </summary> public void ShowIf(InformationMessage message, bool condition) { if (condition) { Show(message); } else { Hide(message); } }
// Use this for initialization void Awake() { if (instace == null) { instace = this; } if (text == null) { text = GetComponentInChildren <Text>(); } }
public static bool Information(string txt) { Program.Loggers.Log.Add(() => "user information: " + txt); if (QuestionMessage != null) { return(InformationMessage.ShowMessage(txt)); } return(false); }
private void receive(object threadArgs) { Client client = (Client)threadArgs; TcpClient tcpClient = client.TcpClient; NetworkStream clientStream = tcpClient.GetStream(); string endpointAddress = tcpClient.Client.RemoteEndPoint.ToString(); byte[] received = new byte[4096]; int bytesRead; try { while (true) { bytesRead = clientStream.Read(received, 0, received.Length); if (bytesRead == 0) { break; } InformationMessage.show("received message from: " + endpointAddress); DebugMessage.show("message length: " + bytesRead.ToString()); byte[] message = new byte[bytesRead]; Array.Copy(received, message, bytesRead); msgQueue.Enqueue(Interpreter.interpret(message, client)); newData.Set(); } } catch (ThreadAbortException e) { ErrorMessage.show("receive thread aborting, exception was:\r\n" + e.ToString()); } catch (IOException e) { ErrorMessage.show("IOException in receive thread, maybe the socket shut down, exception was:\r\n" + e.ToString()); } catch (ObjectDisposedException e) { ErrorMessage.show("ObjectDisposedException in receive thread, maybe the socket shut down, exception was:\r\n" + e.ToString()); } finally { ClientManager.removeClient(client); InformationMessage.show("client " + endpointAddress + " disconnected, closing thread"); } }
public static Color GetTitleColor(this InformationMessage message, Context context) { switch (message) { case InformationMessage.UploadFailure: case InformationMessage.InternalEngineError: return(context.Resources.GetColor(Resource.Color.error)); default: return(context.Resources.GetColor(Resource.Color.theme_primary)); } }
private void DoBribe() { Hero.MainHero.ChangeHeroGold(-GuardsBribeAmount); GameTexts.SetVariable("GOLD_AMOUNT", GuardsBribeAmount); var message = new InformationMessage(GameTexts.FindText("str_gold_removed_with_icon", null).ToString(), "event:/ui/notification/coins_negative"); InformationManager.DisplayMessage(message); Mission.GetMissionBehaviour <AssassinationOutcomeLogic>().OnGuardsAcceptedBribe(); }
public static UIColor GetTitleColor(this InformationMessage message) { switch (message) { case InformationMessage.UploadFailure: case InformationMessage.InternalEngineError: return(StyleSettings.ErrorColor()); default: return(StyleSettings.ThemePrimaryColor()); } }
private void tryAddProject(string project) { try { _cache.Add <Project>(Path.GetFullPath(project)); } catch (Exception exception) { var messageString = string.Format("Failed parsing project {0}. Project will not be built. ({1})", project, exception.Message); var message = new InformationMessage(messageString); _bus.Publish <InformationMessage>(message); } }
private void HandleInformationMessages(InformationMessage message) { logger.Trace($"Got an information message [{message.Content}]"); if (!string.IsNullOrWhiteSpace(message.ActionContent) && message.ActionHandler != null) { shell.ShowMessage(message.Content, message.ActionContent, message.ActionHandler); } else { shell.ShowMessage(message.Content); } }
private void tryAddProject(string project) { try { _cache.Add<Project>(Path.GetFullPath(project)); } catch (Exception exception) { var messageString = string.Format("Failed parsing project {0}. Project will not be built. ({1})", project, exception.Message); var message = new InformationMessage(messageString); _bus.Publish<InformationMessage>(message); } }
protected override void OnSubModuleLoad() { InformationMessage message = new InformationMessage("Hello from ExampleModule!"); InitialStateOption initStateOpt = new InitialStateOption( "ExampleModule", new TextObject("ExampleModule", null), 9990, () => InformationManager.DisplayMessage(message), false ); Module.CurrentModule.AddInitialStateOption(initStateOpt); }
public async void Initialize() { await GetGlobalLock(); try { Util.LogHandlers.Add(AddLog); Server = new EncodeServer(App.Option.ServerPort, null, async() => { await RealCloseWindow(); }); await Server.Init(); RaisePropertyChanged(nameof(Server)); WindowCaption = "AmatsukazeServer" + Server.Version + "@" + Dns.GetHostName() + ":" + App.Option.ServerPort; // SleepCancel SleepCancelVM = new SleepCancelViewModel() { Model = Server }; var modelListener = new PropertyChangedEventListener(Server); modelListener.Add(() => Server.SleepCancel, (_, __) => ShowOrCloseSleepCancel()); CompositeDisposable.Add(modelListener); } catch (Exception e) { var message = new InformationMessage( "起動処理でエラーが発生しました\r\n" + e.Message + "\r\n" + e.StackTrace, "AmatsukazeServer", "Message"); await Messenger.RaiseAsync(message); await RealCloseWindow(); } if (App.Option.LaunchType == LaunchType.Debug) { var asm = Assembly.GetExecutingAssembly().GetName(); Process.Start(new ProcessStartInfo() { FileName = $"{AppContext.BaseDirectory}{asm.Name}.exe", Arguments = "--launch client", }); } }
private static async Task ShowInformationDialogAsync(InformationMessage message) { if (message is ExceptionMessage) { Trace.TraceError($"Exception: { message.VM.Details }"); } var window = new InformationWindow() { VM = message.VM }; await window.ShowDialog(MainWindow); message.Process(); }
private static void ShowInformation(InformationMessage message) { InformationWindow window = new InformationWindow { DataContext = message.InformationVM }; message.InformationVM.RequestClose += (sender, e) => { window.Close(); }; window.Closed += (sender, args) => { message.Process(); }; window.Show(); }
public void Should_be_able_to_consume_information_message() { var consumer = new InformationMessageConsumer(_bus); var message = new InformationMessage(""); _bus.Publish<InformationMessage>(message); waitForAsyncCall(); consumer.InformationMessageEventWasCalled.ShouldBeTrue(); }
public InformationMessageEventArgs(InformationMessage message) { Message = message; }
public void RecievingInformationMessage(InformationMessage message) { _informationmessage = message; }
public void RecievingInformationMessage(InformationMessage message) { listViewInformation.Items.Add(message.Message); }
public void RecievingInformationMessage(InformationMessage message) { _logger.Info(message.Message); }