Example #1
0
        private void ButtonWriteToFile_Drop(object sender, DragEventArgs e)
        {
            Bib3.FCL.GBS.Extension.CatchNaacMessageBoxException(() =>
            {
                var FilePath = Bib3.FCL.Glob.DataiPfaadAlsKombinatioonAusSctandardPfaadUndFileDrop(
                    "ToBotSnapshot", e);

                if (null == Presented)
                {
                    throw new ArgumentNullException("Presented");
                }

                var Snapshot = Presented.Snapshot;

                if (null == Snapshot)
                {
                    throw new ArgumentNullException("Snapshot");
                }

                var SensorSnapshotSerial = ToCustomBotSnapshot.SerializeToString(Snapshot);

                var SensorSnapshotSerialUTF8 = Encoding.UTF8.GetBytes(SensorSnapshotSerial);

                Bib3.Glob.ScraibeInhaltNaacDataiPfaad(FilePath, SensorSnapshotSerialUTF8);
            });
        }
Example #2
0
        public string Request(System.Net.HttpListenerRequest Request)
        {
            return
                (KapseleInCatch(new Func <string>(() =>
            {
                if (null == Request)
                {
                    return null;
                }

                ++RequestAnzaal;

                ListeRequestLezteZait = Bib3.Glob.StopwatchZaitMiliSictInt();

                var Url = Request.RawUrl;

                FromCustomBotSnapshot VonBotScnapscus = null;

                try
                {
                    if (Request.HasEntityBody)
                    {
                        var RequestBodyStream = Request.InputStream;

                        if (null != RequestBodyStream)
                        {
                            var RequestBodyStreamReader = new StreamReader(RequestBodyStream);

                            var RequestBody = RequestBodyStreamReader.ReadToEnd();

                            VonBotScnapscus = ToCustomBotSnapshot.DeserializeFromString <FromCustomBotSnapshot>(RequestBody);
                        }
                    }
                }
                finally
                {
                    Thread.MemoryBarrier();

                    this.VonBotScnapscusLezte = VonBotScnapscus;

                    if (null != VonBotScnapscus)
                    {
                        this.RequestedMeasurementTimeLezte = Bib3.Glob.Max(RequestedMeasurementTimeLezte, VonBotScnapscus.MeasurementMemoryRequestTime);
                    }
                }

                var NaacBotScnapscus = this.NaacBotScnapscus;

                Thread.MemoryBarrier();

                if (null == NaacBotScnapscus)
                {
                    return "";
                }

                return ToCustomBotSnapshot.SerializeToString(NaacBotScnapscus);
            })));
        }
Example #3
0
 void InputSnapshot(
     ToCustomBotSnapshot Snapshot,
     string SourceUri)
 {
     InputSnapshotLast = new EveOnline.CustomBot.InputSnapshot(Bib3.Glob.StopwatchZaitMiliSictInt(), Snapshot, SourceUri);
 }
Example #4
0
        private void ButtonReadFromFile_Drop(object sender, DragEventArgs e)
        {
            Bib3.FCL.GBS.Extension.CatchNaacMessageBoxException(() =>
            {
                string FilePath = null;
                ToCustomBotSnapshot FileContentAsSnapshot = null;

                try
                {
                    var Time = Bib3.Glob.StopwatchZaitMiliSictInt();

                    var Files = Bib3.FCL.Glob.LaadeMengeDataiInhaltAusDropFileDrop(e);

                    if (null == Files)
                    {
                        throw new ArgumentNullException("Files");
                    }

                    var File = Files.FirstOrDefaultNullable();

                    //	foreach (var File in Files)
                    {
                        FilePath = File.Key;

                        var FileContent = File.Value;

                        try
                        {
                            if (null == FileContent)
                            {
                                throw new ArgumentNullException("FileContent");
                            }

                            var FileContentAsUTF8 = Encoding.UTF8.GetString(FileContent);

                            var FileContentAsObject = ToCustomBotSnapshot.DeserializeFromString <object>(FileContentAsUTF8);

                            FileContentAsSnapshot = FileContentAsObject as ToCustomBotSnapshot;

                            if (null == FileContentAsSnapshot)
                            {
                                var FileContentAsMeasurement = FileContentAsObject as VonSensorikMesung;

                                if (null != FileContentAsMeasurement)
                                {
                                    FileContentAsSnapshot = new ToCustomBotSnapshot(
                                        Time,
                                        new VonProcessMesung <VonSensorikMesung>(FileContentAsMeasurement, Time));
                                }
                            }
                        }
                        catch (System.Exception Exception)
                        {
                            throw new ApplicationException("Error for File \"" + (FilePath ?? "") + "\"", Exception);
                        }
                    }
                }
                finally
                {
                    InputSnapshot(FileContentAsSnapshot, FilePath);
                }
            });
        }