コード例 #1
0
        protected void HandleSyncMessage(SnooperExportBase exportObject, IExportSource exportSource, MNMessagesSyncClientPayload syncClientPayload, DateTime timestamp, IEnumerable <PmFrameBase> frames)
        {
            foreach (var syncDeltaWrapper in syncClientPayload.Deltas)
            {
                MessengerEventBase deltaEvent = null;
                if (syncDeltaWrapper.DeltaNewMessage != null)
                {
                    deltaEvent = new MessengerEventReceiveMessage(exportObject, syncDeltaWrapper.DeltaNewMessage);
                }
                else
                {
                    continue;
                }

                this.OnAfterProtocolParsing();

                deltaEvent.TimeStamp = timestamp;
                deltaEvent.Frames.AddRange(frames);

                this.OnBeforeDataExporting();
                deltaEvent.ExportSources.Add(exportSource);
                this.SnooperExport.AddExportObject(deltaEvent);
                this.OnAfterDataExporting();
            }
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseObject"/> class.
        /// </summary>
        /// <param name="sOrigUrl">The original URL.</param>
        /// <param name="sPathToFile">The path to file.</param>
        /// <param name="sFileName">Name of the file.</param>
        /// <param name="sFileExtension">The file extension.</param>
        /// <param name="sContentType">Type of the content.</param>
        /// <param name="oRequestMsg">The request message.</param>
        /// <param name="listCookieInformation">The list cookie information.</param>
        public BaseObject(
            string sOrigUrl,
            string sPathToFile,
            string sFileName,
            string sFileExtension,
            string sContentType,
            HTTPMsg oRequestMsg,
            List <string> listCookieInformation)
        {
            this.RequestMessage = oRequestMsg;
            this.OriginalUrl    = sOrigUrl;
            this.PathToFileName = sPathToFile;
            this.FileName       = sFileName;
            this.FileExtension  = sFileExtension;
            this.ContentType    = sContentType;

            this.Referrer    = ObjectParser.ParseReferer((HttpRequestHeader)oRequestMsg.HTTPHeader);
            this.HostAddress = ObjectParser.ParseHostAddress((HttpRequestHeader)oRequestMsg.HTTPHeader);

            this.Content      = oRequestMsg.PairMessages[0].HTTPContent.Content;
            this.TimeStamp    = oRequestMsg.TimeStamp;
            this.ExportSource = oRequestMsg.ExportSources[0];

            this.CookieInformation = listCookieInformation;
            this.UniqueHash        = ComputeHash.GetMd5Hash(this.Content);


            this.FileSize            = this.Content.LongLength;
            this.ListOfNewReferences = new List <string>();
        }
コード例 #3
0
        // Handle event of given event class
        protected MessengerEventBase HandleEvent <THangoutsEventClass>(SnooperExportBase exportObject, IExportSource exportSource, byte[] payload)
        {
            if (!typeof(THangoutsEventClass).IsSubclassOf(typeof(MessengerEventBase)))
            {
                throw new Exception("Not a MessengerEventBase subclass");
            }

            // try, except create report
            var messengerEvent = (MessengerEventBase)Activator.CreateInstance(typeof(THangoutsEventClass), new object[] { exportObject, payload });

            this.OnAfterProtocolParsing();

            this.OnBeforeDataExporting();
            messengerEvent.ExportSources.Add(exportSource);
            this.SnooperExport.AddExportObject(messengerEvent);
            this.OnAfterDataExporting();

            return(messengerEvent);
        }
コード例 #4
0
 public static void ExportDataTables(IWin32Window owner, IExportSource source)
 {
     using var frm = new ExportTablesForm();
     frm.SetExportSource(source);
     frm.ShowDialog(owner);
 }
コード例 #5
0
 public void ExportDataTables(IExportSource source) =>
 ExportDataTables(_Owner, source);
コード例 #6
0
        protected TwitterEventBase HandleEvent <TTwitterEventClass>(SnooperExportBase exportObject, IExportSource exportSource, SPDYMsg spdyMsg)
        {
            if (!typeof(TTwitterEventClass).IsSubclassOf(typeof(TwitterEventBase)))
            {
                throw new Exception("Not a TwitterEventBase subclass");
            }

            TwitterEventBase twitterEvent;

            try {
                twitterEvent = (TwitterEventBase)Activator.CreateInstance(typeof(TTwitterEventClass), new object[] { exportObject, spdyMsg });
            }
            catch (Exception) {
                return(null);
            }

            this.OnAfterProtocolParsing();

            this.OnBeforeDataExporting();
            twitterEvent.ExportSources.Add(exportSource);
            this.SnooperExport.AddExportObject(twitterEvent);
            this.OnAfterDataExporting();

            return(twitterEvent);
        }