Пример #1
0
        static void ImgListHandler_AllImgProcessed(object sender, AllImgProcessedEventArgs args)
        {
            var angleDisplay = new StringBuilder();

            foreach (var radianangle in args.ClickInputs.Angles)
            {
                angleDisplay.Append(string.Format("Rotated by: {0} degrees \n", Math.Round(radianangle * 180.0 / Math.PI, 2)));
            }
            MessageBox.Show(angleDisplay.ToString());

            //Serialize object
            var serializer        = new XmlSerializer(typeof(ClickInputs));
            var outputXmlFilePath = ExecutionDirInfoHelper.CreateUniqueOutputPath() + @"\ClickInputs.xml";
            var tw = new StreamWriter(outputXmlFilePath);

            serializer.Serialize(tw, args);
            tw.Close();

            //Test deserialization
            serializer = new XmlSerializer(typeof(ClickInputs));
            var tr           = new StreamReader(outputXmlFilePath);
            var deserialized = (ClickInputs)serializer.Deserialize(tr);

            if (deserialized.Angles.Length != args.ClickInputs.Angles.Length)
            {
                throw new Exception("Not properly deserialized");
            }
            tr.Close();
        }
Пример #2
0
        private void InvokeAllImageProcessed(object sender, AllImgProcessedEventArgs args)
        {
            var handler = AllImagesProcessedEvent;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Пример #3
0
        private void AllImagesProcessedHandler(object sender, AllImgProcessedEventArgs args)
        {
            XmlSerializerHelper.Serialize(args.ClickInputs, GetClickInputsFilePath(_folderPath));

            SetClickInputs(args.ClickInputs);
        }