Example #1
0
        static void Main(string[] args)
        {
            XMlControler dd = new XMlControler();

            dd.DecodeBase64(@"c:\Temp\XBIN_fundus.xml", @"c:\Temp\out\");
            Console.WriteLine("Finish");
        }
        //Handle filedrop to GUI
        private void Window_Drop(object sender, System.Windows.DragEventArgs e)
        {
            XMlControler xmlcon = new XMlControler();
            EDIControler Edicon = new EDIControler();

            LWFilepatchtoFinich.Items.Clear();
            System.Windows.DataObject dataObject = e.Data as System.Windows.DataObject;
            LbResultat.Visibility = System.Windows.Visibility.Hidden;
            List <string> imageFiles = new List <string>();

            try
            {
                if (dataObject.ContainsFileDropList())
                {
                    System.Collections.Specialized.StringCollection fileNames =
                        dataObject.GetFileDropList();
                    foreach (string fileName in fileNames)
                    {
                        string extension = System.IO.Path.GetExtension(fileName).ToString().ToLower();
                        switch (extension)
                        {
                        case ".xml":

                            imageFiles.Add(fileName);
                            xmlcon.DecodeBase64(fileName, folman.GetUserFilePatch());
                            LWFilepatchtoFinich.Items.Add(fileName.ToString());
                            break;

                        case ".fnx":
                            imageFiles.Add(fileName);
                            xmlcon.DecodeBase64(fileName, folman.GetUserFilePatch());
                            LWFilepatchtoFinich.Items.Add(fileName.ToString());
                            break;

                        case ".edi":
                            imageFiles.Add(fileName);
                            Edicon.ExtractEDIFIle(fileName, folman.GetUserFilePatch());
                            LWFilepatchtoFinich.Items.Add(fileName.ToString());
                            break;

                        default:
                            LWFilepatchtoFinich.Items.Add("forkert fil format");
                            break;
                        }
                    }
                }
                LbResultat.Visibility = System.Windows.Visibility.Visible;
                LbResultat.Content    = "Færdig";
                LbResultat.Foreground = new SolidColorBrush(Colors.Green);
            }
            catch
            {
                LbResultat.Visibility = System.Windows.Visibility.Visible;
                LbResultat.Content    = "Ingen output";
                LbResultat.Foreground = new SolidColorBrush(Colors.Red);
            }
        }