public Form_Dialog_Edit(DocumentItem ii)
        {
            InitializeComponent();
            if (ii.GetType() == typeof(DocumentData))
            {
            }
            DocumentData d = (DocumentData)ii;

            dat  = (DocumentData)d.Clone();
            bkp  = (DocumentData)d.Clone();
            Text = TB.L.Phrase["Form_Dialog_Edit.Editing"] + " '" + dat.Name + "'";
            dat.BaseData.Save("Temp\\backup" + cc.ToString() + ".pcv");
            d.BaseData.RawData = d.BaseData.RawData.ToList().OrderByDescending(p => p.Length).ToArray();
            RefillTree();
            gr2 = dat.BaseData.GrPath;
            label_ndresol.Text = TB.L.Phrase["Form_Dialog_Edit.Resolution"] + ": " + dat.BaseData.Resolution;
            label_2ndname.Text = TB.L.Phrase["Form_Dialog_Edit.NameCurrent"] + ": " + new FileInfo(dat.BaseData.Filename).Directory.Name + "\\" + new FileInfo(dat.BaseData.Filename).Name;
        }
Ejemplo n.º 2
0
        public void TestThatCloneClonesDocumentData()
        {
            var fieldMock    = MockRepository.GenerateMock <IField>();
            var documentMock = MockRepository.GenerateMock <IDocument>();

            var documentData = new DocumentData(fieldMock, documentMock);

            Assert.That(documentData, Is.Not.Null);

            var clonedDocumentData = (IDocumentData)documentData.Clone();

            Assert.That(clonedDocumentData, Is.Not.Null);
            Assert.That(clonedDocumentData.Field, Is.Not.Null);
            Assert.That(clonedDocumentData.Field, Is.EqualTo(documentData.Field));
            Assert.That(clonedDocumentData.Document, Is.Not.Null);
            Assert.That(clonedDocumentData.Document, Is.EqualTo(documentData.Document));
            Assert.That(clonedDocumentData.Reference, Is.EqualTo(documentData.Reference));

            documentData.UpdateSourceValue <object>(null);

            var sourceDocument = documentData.GetSourceValue <IDocument>();

            Assert.That(sourceDocument, Is.Null);
        }