示例#1
0
 public Clipboard_Data(CommentBox b, System.Guid g)
 {
     this.kind = kinds.comment;
     symbols   = null;
     cb        = b;
     guid      = g;
     log       = null;
 }
示例#2
0
 public Clipboard_Data(Component c, System.Guid g, logging_info l)
 {
     this.kind = kinds.symbols;
     symbols   = c;
     cb        = null;
     guid      = g;
     log       = l;
 }
示例#3
0
        public logging_info Clone()
        {
            logging_info result = new logging_info();

            result.events = (System.Collections.ArrayList)
                            this.events.Clone();
            return(result);
        }
示例#4
0
 public static bool Last_Pair(string username,
                              string machinename,
                              logging_info log,
                              int i)
 {
     for (int j = i + 1; j < log.events.Count; j++)
     {
         if ((((event_record)log.events[j]).Kind == event_kind.Paste_Saved) &&
             (((event_record)log.events[j]).Username == username) &&
             (((event_record)log.events[j]).Machine_Name == machinename))
         {
             return(false);
         }
     }
     return(true);
 }
示例#5
0
        public void Record_Paste(logging_info log,
                                 int count_symbols,
                                 System.Guid guid)
        {
            this.events.Add(new event_record(
                                count_symbols.ToString(),
                                guid.ToString(),
                                event_kind.Pasted_From,
                                System.DateTime.Now));
            // loop through the log, changing everything to paste_XXX
            for (int i = 0; i < log.events.Count; i++)
            {
                event_record e = (event_record)log.events[i];
                switch (e.Kind)
                {
                case event_kind.Opened:
                    e.Kind = event_kind.Paste_Opened;
                    break;

                case event_kind.Saved:
                    e.Kind = event_kind.Paste_Saved;
                    break;

                case event_kind.Autosaved:
                    e.Kind = event_kind.Paste_Autosaved;
                    break;
                }
            }
            for (int i = 0; i < log.events.Count; i++)
            {
                event_record e = (event_record)log.events[i];
                if ((e.Username != System.Environment.UserName ||
                     e.Machine_Name != System.Environment.MachineName) &&
                    e.Kind == event_kind.Paste_Saved &&
                    (New_Pair(e.Username, e.Machine_Name, log, i) ||
                     Last_Pair(e.Username, e.Machine_Name, log, i)))
                {
                    this.events.Add(e);
                }
            }
        }