コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        private void DisplayModLoadedMessage()
        {
            var message = new InformationMessage($"Loaded {Config.ModInfo.Name} {Config.ModInfo.Version}",
                                                 Color.FromUint(4282569842U));

            InformationManager.DisplayMessage(message);
        }
コード例 #6
0
        public void Should_serialize_information_message()
        {
            var message = new InformationMessage("information message");
            var output  = serializeDeserialize <InformationMessage>(message);

            output.Message.ShouldEqual("information message");
        }
コード例 #7
0
        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");
            }
        }
コード例 #8
0
ファイル: DyingMechanic.cs プロジェクト: cri699/SGM1
    // 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>();
    }
コード例 #9
0
        private void DisplayModInactiveWarning()
        {
            var message = new InformationMessage(
                "Better Quicksave failed to initialize. Vanilla quicksave behavior is active!",
                Color.FromUint(16711680U));

            InformationManager.DisplayMessage(message);
        }
コード例 #10
0
ファイル: EnemyManager.cs プロジェクト: cri699/SGM1
 void OnEnable()
 {
     im         = GameObject.FindGameObjectWithTag("message").GetComponent <InformationMessage>();
     enemyCount = 2;
     deathCount = 0;
     waveCount  = 1;
     canSpawn   = true;
 }
コード例 #11
0
        public MessageInfo(InformationMessage message)
            : this(message.MessageType)
        {
            AddValue("Server Version", GetVersionString(message.ServerVersion));

            AddDocument("Recorder Configuration", message.RecorderConfiguration);
            AddDocument("Site Configuration", message.SiteConfiguration);
        }
コード例 #12
0
        /// <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}");
            }
        }
コード例 #13
0
        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();
        }
コード例 #14
0
 /// <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),
     });
 }
コード例 #15
0
 public void RecievingInformationMessage(InformationMessage message)
 {
     _syncContext.Post(m =>
                           {
                               addToList(m);
                               if (MessageArrived != null)
                                   MessageArrived(this, new MessageRecievedEventArgs(MessageType.Information));
                           }, message.Message);
 }
コード例 #16
0
 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!");
            }
        }
コード例 #18
0
 public void RecievingInformationMessage(InformationMessage message)
 {
     _syncContext.Post(m =>
     {
         addToList(m);
         if (MessageArrived != null)
         {
             MessageArrived(this, new MessageRecievedEventArgs(MessageType.Information));
         }
     }, message.Message);
 }
コード例 #19
0
 /// <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);
     }
 }
コード例 #20
0
 // Use this for initialization
 void Awake()
 {
     if (instace == null)
     {
         instace = this;
     }
     if (text == null)
     {
         text = GetComponentInChildren <Text>();
     }
 }
コード例 #21
0
        public static bool Information(string txt)
        {
            Program.Loggers.Log.Add(() => "user information: " + txt);

            if (QuestionMessage != null)
            {
                return(InformationMessage.ShowMessage(txt));
            }

            return(false);
        }
コード例 #22
0
        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");
            }
        }
コード例 #23
0
        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();
        }
コード例 #25
0
        public static UIColor GetTitleColor(this InformationMessage message)
        {
            switch (message)
            {
            case InformationMessage.UploadFailure:
            case InformationMessage.InternalEngineError:
                return(StyleSettings.ErrorColor());

            default:
                return(StyleSettings.ThemePrimaryColor());
            }
        }
コード例 #26
0
 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);
     }
 }
コード例 #27
0
        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);
            }
        }
コード例 #28
0
        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);
			}
		}
コード例 #29
0
        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);
        }
コード例 #30
0
ファイル: ServerViewModel.cs プロジェクト: R2Lish/Amatsukaze
        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",
                });
            }
        }
コード例 #31
0
        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();
        }
コード例 #32
0
ファイル: MessageHandlers.cs プロジェクト: Khaleesh/Mzinga
        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();
        }
コード例 #33
0
        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();

        }
コード例 #34
0
 public InformationMessageEventArgs(InformationMessage message)
 {
     Message = message;
 }
コード例 #35
0
 public void RecievingInformationMessage(InformationMessage message)
 {
     _informationmessage = message;
 }
コード例 #36
0
 public void RecievingInformationMessage(InformationMessage message)
 {
     listViewInformation.Items.Add(message.Message);
 }
コード例 #37
0
 public void RecievingInformationMessage(InformationMessage message)
 {
     _logger.Info(message.Message);
 }