Пример #1
0
 public static List <Disposition> Default(this List <Disposition> list, DateTime target, ScaleOption option)
 {
     list.Add(new Disposition()
     {
         Key       = "importance",
         Token     = option.ToString().ToLower(),
         Display   = option.ToString(),
         StartedAt = target
     });
     list.Add(new Disposition()
     {
         Key       = "urgency",
         Token     = option.ToString().ToLower(),
         Display   = option.ToString(),
         StartedAt = target
     });
     list.Add(new Disposition()
     {
         Key       = "status",
         Token     = StatusOption.None.ToString().ToLower(),
         Display   = StatusOption.None.ToString(),
         StartedAt = target
     });
     return(list);
 }
Пример #2
0
        public void SetScale(Int32 input)
        {
            Debug.Log("Setting scale choice to " + input);
            MyContract.RequireArgument(
                input == 0 || input == 1,
                "is either 0 or 1",
                "input"
                );
            ScaleOption ScaleChoice = (ScaleOption)input;

            Debug.Log("Setting scale choice to " + ScaleChoice.ToString());
            SetScaleInputsActive(CurrentScaleType, ScaleChoice);
        }
Пример #3
0
        public static void Alert(string title, string message, string[] categories, ScaleOption urgency, ScaleOption importance, IDictionary <string, object> properties, params string[] targets)
        {
            //EventWriter.Alert(title, message, categories, urgency, importance, properties, targets);
            var props = Writer.EnsureProperties(properties);

            props.Add(XFConstants.EventWriter.EventType, EventTypeOption.Alert);
            props.Add(XFConstants.Alert.Title, title);
            props.Add(XFConstants.Alert.Message, message);
            props.Add(XFConstants.Alert.Categories, categories.ToDelimited('|'));
            props.Add(XFConstants.Alert.Urgency, urgency.ToString());
            props.Add(XFConstants.Alert.Importance, importance.ToString());
            props.Add(XFConstants.Alert.Targets, targets.ToDelimited('|'));
            props.Add(XFConstants.Alert.CreatedAt, DateTime.Now.ToString(XFConstants.DateTimeFormat));

            List <TypedItem> list = Writer.Convert(props);

            EventWriter.Write(EventTypeOption.Alert, list);
        }