예제 #1
0
		public CompletionData(ICodeSnippet codeSnippet, DocumentPage documentPage)
		{
			_documentPage = documentPage;
			Snippet = codeSnippet;
			Text = codeSnippet.Name;
			Application.Current.Dispatcher.Invoke(BuildCodeSnippetDecription);
		}
 public DocumentPageModel(DocumentPage page)
 {
     this.IsNew = false;
     this.FileName = page.ImageFilename;
     this.FilePath = page.ImageFilePath;
     this.PageNumber = page.Id;
     this.DocumentId = page.Id;
 }
 // Token: 0x06007158 RID: 29016 RVA: 0x00207048 File Offset: 0x00205248
 public void AddPage(DocumentPage page)
 {
     if (!this._table.Contains(page))
     {
         this._table.Add(page, false);
         page.PageDestroyed += this.OnPageDestroyed;
         return;
     }
     this._table[page] = false;
 }
예제 #4
0
        public override DocumentPage GetPage(int pageNumber)
        {
            DocumentPage    originalPage = originalPaginator.GetPage(pageNumber);
            ContainerVisual fixedPage    = new ContainerVisual();

            fixedPage.Children.Add(originalPage.Visual);
            fixedPage.Transform = new TranslateTransform(pageMargin.Width, pageMargin.Height);
            return(new DocumentPage(fixedPage, pageSize, AdjustForMargins(originalPage.BleedBox),
                                    AdjustForMargins(originalPage.ContentBox)));
        }
예제 #5
0
 private void GetHeaderFooter(DocumentPage page, DrawingVisual backGround)
 {
     System.Windows.Media.Pen pen = new System.Windows.Media.Pen(_borderBrush, _thickness);
     using (DrawingContext backgroundContext = backGround.RenderOpen())
     {
         //header & footer dept.
         GetRectangles(page, backgroundContext, pen);
         backgroundContext.DrawRectangle(null, pen, page.ContentBox);
     }
 }
        // Token: 0x0600715B RID: 29019 RVA: 0x002070EC File Offset: 0x002052EC
        private void OnPageDestroyed(object sender, EventArgs e)
        {
            DocumentPage documentPage = sender as DocumentPage;

            Invariant.Assert(documentPage != null, "Invalid type in PageDestroyedWatcher");
            if (this._table.Contains(documentPage))
            {
                this._table[documentPage] = true;
            }
        }
예제 #7
0
        internal static DocumentPage GetPage(DocumentPaginator paginator, int index)
        {
            EmitEvent(EventTrace.Event.WClientDRXGetPageBegin);

            DocumentPage page = paginator.GetPage(index);

            EmitEvent(EventTrace.Event.WClientDRXGetPageEnd);

            return(page);
        }
예제 #8
0
 /// <summary>
 /// Write a single DocumentPaginator and close package
 /// </summary>
 public override void Write(DocumentPaginator documentPaginator, PrintTicket printTicket)
 {
     //SerializeVisualTree(documentPaginator.Source as DependencyObject);
     for (int i = 0; i < documentPaginator.PageCount; i++)
     {
         DocumentPage page = documentPaginator.GetPage(i);
         SerializeVisualTree(page.Visual);
     }
     _writer.Close();
 }
예제 #9
0
        static public BitmapSource BitmapSourceFromPage(DocumentPage docPage, double resolution)
        {
            double             pixelWidth   = docPage.Size.Width * resolution / 96;
            double             pixelHeight  = docPage.Size.Height * resolution / 96;
            RenderTargetBitmap renderTarget = new RenderTargetBitmap((int)pixelWidth, (int)pixelHeight, resolution, resolution, PixelFormats.Default);

            renderTarget.Render(docPage.Visual);

            return(renderTarget);
        }
        /// <summary>Returns a <see cref="T:System.Windows.Documents.DocumentPage" /> together with associated user-annotations for a specified page number.</summary>
        /// <param name="pageNumber">The zero-based page number of the <see cref="T:System.Windows.Documents.DocumentPage" /> to return.</param>
        /// <returns>The <see cref="T:System.Windows.Documents.DocumentPage" /> for the specified <paramref name="pageNumber" />; or <see cref="F:System.Windows.Documents.DocumentPage.Missing" />, if the specified <paramref name="pageNumber" /> does not exist.</returns>
        // Token: 0x06006292 RID: 25234 RVA: 0x001BA79C File Offset: 0x001B899C
        public override DocumentPage GetPage(int pageNumber)
        {
            DocumentPage documentPage = this._originalPaginator.GetPage(pageNumber);

            if (documentPage != DocumentPage.Missing)
            {
                documentPage = this.ComposePageWithAnnotationVisuals(pageNumber, documentPage);
            }
            return(documentPage);
        }
예제 #11
0
        public Application()
        {
            driver = new EventFiringWebDriver(new FirefoxDriver());
            this.GoogleDriveCommonPage = new GoogleDriveCommonPage(driver);
            this.GoogleSignInPage      = new GoogleSignInPage(driver);
            this.MyDrivePage           = new MyDrivePage(driver);
            this.DocumentPage          = new DocumentPage(driver);

            InitializeEvents();
        }
예제 #12
0
        /// <summary>
        /// This is the most important method , modifies the original
        /// </summary>
        public override DocumentPage GetPage(int pageNumber)
        {
            var newpage = new ContainerVisual();

            if (pageNumber == 0 && reportDef.FirstPageHeader != null)
            {
                var v = GetVisualFromTemplate(reportDef.FirstPageHeader);
                v.Offset = new Vector(0, 0);
                newpage.Children.Add(v);
            }
            else if (pageNumber == 0 && reportDef.FirstPageHeader == null && reportDef.PageHeader != null)
            {
                var v = GetVisualFromTemplate(reportDef.PageHeader);
                v.Offset = new Vector(0, 0);
                newpage.Children.Add(v);
            }
            if (pageNumber > 0 && reportDef.PageHeader != null)
            {
                var v = GetVisualFromTemplate(reportDef.PageHeader);
                v.Offset = new Vector(0, 0);
                newpage.Children.Add(v);
            }

            var smallerPage = new ContainerVisual();
            var page        = paginator.GetPage(pageNumber);

            smallerPage.Children.Add(page.Visual);

            if (pageNumber == 0 && reportDef.FirstPageHeader != null)
            {
                smallerPage.Offset = new Vector(0, reportDef.FirstHeaderHeight);
            }
            else
            {
                smallerPage.Offset = new Vector(0, reportDef.HeaderHeight);
            }
            newpage.Children.Add(smallerPage);

            if (pageNumber == pageCount - 1 && reportDef.LastPageFooter != null)
            {
                var v = GetVisualFromTemplate(reportDef.LastPageFooter);
                v.Offset = new Vector(0, reportDef.HeaderHeight + paginator.PageSize.Height - reportDef.LastFooterHeight - reportDef.PagePadding.Top);
                newpage.Children.Add(v);
            }
            else if (reportDef.PageFooter != null)
            {
                var v = GetVisualFromTemplate(reportDef.PageFooter);
                v.Offset = new Vector(0, reportDef.HeaderHeight + paginator.PageSize.Height - reportDef.FooterHeight - reportDef.PagePadding.Top);
                newpage.Children.Add(v);
            }

            var dp = new DocumentPage(newpage, new Size(pageSize.Width, pageSize.Height), page.BleedBox, page.ContentBox);

            return(dp);
        }
        public void ConvertDocumentIntoPDF()
        {
            #region Private Variables
            var caseId             = string.Empty;
            var caseTitle          = "Case to Convert the document into PDF";
            var registryEntryTitle = "Registry Entry";
            #endregion

            Selenium_Run((driver) =>
            {
                FrontPage.LoginToApplication(driver);

                #region Create case with access code
                CasePage casePage = CasePage.Connect(driver);
                casePage.AddTitle(caseTitle);
                casePage.SaveCase();
                CommonMethods.PlayWait(5000);
                caseId = casePage.GetCaseNumber();
                #endregion

                #region Add U-type Registry Entry
                RegistryEntryPage regEntry = RegistryEntryPage.Connect(driver);
                regEntry.CreateRegistryEntry(RegistryEntryType.OutgoingType.GetStringValue());
                regEntry.AddRegTitle(registryEntryTitle);
                regEntry.AddRegToAddress("AA");
                DocumentPage documentPage = DocumentPage.Connect(driver);
                documentPage.ClickAndAddDocTemplate(AttachmentType.Message.GetStringValue());
                documentPage.AddMessageForDocument("Convert the message into PDF");
                regEntry.ClickSaveBttn();
                #endregion

                #region Change registry entry status to F/done
                regEntry.ClickEditButton();
                regEntry.ChangeREStatusToFerdigOrDone();
                regEntry.ClickSaveBttn();
                #endregion

                #region Convert document to PDF from Attachment/Message
                documentPage.ViewAttachmentInformation("Registry Entry", "Convert to PDF", 1);
                CommonMethods.PlayWait(3000);
                CommonMethods.RefreshBrowserWindow(driver);
                CommonMethods.RefreshBrowserWindow(driver);
                CommonMethods.PlayWait(15000);
                #endregion

                #region Verify the Document is Converted to PDF
                documentPage.VerifyDocumentOrMessageIsConvertedToPDF();
                #endregion

                #region Logout from RM Module
                LogoutPage logoutPage = LogoutPage.Connect(driver);
                logoutPage.LogoutApplication();
                #endregion
            });
        }
예제 #14
0
        private void AddThumbnail(object sender, RoutedEventArgs e)
        {
            FixedDocumentSequence docSeq    = _xpsDocument.GetFixedDocumentSequence();
            DocumentPaginator     paginator = docSeq.DocumentPaginator;
            DocumentPage          page      = paginator.GetPage(0);
            // Create a rendertarget for the glyphs element. Round up width and height
            RenderTargetBitmap rt = new RenderTargetBitmap((int)page.Size.Width,
                                                           (int)page.Size.Height,
                                                           96, 96,
                                                           PixelFormats.Default);

            FixedPage fixedPage = (FixedPage)page.Visual;

            fixedPage.Measure(new Size(page.Size.Width, page.Size.Height));
            fixedPage.Arrange(new Rect(new Size(page.Size.Width, page.Size.Height)));
            rt.Render(fixedPage);
            JpegBitmapEncoder jpegEncoder = new JpegBitmapEncoder();

            jpegEncoder.Frames.Add(BitmapFrame.Create((BitmapSource)rt));
            Stream stream = new MemoryStream();

            jpegEncoder.Save(stream);
            XpsThumbnail thumbnail = _xpsDocument.AddThumbnail(XpsImageType.JpegImageType);
            Stream       dstStream = thumbnail.GetStream();

            byte[] thumbnailData = new byte[stream.Length];
            // let's read the whole block into our buffer
            int totalBytesRead = 0;
            int requestedCount = (int)stream.Length;

            stream.Position = 0;
            while (totalBytesRead < requestedCount)
            {
                int bytesRead = stream.Read(thumbnailData,
                                            totalBytesRead,
                                            requestedCount - totalBytesRead);
                if (bytesRead == 0)
                {
                    break;
                }
                totalBytesRead += bytesRead;
            }
            dstStream.Write(thumbnailData, 0, (int)stream.Length);
            dstStream.Close();
            thumbnail.Commit();
            _xpsDocument.Close();
            stream.Position = 0;
            ImageBrush imageBrush = new ImageBrush(BitmapFrame.Create(stream));

            imageBrush.Stretch    = Stretch.Uniform;
            thumbnailDisplay.Fill = imageBrush;

            // Once a thumbnail is set disable the "Add Thumbnail" button.
            addThumbnailButton.IsEnabled = false;
        }
예제 #15
0
        public List <PageInfo> Convert(String inputFile, ImageConversionOptions options)
        {
            if (options.BinarisationAlgorithm == BinarisationAlgorithm.Default)
            {
                options.BinarisationAlgorithm = BinarisationAlgorithm.OtsuThreshold;
            }

            // Create and start a new task
            var task = Task <List <PageInfo> > .Factory.StartNew(() =>
            {
                var pages = new List <PageInfo>();

                using (XpsDocument xpsDoc = new XpsDocument(inputFile, FileAccess.Read))
                {
                    FixedDocumentSequence docSeq = xpsDoc.GetFixedDocumentSequence();

                    for (int i = 0; i < docSeq.DocumentPaginator.PageCount; ++i)
                    {
                        using (DocumentPage docPage = docSeq.DocumentPaginator.GetPage(i))
                        {
                            int width  = (int)(((float)options.Resolution / 96f) * docPage.Size.Width);
                            int height = (int)(((float)options.Resolution / 96f) * docPage.Size.Height);

                            RenderTargetBitmap renderTarget = new RenderTargetBitmap(width, height, options.Resolution, options.Resolution, PixelFormats.Default);
                            renderTarget.Render(docPage.Visual);

                            using (MemoryStream ms = new MemoryStream())
                            {
                                BitmapEncoder encoder = new TiffBitmapEncoder();
                                encoder.Frames.Add(BitmapFrame.Create(renderTarget));
                                encoder.Save(ms);

                                ms.Seek(0, SeekOrigin.Begin);

                                pages.AddRange(ImageProcessingEngine.Instance.Convert(ms, options));
                            }
                        }
                    }

                    xpsDoc.Close();
                }

                return(pages);
            },
                                                                 CancellationToken.None,
                                                                 TaskCreationOptions.None,
                                                                 scheduler);

            // Wait for the task to complete
            task.Wait();

            // Return the list of pages
            return(task.Result);
        }
예제 #16
0
            // Token: 0x06008D6F RID: 36207 RVA: 0x002595B8 File Offset: 0x002577B8
            internal override bool Process()
            {
                if (!this.Paginator._brt.HasPageBreakRecord(this.PageNumber))
                {
                    return(false);
                }
                DocumentPage page = this.Paginator.FormatPage(this.PageNumber);

                this.Paginator.OnGetPageCompleted(new GetPageCompletedEventArgs(page, this.PageNumber, null, false, this.UserState));
                return(true);
            }
    public override DocumentPage GetPage(int pageNumber)
    {
        DocumentPage cachedPage;

        if (_PageCache.TryGetValue(pageNumber, out cachedPage) && cachedPage.Visual != null)
        {
            return(cachedPage);
        }
        DocumentPage page = _Paginator.GetPage(pageNumber);
        // Create a wrapper visual for transformation and add extras
        ContainerVisual newpage = new ContainerVisual();
예제 #18
0
        public void a14_Learner_General_Course_Overview_56396()
        {
            CommonSection.Logout();
            LoginPage.LoginAs("").WithPassword("").Login();
            CommonSection.CreateGeneralCourse(GeneralCourseTitle + "_TC56396");
            _test.Log(Status.Info, "A new Genaral Course Created");
            ContentDetailsPage.Accordians.ClickEdit_Prerequisites();
            PrerequisitesPage.ClickAddPrerequisites();
            _test.Log(Status.Info, "Click on ADD Prerequisities Button");
            Assert.IsTrue(AddPrerequisitesPage.IsSearchfieldsDisplayed());
            _test.Log(Status.Info, "Verify Search for, Search Type, Type, User Search, Add button, Back button display");
            AddPrerequisitesPage.SearchFor("");
            _test.Log(Status.Info, "Click Search Button, Select One record and click add button");

            Assert.IsTrue(PrerequisitesPage.isPrerequisitesadded());
            _test.Log(Status.Pass, "Verify Prerequisites are added to Curriculumn");
            AddPrerequisitesPage.ClickBackButton();
            DocumentPage.ClickButton_CheckIn();
            #region cretate TA
            CommonSection.Manage.Training();
            _test.Log(Status.Info, "Navigate to Manage >> Training Page");
            TrainingPage.TrainingAssignments.Click_CreateTrainingAssignment();
            _test.Log(Status.Info, "Click Create Training Assignment link from training assignment portlet");
            CreateTrainingAssignmentPage.Create(TATitle + "_TC56396");
            _test.Log(Status.Info, "A new training assignement created as draft");
            CreateTrainingAssignmentPage.ContentTab.ClickAddContent();
            _test.Log(Status.Info, "Click Add Content");
            CreateTrainingAssignmentPage.ContentTab.AddContentModal.AddContent(GeneralCourseTitle + "_TC56396");
            _test.Log(Status.Info, "Content added to training assignment");
            CreateTrainingAssignmentPage.AssignessTab.ClickAddAssignees();
            _test.Log(Status.Info, "Click Add Assignees button in Assignees tab");
            CreateTrainingAssignmentPage.AssignessTab.AddAssignessModal.AddAssigne("learner 101");
            _test.Log(Status.Info, "A user added to training assignment");
            CreateTrainingAssignmentPage.DueDateTab.ClickChage();
            _test.Log(Status.Info, "Click Chage button in Due Date tab");
            string previousCompletions = CreateTrainingAssignmentPage.DueDateTab.AssignmentDueDateModal.SetPreviousCompletionsYesandRecurringNo("days");
            _test.Log(Status.Info, "Set Previous Completions count and save for Non recurring assignement");
            CreateTrainingAssignmentPage.ClickDueDateTab();
            _test.Log(Status.Info, "Click Chage button in Due Date tab");
            Assert.IsTrue(CreateTrainingAssignmentPage.DueDateTab.VerifyPreviousComplistion(previousCompletions));
            _test.Log(Status.Pass, "Verify Copletion count saved properly");
            CreateTrainingAssignmentPage.clickAssignButton();
            #endregion

            CommonSection.Logout();
            LoginPage.LoginAs("srlearner101").WithPassword("").Login();

            CommonSection.SearchCatalog(GeneralCourseTitle + "_TC56396");
            SearchResultsPage.ClickCourseTitle(GeneralCourseTitle + "_TC56396");
            Assert.IsTrue(ContentDetailsPage.OverviewTab.isTrainingAssignmentportletDisplay());
            Assert.IsTrue(ContentDetailsPage.OverviewTab.TrainingAssignment.isDuedatedisplay());
            Assert.IsTrue(ContentDetailsPage.OverviewTab.isPrerequisitePortletDisplay());
            TC56397_2 = true;
        }
예제 #19
0
파일: PageCache.cs 프로젝트: ash2005/z
 /// <summary>
 /// Indicates whether the specified DocumentPage has been destroyed.
 /// </summary>
 /// <param name="page"></param>
 /// <returns></returns>
 public bool IsDestroyed(DocumentPage page)
 {
     if (_table.Contains(page))
     {
         return((bool)_table[page]);
     }
     else
     {
         return(true);
     }
 }
        private DrawingVisual GetBackColorVisual(DocumentPage page, Brush backgroundBrush)
        {
            var background = new DrawingVisual();


            using (DrawingContext ctx = background.RenderOpen())
            {
                ctx.DrawRectangle(backgroundBrush, null,
                                  new Rect(0, 0, page.Size.Width, page.Size.Height + 200));
            }
            return(background);
        }
예제 #21
0
        private void _documentPanelViewModel_SelectedPageChanged(object sender, DocumentPage e)
        {
            if (e == null)
            {
                FilePath = _defaultText;
                return;
            }

            var logGridPage = e as LogViewerGrid;

            FilePath = logGridPage.Path;
        }
예제 #22
0
 public void A01_Delete_Document_from_Creating_Domain_7435()
 {
     //Assert.Fail();
     CommonSection.CreateLink.Document();
     DocumentPage.Populate_DocumentData(documenttitle + "TC7435", "");
     DocumentPage.ClickButton_Create();
     _test.Log(Status.Info, "Dcoument Created");
     ContentDetailsPage.DeleteContent();
     _test.Log(Status.Info, "Deleting Document");
     Assert.IsTrue(Driver.Instance.IsElementVisible(By.XPath("//div[@class='alert alert-success']")));
     _test.Log(Status.Pass, "Assertion Pass as Document has been deleted from creating domain");
 }
예제 #23
0
        PersistObjectData(
            SerializableObjectContext serializableObjectContext
            )
        {
            DocumentPage    dp         = (DocumentPage)serializableObjectContext.TargetObject;
            ReachTreeWalker treeWalker = BeginSerializeDocumentPage(serializableObjectContext);


            SerializeChild(dp.Visual, serializableObjectContext);

            EndSerializeDocumentPage(treeWalker);
        }
예제 #24
0
파일: PageCache.cs 프로젝트: ash2005/z
 /// <summary>
 /// Adds a new DocumentPage to the Watcher
 /// </summary>
 /// <param name="page">The page to add</param>
 public void AddPage(DocumentPage page)
 {
     if (!_table.Contains(page))
     {
         _table.Add(page, false);
         page.PageDestroyed += new EventHandler(OnPageDestroyed);
     }
     else
     {
         _table[page] = false;
     }
 }
예제 #25
0
        public override DocumentPage GetPage(int pageNumber)
        {
            DrawingVisual pageVisual   = GetPageVisual(pageNumber);
            var           documentPage = new DocumentPage(pageVisual, PageSize, FrameRect, FrameRect);

            if (ShowPageMarkers)
            {
                InsertPageMarkers(pageNumber + 1, documentPage);
            }
            OnPageCreated(new PageEventArgs(pageNumber));
            return(documentPage);
        }
예제 #26
0
 public XPSDocumentPageWrapper(DocumentPage documentPage)
 {
     if (documentPage != null)
     {
         //Serialize the DocumentPage
         XpsSerializerFactory factory = new XpsSerializerFactory();
         MemoryStream         ms      = new MemoryStream();
         SerializerWriter     writer  = factory.CreateSerializerWriter(ms);
         writer.Write(documentPage.Visual);
         m_XPSDocumentPageObject = ms.ToArray();
     }
 }
예제 #27
0
        // --------------------- RefreshThumbnailDisplay ----------------------
        void RefreshThumbnailDisplay()
        {
            //FDPV.Focus();
            bool createMode =
                (ThumbList.Items.CurrentItem is Border) ?  false : true;

            for (int i = 0; i < _numDisplayedThumbnails; i++)
            {
                DocumentPage docPage =
                    FDPV.Document.DocumentPaginator.GetPage(_currentThumbnail + i);

                StackPanel pageThumb =
                    CreatePageThumb(
                        docPage.Visual, docPage.Size, _currentThumbnail + i + 1);

                if (!createMode)
                {
                    Object currentItem = ThumbList.Items.CurrentItem;
                    if (!(currentItem is Border))
                    {
                        continue;
                    }
                    PrepareBorderForDisplay((Border)currentItem);
                    ((Border)currentItem).Child = pageThumb;
                }
                else
                {
                    Border border = CreateThumbBorder(_currentThumbnail + i + 1);
                    ThumbList.Items.Add(border);
                    ThumbList.Items.MoveCurrentToNext();
                    if (!(ThumbList.Items.CurrentItem is Border))
                    {
                        continue;
                    }
                    PrepareBorderForDisplay(border);
                    border.Child = pageThumb;
                    continue;
                }

                // If ThumbList doesn't have enough items,
                // the FixedDocument pages may have increased.
                if (!ThumbList.Items.MoveCurrentToNext())
                {
                    createMode = true;
                }
            }

            for (int i = _numDisplayedThumbnails; i > 0; i--)
            {
                ThumbList.Items.MoveCurrentToPrevious();
            }
        }// end:RefreshThumbnailDisplay()
예제 #28
0
        public void P20_1_a23_Take_Curriculum_Related_Surveys_26347()
        {
            CommonSection.CreateLink.GeneralCourse();
            _test.Log(Status.Info, "Creating a Paid General Course");
            GeneralCoursePage.CreateGeneralCourse(generalcoursetitle + "_TC26347", "Test General Course");
            DocumentPage.ClickButton_CheckIn();
            _test.Log(Status.Info, "Paid general course created");
            CommonSection.CreteNewCurriculumn(curriculamtitle + "TC326347");
            _test.Log(Status.Info, "Create A new Curriculum");

            Assert.IsTrue(ContentDetailsPage.isSurveyAccordiandisplayed());
            _test.Log(Status.Info, "Verify Survey accordian display on RHS side");
            ContentDetailsPage.Accordians.ClickManage_Survey();
            _test.Log(Status.Info, "Click Survey Manage button");

            SurveysPage.ClickAssignSurveysnew();
            _test.Log(Status.Info, "Click on Assign Surveys Button");
            Assert.IsTrue(SurveysPage.AddSurveyModal.IsSearchfieldsDisplayed());
            _test.Log(Status.Pass, "Verify Search, Result grid, Add button on Add survey Modal");
            SurveysPage.AddSurveyModal.AddSurveystoContent("Before Course Start");
            _test.Log(Status.Info, "Search Survey and add one survey to content");
            SurveysPage.Click_backbutton();

            ContentDetailsPage.ClickCurriculumContentEditButton();
            CurriculumContentPage.ClickAddCurriculumBlock();
            CurriculumContentPage.AddCurriculumBlock.AddBlockAs("_UnOrdered" + "_TC26349");
            CurriculumContentPage.AddTrainingActivities_UnOrdered(generalcoursetitle + "_TC26347");
            DocumentPage.ClickButton_CheckIn();

            CommonSection.SearchCatalog(curriculamtitle + "TC326347");
            SearchResultsPage.ClickCourseTitle(curriculamtitle + "TC326347");
            //Assert.IsTrue(ContentDetailsPage.SurveyPortlet.IsSurveysDisplayForCurriculumn(Surveytitle_OnEnroll, Surveytitle_OnContentComplete));
            //Assert.IsTrue(ContentDetailsPage.SurveyPortlet.IsSurveysareNotavailable);
            ContentDetailsPage.ClickCurriculumnEnroll();
            // Assert.IsTrue(ContentDetailsPage.SurveyPortlet.IsSurveysAvailableforCurriculumn(Surveytitle_OnEnroll));
            ContentDetailsPage.Click_ContentTab();
            Assert.IsTrue(ContentDetailsPage.MarkComplete_Curriculum_whenSurveyRequired());
            ContentDetailsPage.Click_OverviewTab();
            //Assert.IsTrue(ContentDetailsPage.SurveyPortlet.IsSurveysAvailableforCurriculumn(Surveytitle_OnContentComplete));

            ContentDetailsPage.SurveyPortlet.ClickonattachedSurvey("Before Course Start");
            _test.Log(Status.Info, "Click Attached Survey");
            ContentDetailsPage.SurveyPortlet.CompleteSurvey();
            _test.Log(Status.Info, "Complete Survey");
            ContentDetailsPage.Click_MarkComplete();
            _test.Log(Status.Pass, "Click at Take Survey button");
            // ContentDetailsPage.SurveyPortlet.CompleteSurvey(); // Why we need it to do?

            Assert.IsTrue(ContentDetailsPage.ClickViewCertificate_Curriculum());
            //Assert.IsTrue(ContentDetailsPage.IsViewCertificateButtondisplay());
            _test.Log(Status.Pass, "Verify View Certificate Button is displayed");
        }
예제 #29
0
        public override DocumentPage GetPage(int pageNumber)
        {
            DrawingVisual pageVisual   = this.GetPageVisual(pageNumber);
            var           documentPage = new DocumentPage(pageVisual, this.PageSize, this.FrameRect, this.FrameRect);

            if (this.ShowPageMarkers)
            {
                this.InsertPageMarkers(pageNumber + 1, documentPage);
            }

            this.OnPageCreated(new PageEventArgs(pageNumber));
            return(documentPage);
        }
예제 #30
0
    public PrintPaginatorWrapper(DocumentPaginator paginator, Margins margin, double borderThickness, System.Windows.Media.Brush borderBrush, double headerSize, double footerSize) : this()
    {
        //One way to provide a few options. Set them all here.
        _headerSize  = headerSize;
        _footerSize  = footerSize;
        _thickness   = borderThickness;
        _borderBrush = borderBrush;
        PPageSize    = paginator.PageSize;
        _margin      = margin;
        _paginator   = paginator;
        DocumentPage t = _paginator.GetPage(1);

        _paginator.PageSize = new System.Windows.Size(PPageSize.Width - (margin.Left + margin.Right), PPageSize.Height - (margin.Top + margin.Bottom));
    }
예제 #31
0
        public override DocumentPage GetPage(int pageNumber)
        {
            _pageNumber = pageNumber + 1;
            DocumentPage    page          = _paginator.GetPage(pageNumber);
            ContainerVisual printedPage   = new ContainerVisual();
            ContainerVisual pageContainer = new ContainerVisual();

            pageContainer.Children.Add(page.Visual);
            pageContainer.Transform = new TranslateTransform(_margin.Left, _margin.Top);
            printedPage.Children.Add(pageContainer);
            AddHeader(printedPage);
            AddFooter(printedPage);
            return(new DocumentPage(printedPage, _pageSize, _pageBox, _contentBox));
        }
예제 #32
0
        // Token: 0x0600650E RID: 25870 RVA: 0x001C5C3C File Offset: 0x001C3E3C
        private static void DumpFlowDocumentPage(XmlTextWriter writer, DocumentPage page)
        {
            FlowDocumentPage flowDocumentPage = page as FlowDocumentPage;

            writer.WriteStartElement("FormattedLines");
            writer.WriteAttributeString("Count", flowDocumentPage.FormattedLinesCount.ToString(CultureInfo.InvariantCulture));
            writer.WriteEndElement();
            TextDocumentView textDocumentView = (TextDocumentView)((IServiceProvider)flowDocumentPage).GetService(typeof(ITextView));

            if (textDocumentView.IsValid)
            {
                LayoutDump.DumpColumnResults(writer, textDocumentView.Columns, page.Visual);
            }
        }
예제 #33
0
		private static DataGridResultViewer InitializeResultViewer()
		{
			var columnHeaders =
				new[]
				{
					new ColumnHeader { ColumnIndex = 0, DatabaseDataType = "Varchar2", DataType = typeof (string), Name = "DUMMY1" },
					new ColumnHeader { ColumnIndex = 1, DatabaseDataType = "Date", DataType = typeof (DateTime), Name = "DUMMY_WITH_UNDERSCORES" },
					//new ColumnHeader { ColumnIndex = 2, DatabaseDataType = "Varchar2", DataType = typeof (string), Name = "\"'\\\"><?,.;:{}[]%$#@!~^&*()_+-§'''||(1/2*3+4-CASEWHEN1<=2OR2>=1THEN5ELSE6END)" }
				};

			var documentPage = new DocumentPage { CurrentConnection = ConfigurationProvider.ConnectionStrings[0] };
			documentPage.DatabaseModel.Dispose();
			
			var outputViewer = new OutputViewer(documentPage);

			var dataRows =
				new[]
				{
					new object[] {"Value \"1\" '2' <3>", new DateTime(2014, 8, 16, 22, 25, 34)},
					new object[] {"\"2.\"Value", new DateTime(2014, 8, 16)},
					//new object[] {"\"><?,.;:{}[]%$#@!~^&*()_+-§' ,5", new DateTime(2015, 5, 30) }
				};

			var resultInfo = new ResultInfo(null, "Test result", ResultIdentifierType.UserDefined);

			var executionResult =
				new StatementExecutionResult
				{
					StatementModel =
						new StatementExecutionModel
						{
							StatementText = "SELECT * FROM DUAL"
						},
					ResultInfoColumnHeaders =
						new Dictionary<ResultInfo, IReadOnlyList<ColumnHeader>>
						{
							{ resultInfo, columnHeaders }
						}
				};

			var resultViewer =
				new DataGridResultViewer(outputViewer, executionResult, resultInfo)
				{
					ResultGrid = { ItemsSource = dataRows }
				};

			DataGridHelper.InitializeDataGridColumns(resultViewer.ResultGrid, columnHeaders, outputViewer.StatementValidator, outputViewer.ConnectionAdapter);

			return resultViewer;
		}
 private void SaveDocumentPage(SubmittedDocument submittedDocument)
 {
     foreach (DocumentPageModel model in List)
     {
         if (model.IsNew)
         {
             DocumentPage documentPage = new DocumentPage();
             documentPage.SubmittedDocument = submittedDocument;
             documentPage.ImageFilename = model.FileName;
             documentPage.ImageFilePath = model.FilePath;
             Context.DocumentPages.AddObject(documentPage);
         }
     }
 }