コード例 #1
0
        public static Paragraph Heading(this Paragraph paragraph, HeadingType headingType)
        {
            string StyleName = headingType.EnumDescription();

            paragraph.StyleName = StyleName;
            return(paragraph);
        }
コード例 #2
0
 public async Task <List <SelectItem> > GetHeadingByType(int checklistId, HeadingType headingType)
 {
     return(await _context.Headings.Where(w => w.CheckListId == checklistId && w.HeadingType == headingType)
            .Select(s => new SelectItem {
         Id = s.Id, Text = s.Content
     }).ToListAsync());
 }
コード例 #3
0
 private void RenderParagraph(string value, HeadingType headingType)
 {
     if (!String.IsNullOrWhiteSpace(value))
     {
         _wordDocument.InsertParagraph().Heading(headingType).Append(value);
     }
 }
コード例 #4
0
        public static Paragraph Heading(this Paragraph paragraph, HeadingType headingType)
        {
            var description = headingType.EnumDescription();

            paragraph.StyleName = description;
            return(paragraph);
        }
コード例 #5
0
 public Content(HeadingType heading, string subHeading, string location, string workTitle, string duration, string description)
 {
     this.heading     = heading;
     this.subHeading  = subHeading;
     this.location    = location;
     this.workTitle   = workTitle;
     this.duration    = duration;
     this.description = description;
 }
コード例 #6
0
            } // @ public double DistanceToPosXYZ(double X, double Y, double Z)

            #endregion

            #region HeadingTo overloads

            /// <summary>
            /// Gets heading from player to NPC/PC as selected HeadingType
            /// </summary>
            /// <param name="ID">ID of NPC/PC</param>
            /// <param name="headingType">Heading type for the return value.</param>
            /// <returns>Heading to NPC with matching ID as headingType</returns>
            public float HeadingTo(int ID, HeadingType headingType)
            {
                if (ID > 0)
                {
                    return(HeadingTo(_FFACE.NPC.PosX(ID), _FFACE.NPC.PosY(ID), _FFACE.NPC.PosZ(ID), headingType));
                }
                else
                {
                    throw new IndexOutOfRangeException("NPC ID should be greater than 0 when passing to HeadingTo");
                }
            } // @ public float HeadingTo(short ID, HeadingType headingType)
コード例 #7
0
            } // @ public float HeadingTo(double X, double Z, HeadingType headingType)

            /// <summary>
            /// Gets heading from player to Position as selected HeadingType
            /// </summary>
            /// <param name="X">X coordinate of Position to get heading to.</param>
            /// <param name="Y">Y coordinate of Position to get heading to.</param>
            /// <param name="Z">Z coordinate of Position to get heading to.</param>
            /// <param name="headingType">Heading type for the return value.</param>
            /// <returns>Heading to X, Y, Z coords as headingType</returns>
            public float HeadingTo(double X, double Y, double Z, HeadingType headingType)
            {
                X = X - _FFACE.Player.PosX;
                Z = Z - _FFACE.Player.PosZ;
                double H = -Math.Atan2(Z, X);

                if (headingType == HeadingType.Degrees)
                {
                    H = PosHToDegrees((float)H);
                }
                return((float)H);
            } // @ public float HeadingTo(double X, double Y, double Z, HeadingType headingType)
コード例 #8
0
            } // @ public bool FaceHeading(double X, double Y, double Z)

            /// <summary>
            /// Faces the given heading in the passed HeadingType
            /// </summary>
            /// <param name="PosH">Heading to set on player.</param>
            /// <param name="headingType">HeadingType indicating the type of the value.</param>
            /// <returns>true on success, false otherwise</returns>
            public bool FaceHeading(float PosH, HeadingType headingType)
            {
                if (headingType == HeadingType.Degrees)
                {
                    PosH = DegreesToPosH(PosH);
                }

                if (FFACE.SetNPCPosH(_InstanceID, _FFACE.Player.ID, PosH) != 0.0f)
                {
                    return(true);
                }
                return(false);
            } // @ public bool FaceHeading(float PosH, HeadingType headingType)
コード例 #9
0
        public SharePointEnvironmentSettingsForm(SharePointEnvironmentSettings environmentSettings, HeadingType headingType)
        {
            InitializeComponent();

            if (headingType != HeadingType.None)
            {
                lblReviewHeading.Visible = true;

                if (headingType == HeadingType.NewEnvironment)
                    lblReviewHeading.Text = "Please review the settings for this new environment";
            }

            SharePointEnvironmentSettings = environmentSettings.GetCopy();
        }
コード例 #10
0
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            var tag      = HeadingType.ToString().ToLower();
            var cssClass = GdsEnums.GetDescriptionFromEnum(HeadingType);

            output.TagName = tag;
            output.AddClass(cssClass, HtmlEncoder.Default);

            if (!string.IsNullOrEmpty(Caption))
            {
                var caption = new TagBuilder("span");
                caption.MergeAttribute("class", cssClass.Replace("heading", "caption"));
                caption.InnerHtml.Append(Caption);
                output.PreContent.SetHtmlContent(caption);
            }

            output.Content.SetContent(Text);
        }
コード例 #11
0
        /// <summary>
        /// Добавление в отчет заголовка первого уровня
        /// </summary>
        /// <param name="sectionName">Название заголовка</param>
        public void AddSection(string sectionName)
        {
            //var headingTypes = Enum.GetValues(typeof(HeadingType));

            HeadingType heading   = HeadingType.Heading1;
            var         text      = string.Format(sectionName, heading.EnumDescription());
            var         paragraph = document.InsertParagraph(text);

            // Set the paragraph's heading type.
            paragraph.Heading(heading).
            Font("Times New Roman").
            FontSize(14).
            Color(Color.Black).
            Bold().
            SpacingLine(22).
            Kerning(14);
            paragraph.IndentationFirstLine = 1.5f;
            paragraph.Alignment            = Alignment.left;

            document.Save();
        }
コード例 #12
0
        private void GetHeadingsFindsHeading(HeadingType headingType)
        {
            const string html = @"
				<h1><a name=""h1""></a>Heading1</h1>
				<p>Heading 1 contents</p>
				<h2><a name=""h2""></a>Heading2</h2>
				<p>Heading 2 contents</p>
				<h3><a name=""h3""></a>Heading3</h3>
				<p>Heading 3 contents</p>
				<h4><a name=""h4""></a>Heading4</h4>
				<p>Heading 4 contents</p>
				<h5><a name=""h5""></a>Heading5</h5>
				<p>Heading 5 contents</p>
				<h6><a name=""h6""></a>Heading6</h6>
				<p>Heading 6 contents</p>
			"            ;

            var headings = _tableOfContentsService.GetHeadings(html);

            Assert.AreEqual(1, headings.Where(x => x.HeadingType == headingType).Count(), "More than one heading of type found");
        }
コード例 #13
0
        public void ToggleHeading(HeadingType headingType, bool useUnderlineStyleHeadings)
        {
            string text = string.Empty;

            switch (headingType)
            {
            case HeadingType.Heading1:
                text = ((useUnderlineStyleHeadings && this.SelectionLength > 0) ? MarkdownSyntax.Heading1Alternative : MarkdownSyntax.Heading1);
                break;

            case HeadingType.Heading2:
                text = ((useUnderlineStyleHeadings && this.SelectionLength > 0) ? MarkdownSyntax.Heading2Alternative : MarkdownSyntax.Heading2);
                break;

            case HeadingType.Heading3:
                text = MarkdownSyntax.Heading3;
                break;

            case HeadingType.Heading4:
                text = MarkdownSyntax.Heading4;
                break;

            case HeadingType.Heading5:
                text = MarkdownSyntax.Heading5;
                break;

            case HeadingType.Heading6:
                text = MarkdownSyntax.Heading6;
                break;
            }
            if (useUnderlineStyleHeadings && this.SelectionLength > 0 && (headingType == HeadingType.Heading1 || headingType == HeadingType.Heading2))
            {
                this.UnderlineSelection(text);
                return;
            }
            this.ToggleSymmetricalMarkdownFormatting(text);
        }
コード例 #14
0
 public extern HTMLHeadingElement(HeadingType h);
コード例 #15
0
        private void InitializeSectionFormatting()
        {
            SectionHeading = HeadingType.Heading1;

            SectionText = new Formatting();
        }
コード例 #16
0
            } // @ public float HeadingTo(Position position, HeadingType headingType)

            /// <summary>
            /// Gets heading from player to Position as selected HeadingType
            /// </summary>
            /// <param name="X">X coordinate of Position to get heading to.</param>
            /// <param name="Z">Z coordinate of Position to get heading to.</param>
            /// <param name="headingType">Heading type for the return value.</param>
            /// <returns>Heading to X, Z coords as headingType</returns>
            public float HeadingTo(double X, double Z, HeadingType headingType)
            {
                return(HeadingTo(X, 0, Z, headingType));
            } // @ public float HeadingTo(double X, double Z, HeadingType headingType)
コード例 #17
0
            } // @ public float HeadingTo(short ID, HeadingType headingType)

            /// <summary>
            /// Gets heading from player to Position as selected HeadingType
            /// </summary>
            /// <param name="position">Position containing coordinates to get heading to.</param>
            /// <param name="headingType">Heading type for the return value.</param>
            /// <returns>Heading to position as headingType</returns>
            public float HeadingTo(Position position, HeadingType headingType)
            {
                return(HeadingTo(position.X, position.Y, position.Z, headingType));
            } // @ public float HeadingTo(Position position, HeadingType headingType)
コード例 #18
0
        private void InitializeSubSectionFormatting()
        {
            SubSectionHeader = HeadingType.Heading2;

            SubSectionText = new Formatting();
        }
コード例 #19
0
ファイル: Navigator.cs プロジェクト: rinyun/ffacetools
 /// <summary>
 /// Gets heading from player to Position as selected HeadingType
 /// </summary>
 /// <param name="X">X coordinate of Position to get heading to.</param>
 /// <param name="Y">Y coordinate of Position to get heading to.</param>
 /// <param name="Z">Z coordinate of Position to get heading to.</param>
 /// <param name="headingType">Heading type for the return value.</param>
 /// <returns>Heading to X, Y, Z coords as headingType</returns>
 public float HeadingTo(double X, double Y, double Z, HeadingType headingType)
 {
     X = X - _FFACE.Player.PosX;
     Z = Z - _FFACE.Player.PosZ;
     double H = -Math.Atan2(Z, X);
     if (headingType == HeadingType.Degrees)
     {
         H = PosHToDegrees((float)H);
     }
     return (float)H;
 }
コード例 #20
0
ファイル: HeadingParser.cs プロジェクト: Sironfoot/DomsBlog
 public HeadingParser(HeadingType headingType)
 {
     _headingType = headingType;
 }
コード例 #21
0
 private void InitializeDocumentFormatting()
 {
     DocumentText = HeadingType.Heading1;
 }
コード例 #22
0
ファイル: HeadingElement.cs プロジェクト: shalves/Bridge
 public HeadingElement(HeadingType h)
 {
 }
コード例 #23
0
 public ColumnDescriptionType GetAssayColumnDescription(int AID, HeadingType Heading, int TID, [System.Xml.Serialization.XmlIgnoreAttribute()] bool TIDSpecified) {
     object[] results = this.Invoke("GetAssayColumnDescription", new object[] {
                 AID,
                 Heading,
                 TID,
                 TIDSpecified});
     return ((ColumnDescriptionType)(results[0]));
 }
コード例 #24
0
 /// <remarks/>
 public void GetAssayColumnDescriptionAsync(int AID, HeadingType Heading, int TID, bool TIDSpecified) {
     this.GetAssayColumnDescriptionAsync(AID, Heading, TID, TIDSpecified, null);
 }
コード例 #25
0
 /// <remarks/>
 public void GetAssayColumnDescriptionAsync(int AID, HeadingType Heading, int TID, bool TIDSpecified, object userState) {
     if ((this.GetAssayColumnDescriptionOperationCompleted == null)) {
         this.GetAssayColumnDescriptionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAssayColumnDescriptionOperationCompleted);
     }
     this.InvokeAsync("GetAssayColumnDescription", new object[] {
                 AID,
                 Heading,
                 TID,
                 TIDSpecified}, this.GetAssayColumnDescriptionOperationCompleted, userState);
 }
コード例 #26
0
 public Heading(HeadingType ht, params Union <string, Control, HTMLElement>[] typos) : base(new HTMLHeadingElement(ht), typos)
 {
 }
コード例 #27
0
ファイル: Navigator.cs プロジェクト: rinyun/ffacetools
            /// <summary>
            /// Faces the given heading in the passed HeadingType
            /// </summary>
            /// <param name="PosH">Heading to set on player.</param>
            /// <param name="headingType">HeadingType indicating the type of the value.</param>
            /// <returns>true on success, false otherwise</returns>
            public bool FaceHeading(float PosH, HeadingType headingType)
            {
                if (headingType == HeadingType.Degrees)
                    PosH = DegreesToPosH(PosH);

                if (FFACE.SetNPCPosH(_InstanceID, _FFACE.Player.ID, PosH) != 0.0f)
                    return true;
                return false;
            }
コード例 #28
0
 public HTMLHeadingElement(HeadingType h)
 {
 }
コード例 #29
0
ファイル: Navigator.cs プロジェクト: rinyun/ffacetools
 /// <summary>
 /// Gets heading from player to NPC/PC as selected HeadingType
 /// </summary>
 /// <param name="ID">ID of NPC/PC</param>
 /// <param name="headingType">Heading type for the return value.</param>
 /// <returns>Heading to NPC with matching ID as headingType</returns>
 public float HeadingTo(int ID, HeadingType headingType)
 {
     if (ID > 0)
         return HeadingTo(_FFACE.NPC.PosX(ID), _FFACE.NPC.PosY(ID), _FFACE.NPC.PosZ(ID), headingType);
     else
         throw new IndexOutOfRangeException("NPC ID should be greater than 0 when passing to HeadingTo");
 }
コード例 #30
0
ファイル: ExtensionsHeadings.cs プロジェクト: super-rain/DocX
 public static Paragraph Heading(this Paragraph paragraph, HeadingType headingType)
 {
     string StyleName = headingType.EnumDescription();
     paragraph.StyleName = StyleName;
     return paragraph;
 }
コード例 #31
0
ファイル: Navigator.cs プロジェクト: rinyun/ffacetools
 /// <summary>
 /// Gets heading from player to Position as selected HeadingType
 /// </summary>
 /// <param name="position">Position containing coordinates to get heading to.</param>
 /// <param name="headingType">Heading type for the return value.</param>
 /// <returns>Heading to position as headingType</returns>
 public float HeadingTo(Position position, HeadingType headingType)
 {
     return HeadingTo(position.X, position.Y, position.Z, headingType);
 }
コード例 #32
0
ファイル: Navigator.cs プロジェクト: rinyun/ffacetools
 /// <summary>
 /// Gets heading from player to Position as selected HeadingType
 /// </summary>
 /// <param name="X">X coordinate of Position to get heading to.</param>
 /// <param name="Z">Z coordinate of Position to get heading to.</param>
 /// <param name="headingType">Heading type for the return value.</param>
 /// <returns>Heading to X, Z coords as headingType</returns>
 public float HeadingTo(double X, double Z, HeadingType headingType)
 {
     return HeadingTo(X, 0, Z, headingType);
 }
コード例 #33
0
        private void GetHeadingsFindsHeading(HeadingType headingType)
        {
            const string html = @"
                <h1><a name=""h1""></a>Heading1</h1>
                <p>Heading 1 contents</p>
                <h2><a name=""h2""></a>Heading2</h2>
                <p>Heading 2 contents</p>
                <h3><a name=""h3""></a>Heading3</h3>
                <p>Heading 3 contents</p>
                <h4><a name=""h4""></a>Heading4</h4>
                <p>Heading 4 contents</p>
                <h5><a name=""h5""></a>Heading5</h5>
                <p>Heading 5 contents</p>
                <h6><a name=""h6""></a>Heading6</h6>
                <p>Heading 6 contents</p>
            ";

            var headings = _tableOfContentsService.GetHeadings(html);

            Assert.AreEqual(1, headings.Where(x => x.HeadingType == headingType).Count(), "More than one heading of type found");
        }