Beispiel #1
0
        public CaseInfo(Case c)
        {
            InitializeComponent();
            m_Case = c;

            LoadCase();
        }
Beispiel #2
0
        private bool NewCase()
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.Filter = "Case Files|*.case";
            saveFileDialog.Title = "New Case Location";

            if (saveFileDialog.ShowDialog() == DialogResult.OK) {
                Case newCase = new Case(saveFileDialog.FileName, Path.GetFileNameWithoutExtension(saveFileDialog.FileName));
                newCase.LogAction(String.Format("Case '{0} created and saved to {1}", newCase.Name, saveFileDialog.FileName), ActionType.CaseCreated);
                newCase.Save();

                LoadCase(saveFileDialog.FileName, true);
                Form form = new CaseInfo(ActiveCase);
                form.ShowDialog();
                return true;
            }
            return false;
        }
Beispiel #3
0
 private void LoadDefaultCase()
 {
     string dir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
     dir = Path.Combine(dir, "KFA Forensics");
     if (!Directory.Exists(dir)) {
         Directory.CreateDirectory(dir);
     }
     String defaultCasePath = Path.Combine(dir, "default.case");
     if (!System.IO.File.Exists(defaultCasePath)) {
         ActiveCase = new Case(defaultCasePath, "Default Case");
         ActiveCase.LogAction(String.Format("Default Case Created @ {0}", defaultCasePath), ActionType.CaseCreated);
     }
     LoadCase(defaultCasePath, false);
 }
Beispiel #4
0
        public static Case Deserialize(string xmlPath)
        {
            Case res = new Case();
            XmlSerializer s = new XmlSerializer(typeof(Case));
            TextReader r = new StreamReader(xmlPath);
            res = (Case)s.Deserialize(r);
            r.Close();
            res.FilePath = xmlPath;
            foreach (Image image in res.Images) {
                image.LoadFileSystem();
            }

            return res;
        }