コード例 #1
0
ファイル: RetrieveMarker.cs プロジェクト: nholik/Fo.Net
        public override Status Layout(Area area)
        {
            if (marker == MarkerStart)
            {
                marker = 0;
                Page containingPage = area.getPage();
                bestMarker = SearchPage(containingPage);

                if (bestMarker != null)
                {
                    bestMarker.resetMarkerContent();
                    return bestMarker.LayoutMarker(area);
                }

                AreaTree areaTree = containingPage.getAreaTree();
                if (retrieveBoundary == RetrieveBoundary.PAGE_SEQUENCE)
                {
                    PageSequence pageSequence = areaTree.GetCurrentPageSequence();
                    if (pageSequence == containingPage.getPageSequence())
                    {
                        return LayoutBestMarker(areaTree.GetCurrentPageSequenceMarkers(), area);
                    }

                }
                else if (retrieveBoundary == RetrieveBoundary.DOCUMENT)
                {
                    return LayoutBestMarker(areaTree.GetDocumentMarkers(), area);

                }
                else if (retrieveBoundary != RetrieveBoundary.PAGE)
                {
                    throw new FonetException("Illegal 'retrieve-boundary' value");
                }

            }
            else if (bestMarker != null)
            {
                return bestMarker.LayoutMarker(area);
            }

            return new Status(Status.OK);

        }
コード例 #2
0
ファイル: Page.cs プロジェクト: nholik/Fo.Net
 public void registerMarker(Marker marker)
 {
     markers.Add(marker);
 }
コード例 #3
0
ファイル: Page.cs プロジェクト: nholik/Fo.Net
 public void unregisterMarker(Marker marker)
 {
     markers.Remove(marker);
 }
コード例 #4
0
ファイル: Area.cs プロジェクト: nholik/Fo.Net
 public void addMarker(Marker marker)
 {
     markers.Add(marker);
 }
コード例 #5
0
ファイル: RetrieveMarker.cs プロジェクト: nholik/Fo.Net
 private Status LayoutBestMarker(ArrayList markers, Area area)
 {
     if (markers != null)
     {
         for (int i = markers.Count - 1; i >= 0; i--)
         {
             Marker currentMarker = (Marker)markers[i];
             if (currentMarker.GetMarkerClassName().Equals(retrieveClassName))
             {
                 bestMarker = currentMarker;
                 bestMarker.resetMarkerContent();
                 return bestMarker.LayoutMarker(area);
             }
         }
     }
     return new Status(Status.OK);
 }
コード例 #6
0
        private Marker SearchPage(Page page)
        {
            ArrayList pageMarkers = page.getMarkers();

            if (pageMarkers.Count == 0)
            {
                return(null);
            }

            if (retrievePosition == RetrievePosition.FIC)
            {
                for (int i = 0; i < pageMarkers.Count; i++)
                {
                    Marker currentMarker = (Marker)pageMarkers[i];
                    if (currentMarker.GetMarkerClassName().Equals(retrieveClassName))
                    {
                        return(currentMarker);
                    }
                }
            }
            else if (retrievePosition == RetrievePosition.FSWP)
            {
                for (int c = 0; c < pageMarkers.Count; c++)
                {
                    Marker currentMarker = (Marker)pageMarkers[c];
                    if (currentMarker.GetMarkerClassName().Equals(retrieveClassName))
                    {
                        if (currentMarker.GetRegistryArea().isFirst())
                        {
                            return(currentMarker);
                        }
                    }
                }
            }
            else if (retrievePosition == RetrievePosition.LSWP)
            {
                for (int c = pageMarkers.Count - 1; c >= 0; c--)
                {
                    Marker currentMarker = (Marker)pageMarkers[c];
                    if (currentMarker.GetMarkerClassName().Equals(retrieveClassName))
                    {
                        if (currentMarker.GetRegistryArea().isFirst())
                        {
                            return(currentMarker);
                        }
                    }
                }
            }
            else if (retrievePosition == RetrievePosition.LEWP)
            {
                for (int c = pageMarkers.Count - 1; c >= 0; c--)
                {
                    Marker currentMarker = (Marker)pageMarkers[c];
                    if (currentMarker.GetMarkerClassName().Equals(retrieveClassName))
                    {
                        if (currentMarker.GetRegistryArea().isLast())
                        {
                            return(currentMarker);
                        }
                    }
                }
            }
            else
            {
                throw new FonetException("Illegal 'retrieve-position' value");
            }
            return(null);
        }