예제 #1
0
        public void Theme01EditAttribute()
        {
            this.MyTestInitialize(TestContext.GetCurrentMethod());
            try
            {
                string originalFilepath = this.GetTestFilePath(this.generateDocumentFilePath);
                string editFilePath     = this.GetTestFilePath(this.editDocumentFilePath);

                System.IO.File.Copy(originalFilepath, editFilePath, true);

                // Adding ThemeId
                using (PresentationDocument doc = PresentationDocument.Open(editFilePath, true))
                {
                    try
                    {
                        doc.PresentationPart.SlideMasterParts.First().ThemePart.Theme.ThemeId =
                            new DocumentFormat.OpenXml.StringValue("TEST");
                    }
                    catch (Exception e)
                    {
                        this.Log.Fail(e.Message);
                    }
                }

                TestEntities testEntities = new TestEntities();
                testEntities.EditAttribute(editFilePath, this.Log);
                testEntities.VerifyAttribute(editFilePath, this.Log);
            }
            catch (Exception e)
            {
                this.Log.Fail(e.Message);
            }
        }
예제 #2
0
        public void Theme01EditAttribute()
        {
            using (var stream = new MemoryStream())
            {
                GeneratedDocument.CreatePackage(stream);

                // Adding ThemeId
                using (PresentationDocument doc = PresentationDocument.Open(stream, true))
                {
                    doc.PresentationPart.SlideMasterParts.First().ThemePart.Theme.ThemeId = new StringValue("TEST");
                }

                TestEntities testEntities = new TestEntities();
                testEntities.EditAttribute(stream, Log);
                testEntities.VerifyAttribute(stream, Log);
            }
        }
예제 #3
0
        public void Theme01EditAttribute()
        {
            string originalFilepath = GetTestFilePath(generateDocumentFilePath);
            string editFilePath     = GetTestFilePath(editDocumentFilePath);

            System.IO.File.Copy(originalFilepath, editFilePath, true);

            // Adding ThemeId
            using (PresentationDocument doc = PresentationDocument.Open(editFilePath, true))
            {
                doc.PresentationPart.SlideMasterParts.First().ThemePart.Theme.ThemeId =
                    new DocumentFormat.OpenXml.StringValue("TEST");
            }

            TestEntities testEntities = new TestEntities();

            testEntities.EditAttribute(editFilePath, Log);
            testEntities.VerifyAttribute(editFilePath, Log);
        }
예제 #4
0
        public void Theme01EditAttribute()
        {
            this.MyTestInitialize(TestContext.GetCurrentMethod());
            try
            {
                string originalFilepath = this.GetTestFilePath(this.generateDocumentFilePath);
                string editFilePath = this.GetTestFilePath(this.editDocumentFilePath);

                System.IO.File.Copy(originalFilepath, editFilePath, true);

                // Adding ThemeId
                using (PresentationDocument doc = PresentationDocument.Open(editFilePath, true))
                {
                    try
                    {
                        doc.PresentationPart.SlideMasterParts.First().ThemePart.Theme.ThemeId =
                            new DocumentFormat.OpenXml.StringValue("TEST");
                    }
                    catch (Exception e)
                    {
                        this.Log.Fail(e.Message);
                    }
                }

                TestEntities testEntities = new TestEntities();
                testEntities.EditAttribute(editFilePath, this.Log);
                testEntities.VerifyAttribute(editFilePath, this.Log);
            }
            catch (Exception e)
            {
                this.Log.Fail(e.Message);
            }
        }