Esempio n. 1
0
 public ChoicePrompt(string culture, PromptValidator <ChoiceResult> validator = null, ListStyle listStyle = ListStyle.Auto)
 {
     Style         = listStyle;
     Validator     = validator;
     Culture       = culture;
     ChoiceOptions = InlineChoiceOptions.ContainsKey(culture) ? InlineChoiceOptions[culture] : InlineChoiceOptions[English];
 }
Esempio n. 2
0
 private void method_10(ListStyle A_0)
 {
     for (int i = 0; i < A_0.Levels.Count; i++)
     {
         this.method_13(A_0.Levels[i], i);
     }
 }
Esempio n. 3
0
 public static bool Disconnect(ListStyle ls)
 {
     return(ls == ListStyle.Disconnect ||
            ls == ListStyle.DisconnectView ||
            ls == ListStyle.EditDisconnectView ||
            ls == ListStyle.EditDeleteDisconnectView);
 }
        private void AddLocationsFolder(Document document)
        {
            var locationFolder = new Folder
            {
                Name = "Locations"
            };

            document.AddFeature(locationFolder);

            var listStyle = new ListStyle
            {
                ItemType = ListItemType.CheckHideChildren,
            };

            listStyle.AddItemIcon(new ItemIcon
            {
                Href = new Uri("http://maps.google.com/mapfiles/kml/shapes/placemark_circle.png", UriKind.Absolute)
            });

            locationFolder.AddStyle(new Style
            {
                List = listStyle
            });

            locationFolder.AddFeature(this.From.ToKmlPlacemark(KmlCommonElements.PlacementCircleStyleMapReferenceUri));
            locationFolder.AddFeature(this.To.ToKmlPlacemark(KmlCommonElements.PlacementCircleStyleMapReferenceUri));
        }
Esempio n. 5
0
    public static ItemList <T> GetItemList <T>(this IGetPagedSelector <T> psd, ListStyle style, long?pageIndex) where T : class, IDbObject, new()
    {
        var ps
            = (style == ListStyle.Static) || (style == ListStyle.StaticLite) || (style == ListStyle.Hybird && pageIndex != null)
            ? psd.GetStaticPagedSelector()
            : psd.GetPagedSelector();

        var listPageCount = ps.GetPageCount();

        if (style == ListStyle.StaticLite)
        {
            listPageCount--;
        }
        if (pageIndex == null)
        {
            if (style == ListStyle.Static || style == ListStyle.StaticLite)
            {
                pageIndex = listPageCount;
            }
        }
        var list = ps.GetItemList((pageIndex ?? 1) - 1);

        if (style == ListStyle.Hybird && pageIndex == null)
        {
            list.PageIndex = 0;
        }
        if (style == ListStyle.StaticLite)
        {
            list.PageCount--;
        }
        return(list);
    }
Esempio n. 6
0
 public ReorderableListAttribute(ListStyle style = ListStyle.Round, string elementLabel = null, bool fixedSize = false, bool draggable = true)
 {
     Draggable    = draggable;
     FixedSize    = fixedSize;
     ListStyle    = style;
     ElementLabel = elementLabel;
 }
Esempio n. 7
0
    internal static void smethod_1(Class857 A_0)
    {
        int      num    = 1;
        Class101 class2 = new Class101();

        class2.method_22(new ListStyle(A_0.method_9()));
        class2.method_21().Name = BookmarkStart.b("栦䴨弪爬怮䐰䜲礴帶圸帺焼嘾㉀㝂ᙄ㍆え❊⡌", 1);
        A_0.method_66(class2);
        Class396 class3 = A_0.method_11();

        class3.method_18();
        while (class3.method_9(BookmarkStart.b("䠦尨弪䄬䘮弰嘲ᠴ䐶䴸䈺儼娾", num)))
        {
            string str;
            class3 = A_0.method_11();
            if (((str = class3.method_1()) != null) && (str == BookmarkStart.b("䠦尨弪䄬䘮弰嘲ᠴ嬶尸䴺堼匾汀あㅄ㹆╈⹊", num)))
            {
                ListStyle listStyle = class2.method_21();
                ListLevel level     = new ListLevel(listStyle);
                listStyle.Levels.method_5(level);
                smethod_5(A_0, class2, level, BookmarkStart.b("䠦尨弪䄬䘮弰嘲ᠴ嬶尸䴺堼匾汀あㅄ㹆╈⹊", num));
            }
            else
            {
                class3.vmethod_1();
            }
        }
        A_0.method_13().method_1(class2, A_0.method_20(), false);
        A_0.method_9().ListStyles.Add(class2.method_21());
    }
Esempio n. 8
0
 private void method_3()
 {
     if (this.class703_0.class597_0.class1111_73.int_1 != 0)
     {
         this.binaryReader_0.BaseStream.Position = this.class703_0.class597_0.class1111_73.int_0;
         int num2 = this.binaryReader_0.ReadInt16();
         for (int i = 0; i < num2; i++)
         {
             this.listStyleCollection_0.Add(this.method_5());
         }
         if (this.dictionary_1 == null)
         {
             this.dictionary_1 = new Dictionary <string, int>();
         }
         for (int j = 0; j < num2; j++)
         {
             ListStyle style = this.listStyleCollection_0[this.int_0 + j];
             if (!this.method_9(style))
             {
                 return;
             }
             this.method_6(style);
             this.dictionary_1.Add(style.ListDefId.ToString(), j + 1);
         }
     }
 }
Esempio n. 9
0
    private void method_6(ListStyle A_0)
    {
        int num = 12;

        if (A_0.Levels != null)
        {
            A_0.ListType = ListType.Bulleted;
            using (IEnumerator enumerator = A_0.Levels.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ListLevel current = (ListLevel)enumerator.Current;
                    if (current.PatternType != ListPatternType.Bullet)
                    {
                        goto Label_0046;
                    }
                }
                goto Label_0060;
Label_0046:
                A_0.ListType = ListType.Numbered;
            }
        }
Label_0060:
        if (A_0.ListType == ListType.Numbered)
        {
            A_0.Name = BookmarkStart.b("簱䄳嬵娷弹主嬽␿ᵁ", num) + Guid.NewGuid().ToString();
        }
        else
        {
            A_0.Name = BookmarkStart.b("瀱䄳娵吷弹䠻嬽␿ᵁ", num) + Guid.NewGuid().ToString();
        }
        A_0.IsSimple = (A_0.Levels != null) && (A_0.Levels.Count == 1);
    }
Esempio n. 10
0
        public void List_ConstructorTest()
        {
            ListStyle target = new ListStyle();

            Assert.IsNotNull(target);
            Assert.AreEqual(StyleKeys.ListItemKey, target.ItemKey);
        }
Esempio n. 11
0
 internal static void smethod_0(Class857 A_0, string A_1, ref DocumentObject A_2, Class101 A_3, bool A_4)
 {
     bool_0 = A_4;
     smethod_1(A_0, A_1, A_2);
     bool_0 = false;
     if (A_3 != null)
     {
         if (A_2 == null)
         {
             A_2 = A_0.method_9().LastSection.Body;
         }
         Paragraph lastChild = (Paragraph) A_2.LastChild;
         if (A_4)
         {
             ListStyle style = A_3.method_21();
             lastChild.ListFormat.ListLevelNumber = A_0.method_24();
             lastChild.ListFormat.ApplyStyle(style.Name);
             if (A_3.method_27() != null)
             {
                 lastChild.ListFormat.LFOStyleName = A_3.method_27();
             }
             A_3.method_26(true);
         }
     }
 }
Esempio n. 12
0
        private TextParagraphPropertiesType getParagraphPropFromTextListStyle(OpenXmlCompositeElement listStyleType, int level)
        {
            if (listStyleType != null)
            {
                if (listStyleType is TextListStyleType)
                {
                    TextListStyleType parPropType = (TextListStyleType)listStyleType;
                    switch (level)
                    {
                    case 0: return(parPropType.Level1ParagraphProperties);

                    case 1: return(parPropType.Level2ParagraphProperties);

                    case 2: return(parPropType.Level3ParagraphProperties);

                    case 3: return(parPropType.Level4ParagraphProperties);

                    case 4: return(parPropType.Level5ParagraphProperties);

                    case 5: return(parPropType.Level6ParagraphProperties);

                    case 6: return(parPropType.Level7ParagraphProperties);

                    case 7: return(parPropType.Level8ParagraphProperties);

                    case 8: return(parPropType.Level9ParagraphProperties);

                    default: return(parPropType.Level1ParagraphProperties);
                    }
                }
                else if (listStyleType is ListStyle)
                {
                    ListStyle parPropType = (ListStyle)listStyleType;
                    switch (level)
                    {
                    case 0: return(parPropType.Level1ParagraphProperties);

                    case 1: return(parPropType.Level2ParagraphProperties);

                    case 2: return(parPropType.Level3ParagraphProperties);

                    case 3: return(parPropType.Level4ParagraphProperties);

                    case 4: return(parPropType.Level5ParagraphProperties);

                    case 5: return(parPropType.Level6ParagraphProperties);

                    case 6: return(parPropType.Level7ParagraphProperties);

                    case 7: return(parPropType.Level8ParagraphProperties);

                    case 8: return(parPropType.Level9ParagraphProperties);

                    default: return(parPropType.Level1ParagraphProperties);
                    }
                }
            }
            return(null);
        }
    static void Example1()
    {
        var document = new DocumentModel();

        var section = new Section(document);

        document.Sections.Add(section);

        var blocks = section.Blocks;

        // Create bullet list style.
        ListStyle bulletList = new ListStyle(ListTemplateType.Bullet);

        bulletList.ListLevelFormats[0].ParagraphFormat.NoSpaceBetweenParagraphsOfSameStyle = true;
        bulletList.ListLevelFormats[0].CharacterFormat.FontColor = Color.Red;

        // Create bullet list items.
        blocks.Add(new Paragraph(document, "First item.")
        {
            ListFormat = { Style = bulletList }
        });
        blocks.Add(new Paragraph(document, "Second item.")
        {
            ListFormat = { Style = bulletList }
        });
        blocks.Add(new Paragraph(document, "Third item.")
        {
            ListFormat = { Style = bulletList }
        });

        blocks.Add(new Paragraph(document));

        // Create number list style.
        var numberList = new ListStyle(ListTemplateType.NumberWithDot);

        // Create number list items.
        blocks.Add(new Paragraph(document, "First item.")
        {
            ListFormat = { Style = numberList }
        });
        blocks.Add(new Paragraph(document, "Sub item 1. a.")
        {
            ListFormat = { Style = numberList, ListLevelNumber = 1 }
        });
        blocks.Add(new Paragraph(document, "Item below sub item 1. a.")
        {
            ListFormat = { Style = numberList, ListLevelNumber = 2 }
        });
        blocks.Add(new Paragraph(document, "Sub item 1. b.")
        {
            ListFormat = { Style = numberList, ListLevelNumber = 1 }
        });
        blocks.Add(new Paragraph(document, "Second item.")
        {
            ListFormat = { Style = numberList }
        });

        document.Save("Lists.docx");
    }
Esempio n. 14
0
 private void method_13(ListStyle A_0)
 {
     for (int i = 0; i < A_0.Levels.Count; i++)
     {
         ListLevel level = A_0.Levels[i];
         this.method_14(level, level.LevelNumber, i);
     }
 }
 /// <summary>
 /// Builds a new binary choice prompt
 /// </summary>
 /// <param name="dialogs"> The dialogs collection. </param>
 /// <param name="factory"> The factory used for building dialogs. </param>
 /// <param name="promptName"> The name of the prompt, to be used in other dialogs. </param>
 /// <param name="listStyle"> The style of dialog options list. </param>
 /// <returns>
 /// The <see cref="DialogSet"/>.
 /// </returns>
 public static DialogSet WithChoicePrompt(
     this DialogSet dialogs,
     IDialogFactory <DialogSet> factory,
     string promptName,
     ListStyle listStyle = ListStyle.Auto)
 {
     return(factory.BuildChoicePrompt(dialogs, promptName, listStyle));
 }
Esempio n. 16
0
 public static bool View(ListStyle ls)
 {
     return(ls == ListStyle.ViewDelete ||
            ls == ListStyle.View ||
            ls == ListStyle.EditDeleteView ||
            ls == ListStyle.EditDisconnectView ||
            ls == ListStyle.EditDeleteDisconnectView);
 }
Esempio n. 17
0
        private static long[] GetLinkNumList(ListStyle style, long pageCount, long pageIndex, long linkCount = 5)
        {
            var itemList = new ItemList <Article> {
                PageCount = pageCount, PageIndex = pageIndex
            };
            var list = new List <long>(itemList.PageLinks(style, linkCount));

            return(list.ToArray());
        }
Esempio n. 18
0
            protected override void FillStyleAttributes(System.Web.UI.CssStyleCollection attributes, System.Web.UI.IUrlResolutionService urlResolver)
            {
                if (!string.IsNullOrEmpty(Position))
                {
                    attributes[HtmlTextWriterStyle.Position] = Position;
                }
                if (!string.IsNullOrEmpty(Visibility))
                {
                    attributes[HtmlTextWriterStyle.Visibility] = Visibility;
                }
                if (!Left.IsEmpty)
                {
                    attributes[HtmlTextWriterStyle.Left] = Left.ToString();
                }
                if (!Top.IsEmpty)
                {
                    attributes[HtmlTextWriterStyle.Top] = Top.ToString();
                }

                if (!string.IsNullOrEmpty(Margin))
                {
                    attributes[HtmlTextWriterStyle.Margin] = Margin.ToString();
                }
                if (!string.IsNullOrEmpty(Padding))
                {
                    attributes[HtmlTextWriterStyle.Padding] = Padding.ToString();
                }
                if (!string.IsNullOrEmpty(ListStyle))
                {
                    attributes["list-style"] = ListStyle.ToString();
                }
                if (!string.IsNullOrEmpty(Float))
                {
                    attributes["float"] = Float.ToString();
                }
                if (!string.IsNullOrEmpty(Display))
                {
                    attributes[HtmlTextWriterStyle.Display] = Display.ToString();
                }
                if (!string.IsNullOrEmpty(Cursor))
                {
                    attributes[HtmlTextWriterStyle.Cursor] = Cursor.ToString();
                }



                base.FillStyleAttributes(attributes, urlResolver);

                string[] filter = new string[] { "left", "right", "top", "bottom", "width", "height", "margin-left", "margin-right", "margin-top", "margin-bottom" };
                foreach (string f in filter)
                {
                    if (!string.IsNullOrEmpty(attributes[f]))
                    {
                        attributes[f] = attributes[f].Replace(",", ".");
                    }
                }
            }
Esempio n. 19
0
 /// <summary>
 /// Copy constructor used during layout expansion and page break handling.
 /// </summary>
 public ListLayout(ListLayout src)
     : base(src)
 {
     _emptyText  = src._emptyText;
     _whenEmpty  = src._whenEmpty?.DeepCopy();
     _merge      = src._merge;
     _style      = src._style;
     _emptyStyle = src._emptyStyle;
 }
Esempio n. 20
0
        protected void ProcessList(long?pageIndex, int?pageSize, ListStyle style)
        {
            if (pageIndex < 0)
            {
                throw new DataException("The pageIndex out of supported range.");
            }
            int psize = pageSize ?? WebSettings.DefaultPageSize;
            var psd   = DbEntry.From <T>().Where(Condition.Empty).OrderBy("Id DESC").PageSize(psize);

            this["ItemList"] = psd.GetItemList(style, pageIndex);
        }
Esempio n. 21
0
 private bool method_9(ListStyle A_0)
 {
     for (int i = 0; i < A_0.Levels.Count; i++)
     {
         if (!this.method_11(A_0.Levels[i]))
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 22
0
 public ConfirmPromptInternal(string culture, PromptValidator <ConfirmResult> validator = null, Dictionary <string, Tuple <Choice, Choice> > confirmOptions = null, Dictionary <string, ChoiceFactoryOptions> inlineChoiceOptions = null, ListStyle listStyle = ListStyle.Auto)
 {
     model               = new ChoiceRecognizer(culture).GetBooleanModel(culture);
     Style               = listStyle;
     Validator           = validator;
     Culture             = culture;
     ConfirmOptions      = confirmOptions != null ? confirmOptions : DefaultConfirmOptions;
     InlineChoiceOptions = inlineChoiceOptions != null ? inlineChoiceOptions : DefaultInlineChoiceOptions;
     Choices             = ConfirmOptions.ContainsKey(culture) ? ConfirmOptions[culture] : ConfirmOptions[English];
     ChoiceOptions       = InlineChoiceOptions.ContainsKey(culture) ? InlineChoiceOptions[culture] : InlineChoiceOptions[English];
 }
Esempio n. 23
0
        public int Add(ListStyle style)
        {
            int num = 13;

            if (style == null)
            {
                throw new ArgumentNullException(BookmarkStart.b("䀲䄴丶唸帺", num));
            }
            style.method_0(base.Document);
            return(base.InnerList.Add(style));
        }
Esempio n. 24
0
        public DataContextItem(ListStyle ls, object o)
        {
            this.Check      = new DataContextItemValue(ListStyleFormat.Check(ls));
            this.View       = new DataContextItemValue(ListStyleFormat.View(ls));
            this.Edit       = new DataContextItemValue(ListStyleFormat.Edit(ls));
            this.Delete     = new DataContextItemValue(ListStyleFormat.Delete(ls));
            this.Select     = new DataContextItemValue(ListStyleFormat.Select(ls));
            this.Disconnect = new DataContextItemValue(ListStyleFormat.Disconnect(ls));

            this.DataContext = o;
        }
Esempio n. 25
0
        protected override StringFormatterBase List(IEnumerable <string> items, ListStyle style = ListStyle.Bullet)
        {
            var tag = style == ListStyle.Bullet ? "ul" : "ol";

            WriteLine($"<{tag}>");
            foreach (var item in items)
            {
                WriteLine($"<li>{Escape(item)}</li>");
            }
            WriteLine($"</{tag}>");
            return(this);
        }
        /// <summary>
        /// Creates a KML folder with the visualization settings of the link.
        /// </summary>
        /// <param name="directionVector">The direction vector to convert.</param>
        /// <returns>The KML elements for visualizing the link.</returns>
        public static Folder ToKmlLinkFolder(this IDirectionVector directionVector)
        {
            if (directionVector == null)
            {
                throw new ArgumentNullException(nameof(directionVector), "directionVector is null");
            }

            var fromAsHamnetSite = directionVector.From as IHamnetDbSite;
            var toAsHamnetSite   = directionVector.To as IHamnetDbSite;
            var linkFolder       = new Folder
            {
                Name = (fromAsHamnetSite != null) && (toAsHamnetSite != null)
                    ? $"Link between {fromAsHamnetSite.Callsign?.ToUpperInvariant()} and {toAsHamnetSite.Callsign?.ToUpperInvariant()}"
                    : $"Link between {directionVector.From.Latitude}/{directionVector.From.Longitude} and {directionVector.To.Latitude}/{directionVector.To.Longitude}",
                Visibility = true
            };

            var listStyle = new ListStyle
            {
                ItemType = ListItemType.CheckHideChildren,
            };

            listStyle.AddItemIcon(new ItemIcon
            {
                Href = new Uri("empty_icon.png", UriKind.Relative)
            });

            linkFolder.AddStyle(new Style
            {
                List = listStyle
            });

            linkFolder.AddFeature(CreateLinePlacemark(directionVector.From, directionVector.To, "Line with screen to ground", new Uri("#line", UriKind.Relative), true, string.Empty));

            // description will be added to the larger (outer) zone only - hence the 2.4 GHz zone
            string description = KmlCommonElements.BalloonCssString;

            description += (fromAsHamnetSite != null) && (toAsHamnetSite != null)
                    ? $"<h2>Link between {fromAsHamnetSite.Callsign?.ToUpperInvariant()} and {toAsHamnetSite.Callsign?.ToUpperInvariant()}</h2>"
                    : $"<h2>Link between {directionVector.From.Latitude}/{directionVector.From.Longitude} and {directionVector.To.Latitude}/{directionVector.To.Longitude}</h2>";

            description += $@"<table>
<tr><td class=""left"">distance: </td><td>{directionVector.Distance / 1000.0:F1} km</td></tr>
<tr><td class=""left"">azimuth to: </td><td>{directionVector.Bearing:F1}&#176;</td></tr>
<tr><td class=""left"">elevation to: </td><td>{directionVector.Elevation:F1}&#176;</td></tr>
<tr><td class=""left"">azimuth from: </td><td>{(directionVector.Bearing + 180.0) % 360.0:F3}&#176;</td></tr>
<tr><td class=""left""><a href=""https://en.wikipedia.org/wiki/Free-space_path_loss"">FSPL</a>: </td><td>{directionVector.Distance.FreeSpacePathloss(2.4e9):F1} dB @ 2.4 GHz<br>{directionVector.Distance.FreeSpacePathloss(5.8e9):F1} dB @ 5.8 GHz</td></tr>
</table>";
            linkFolder.AddFeature(CreateFresnelPlacemark(directionVector, "2.4 GHz fresnel zone", 2.4e9, KmlCommonElements.PolygonStyleTransparentReferenceUri, description));
            linkFolder.AddFeature(CreateFresnelPlacemark(directionVector, "5.8 GHz fresnel zone", 5.8e9, KmlCommonElements.PolygonStyleReferenceUri, string.Empty));

            return(linkFolder);
        }
Esempio n. 27
0
        /// <summary>
        /// Determines if the given value represents a valid state of this property.
        /// </summary>
        /// <param name="value">The state that should be used.</param>
        /// <returns>True if the state is valid, otherwise false.</returns>
        protected override Boolean IsValid(CSSValue value)
        {
            var position = value.ToListStyle();

            if (position.HasValue)
            {
                _style = position.Value;
                return(true);
            }

            return(false);
        }
Esempio n. 28
0
 public ControllerInfo(Type type)
 {
     this.Type = type;
     var ms = GetMethods(Type);
     DefaultAction = GetDefaultAction(ms);
     Actions = GetActions(ms);
     IsScaffolding = Type.HasAttribute<ScaffoldingAttribute>(true);
     ListStyle = GetListStyle();
     Name = GetControllerName();
     LowerName = Name.ToLower();
     Constructor = ClassHelper.GetConstructorDelegate(Type);
 }
Esempio n. 29
0
            void ParseMatch(GroupCollection matchGroups, ListStyle style)
            {
                string dirMatch = (style == ListStyle.Unix ? "d" : "dir");

                Style       = style;
                IsDirectory = matchGroups["dir"].Value.Equals(dirMatch, StringComparison.InvariantCultureIgnoreCase);
                Name        = matchGroups["name"].Value;

                if (!IsDirectory)
                {
                    Length = long.Parse(matchGroups["size"].Value);
                }
            }
Esempio n. 30
0
    internal void method_10(ListLevel A_0, ListStyle A_1, string A_2)
    {
        int num = 12;

        if (this.class526_0.method_3(null, A_0.CharacterFormat))
        {
            Style  style = this.class422_0.method_15().Styles.method_13(A_1.ListStyleIstd, false);
            string str   = ((style == null) || (style.StyleIdentifier == StyleIdentifier.NoList)) ? "" : Class922.smethod_77(style);
            this.method_11(A_2, BookmarkStart.b("䘱儳丵䰷", num), str);
            this.class526_0.method_2(false);
            this.class422_0.method_18().method_6(BookmarkStart.b("䄱䀳伵吷弹ػ䴽㐿㭁⡃⍅", num));
        }
    }
Esempio n. 31
0
        /// <summary>
        /// Creates the list style.
        /// </summary>
        /// <param name="styleNode">The style node.</param>
        private void CreateListStyle(XmlNode styleNode)
        {
            ListStyle listStyle = new ListStyle(this._document, styleNode);

            if (!this._common)
            {
                this._document.Styles.Add(listStyle);
            }
            else
            {
                this._document.CommonStyles.Add(listStyle);
            }
        }
Esempio n. 32
0
        public static IEnumerable<long> PageLinks(long pageCount, long pageIndex, ListStyle style, long linkCount)
        {
            if (pageIndex > pageCount || pageIndex < 0)
            {
                throw new ArgumentOutOfRangeException("pageIndex");
            }
            if (linkCount < 3)
            {
                throw new ArgumentOutOfRangeException("linkCount");
            }

            if (style == ListStyle.Hybird)
            {
                if (pageIndex == 0)
                {
                    pageIndex = pageCount;
                }
                //pageCount++;
            }

            if(linkCount > pageCount)
            {
                linkCount = pageCount;
            }

            if(pageCount < 3)
            {
                switch (style)
                {
                    case ListStyle.Default:
                        for (long i = 1; i <= pageCount; i++)
                        {
                            yield return i;
                        }
                        break;
                    case ListStyle.Static:
                        for (long i = pageCount; i >= 1; i--)
                        {
                            yield return i;
                        }
                        break;
                    case ListStyle.Hybird:
                        yield return 0;
                        if(pageCount >= 2)
                        {
                            for (long i = pageCount - 1; i >= 1; i--)
                            {
                                yield return i;
                            }
                        }
                        break;
                }
            }
            else
            {
                long diff = linkCount - 3;
                long less = pageIndex - diff / 2;
                long more = pageIndex + diff / 2;
                if(diff % 2 == 1)
                {
                    less--;
                }
                if (less <= 1)
                {
                    more = more + (2 - less);
                    less = 2;
                }
                else if ((pageCount - more) < 1)
                {
                    var n = pageCount - more - 1;
                    less = less + n;
                    more = more + n;
                }
                switch (style)
                {
                    case ListStyle.Default:
                        yield return 1;
                        if (less != 2)
                        {
                            yield return -1;
                        }
                        for (long i = less; i <= more; i++)
                        {
                            yield return i;
                        }
                        if (pageCount != 1 + more)
                        {
                            yield return -1;
                        }
                        yield return pageCount;
                        break;
                    case ListStyle.Static:
                        yield return pageCount;
                        if (pageCount != 1 + more)
                        {
                            yield return -1;
                        }
                        for (long i = more; i >= less; i--)
                        {
                            yield return i;
                        }
                        if (less != 2)
                        {
                            yield return -1;
                        }
                        yield return 1;
                        break;
                    case ListStyle.Hybird:
                        yield return 0;
                        if (pageCount != more + 1)
                        {
                            yield return -1;
                        }
                        for (long i = more; i >= less; i--)
                        {
                            yield return i;
                        }
                        if (less != 2)
                        {
                            yield return -1;
                        }
                        yield return 1;
                        break;
                }
            }
        }
Esempio n. 33
0
        private static FTPLineResult ParseMatch(GroupCollection matchGroups, ListStyle style)
        {
            FTPLineResult result = new FTPLineResult();

            result.Style = style;
            string dirMatch = style == ListStyle.Unix ? "d" : "<dir>";
            result.IsDirectory = matchGroups["Directory"].Value.Equals(dirMatch, StringComparison.InvariantCultureIgnoreCase);
            result.Permissions = matchGroups["Permissions"].Value;
            result.Name = matchGroups["Name"].Value;

            if (!result.IsDirectory)
            {
                result.SetSize(matchGroups["Size"].Value);
            }

            result.Owner = matchGroups["Owner"].Value;
            result.Group = matchGroups["Group"].Value;
            result.SetDateTime(matchGroups["Year"].Value, matchGroups["Month"].Value, matchGroups["Day"].Value);

            return result;
        }
Esempio n. 34
0
 private static long[] GetLinkNumList(ListStyle style, long pageCount, long pageIndex, long linkCount = 5)
 {
     var itemList = new ItemList<Article> { PageCount = pageCount, PageIndex = pageIndex };
     var list = new List<long>(itemList.PageLinks(style, linkCount));
     return list.ToArray();
 }
Esempio n. 35
0
 public ListStyleAttribute(ListStyle style)
 {
     this.Style = style;
 }
Esempio n. 36
0
        private void InitializesStyles()
        {
            _title1 = (ParagraphStyle)Style.CreateStyle(StyleTemplateType.Heading1, _innerDocument);
            _title1.CharacterFormat.FontName = "Segoe UI";
            _title1.CharacterFormat.FontColor = new Color(18, 97, 225);

            _title2 = (ParagraphStyle)Style.CreateStyle(StyleTemplateType.Heading2, _innerDocument);
            _title2.CharacterFormat.FontName = "Segoe UI";
            _title2.CharacterFormat.FontColor = new Color(59, 59, 59);

            _innerDocument.Styles.Add(_title1);
            _innerDocument.Styles.Add(_title2);

            _cellHeader = (ParagraphStyle)Style.CreateStyle(StyleTemplateType.Normal, _innerDocument);
            _cellHeader.Name = "MyHeaderCells";
            _cellHeader.CharacterFormat.Bold = true;
            _cellHeader.CharacterFormat.FontName = "Segoe UI";
            _innerDocument.Styles.Add(_cellHeader);

            _cellContent = (ParagraphStyle)Style.CreateStyle(StyleTemplateType.Normal, _innerDocument);
            _cellContent.Name = "MyContentCells";
            _cellContent.CharacterFormat.FontName = "Segoe UI";
            _innerDocument.Styles.Add(_cellContent);

            _tcfHeader = new TableCellFormat();
            _tcfHeader.Borders.SetBorders(MultipleBorderTypes.Bottom, BorderStyle.Single, new Color(165, 172, 181), 1);
            _tcfHeader.Borders.SetBorders(MultipleBorderTypes.Left | MultipleBorderTypes.Right, BorderStyle.None,
                                          Color.White, 0);
            _tcfHeader.BackgroundColor = new Color(245, 247, 249);

            _tcfContent = new TableCellFormat();
            _tcfContent.Borders.SetBorders(MultipleBorderTypes.All, BorderStyle.None, new Color(255, 255, 255), 0);

            _numberList = new ListStyle("NumberWithDot", ListTemplateType.NumberWithDot);

            _innerDocument.Styles.Add(_numberList);
        }
Esempio n. 37
0
 public ScaffoldingViews(ControllerInfo ci, Type t, HttpContext context)
 {
     _style = ci.ListStyle;
     _dctx = ModelContext.GetInstance(t);
     _ctx = context;
 }