예제 #1
0
        public void BeginEvent(string name, string id, string path, string status, string icon, string database, bool keepOpen)
        {
            dynamic cur = new ExpandoObject();

            cur.Name         = name;
            cur.Id           = id;
            cur.Path         = path;
            cur.Icon         = icon;
            cur.Operation    = status.Trim().Replace(" ", "_");
            cur.DatabaseName = database;
            lock (_listLocker)
            {
                if (LinesSupport.ContainsKey(id))
                {
                    cur.Events = LinesSupport[id].Events;
                }
                else
                {
                    cur.Events = new Dictionary <string, List <Tuple <string, string> > >();
                }
            }
            LinesSupport[id] = cur;
            if (!keepOpen)
            {
                CompleteEvent(id);
            }
        }
예제 #2
0
        public void ResetFieldThatDidNotExistInSerialized(Field field)
        {
            string status = $"{DateTime.Now:h:mm:ss tt} [FIELD RESET] Reset a field {field.Name} that doesn't exist in item {field.Item.DisplayName} - {field.Item.ID}";

            AddToLog(status);
            Log.Info(status, this);
            if (!LinesSupport.ContainsKey(field.Item.ID.Guid.ToString()))
            {
                LinesSupport[field.Item.ID.Guid.ToString()] = new { Events = new Dictionary <string, List <Tuple <string, string> > >() }
            }
            ;
            if (!LinesSupport[field.Item.ID.Guid.ToString()].Events.ContainsKey(field.Item.Language.Name + " v" + field.Item.Version.Number))
            {
                LinesSupport[field.Item.ID.Guid.ToString()].Events[field.Item.Language.Name + " v" + field.Item.Version.Number] = new List <Tuple <string, string> >();
            }
            LinesSupport[field.Item.ID.Guid.ToString()].Events[field.Item.Language.Name + " v" + field.Item.Version.Number].Add(new Tuple <string, string>(field.DisplayName,
                                                                                                                                                           HtmlDiff.HtmlDiff.Execute(HttpUtility.HtmlEncode(field.Value), "")));
        }
예제 #3
0
        public void UpdatedChangedFieldValue(Item item, IItemFieldValue field, string oldValue)
        {
            string status = $"{DateTime.Now:h:mm:ss tt} [FIELD CHANGED] Field {field.NameHint} value changed for item {item.DisplayName} - {item.ID} from {oldValue} to {item[new ID(field.FieldId)]}";

            AddToLog(status);
            Log.Info(status, this);
            if (!LinesSupport.ContainsKey(item.ID.Guid.ToString()))
            {
                LinesSupport[item.ID.Guid.ToString()] = new { Events = new Dictionary <string, List <Tuple <string, string> > >() }
            }
            ;
            if (!LinesSupport[item.ID.Guid.ToString()].Events.ContainsKey(item.Language.Name + " v" + item.Version.Number))
            {
                LinesSupport[item.ID.Guid.ToString()].Events[item.Language.Name + " v" + item.Version.Number] = new List <Tuple <string, string> >();
            }
            LinesSupport[item.ID.Guid.ToString()].Events[item.Language.Name + " v" + item.Version.Number].Add(new Tuple <string, string>(field.NameHint,
                                                                                                                                         HtmlDiff.HtmlDiff.Execute(HttpUtility.HtmlEncode(oldValue), HttpUtility.HtmlEncode(item[new ID(field.FieldId)]))));
        }