Alert Customization

Version 4

    First a little background on using alerts.

    http://resources.arcfmsolution.com/10.2.1a/ResponderUsing/Alerts.html

     

    To create a custom alert we will create a new filter

    http://resources.arcfmsolution.com/10.2.1a/ResponderSDK/RxFilters.html

     

    This is controlled in xml, in ControlStylesConfig.xml

    the alert Setting object is defined as

    public partial class AlertSettings
    {
        //These are defined in HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default
    //Play sound help https://msdn.microsoft.com/en-us/library/windows/desktop/dd743680(v=vs.85).aspx
        public string Sound { get; set; }
    //Color Structure Color Structure (System.Drawing)https://msdn.microsoft.com/en-us/library/system.drawing.color(v=vs.110).aspx
      public string ForeColor { get; set; }
    //https://msdn.microsoft.com/en-us/library/system.drawing.color(v=vs.110).aspx
        public string BackColor { get; set; }
    //http://resources.arcfmsolution.com/10.0.2/ResponderSDK/Miner.Data.Configuration~FontSettings_members.html
        public FontSettings Font { get; set; }
        public string Image { get; set; }
        public string Key { get; set; }
        public string DisplayCategory { get; set; }
        public bool UseDialog { get; set; }
    }
    
    
    
    
    

    in Control Styles under the allerts section this might look like

      <Alert Key="Alert_NewIncident" DisplayCategory="IncidentActivation" UseDialog="true">
            <Sound>SystemExclamation</Sound>
            <ForeColor>Red</ForeColor>
            <Sound>SystemExclamation</Sound>
            <BackColor>Yellow</BackColor>
      </Alert>
    
    
    
    
    
    
    

    The Key is Tied to an appearance with the same value under a different section.

    <Appearance Key="Alert_NewIncident">
    <!--vbs script functions https://msdn.microsoft.com/en-us/library/3ca8tfek(v=vs.84).aspx-->
        <Evaluator>Vbs:Now &lt; DateAdd("n", 1,[TimeCreated])</Evaluator>
        <Caption>Hazard Incident [ID]</Caption>
        <Description>Hazards at Incident [ID]</Description>
    </Appearance>
    
    
    
    
    

     

    The alerts table is defined under the Alerts table at the top of the file. Any appearance with the same key below will tie into that table and display the alert. The UseDialog(default of false) will throw a message box forcing acknowledgement.

     

    So as this is setup every time you get a new incident in the grid with a time created less than 1 minute ago you will get a new alert, with the  SystemExclamation sound, Red ForeColor and a yellow BackColor. Not very pretty but should demonstrate how to do it.