Syntax Highlighting not working properly

Issue So, I’ve been working on a Script Editor in C# in Visual Studio 2013 and of course I want to have syntax highlighting as a feature. I have the following code: programTextBox.Enabled = false; Regex cKeyWords = new Regex(“(auto|break|case|char|const|continue|defaut|double|else|enum|extern|float|for|goto|if|int”

Continue reading

Highlight words in a pdf using itextsharp, not displaying highlighted word in browser

Issue Highlighted words are not displaying in browser using itextsharp. Adobe Browser CODE List<iTextSharp.text.Rectangle> MatchesFound = strategy.GetTextLocations(splitText[i].Trim(), StringComparison.CurrentCultureIgnoreCase); foreach (Rectangle rect in MatchesFound) { float[] quad = { rect.Left – 3.0f, rect.Bottom, rect.Right, rect.Bottom, rect.Left – 3.0f, rect.Top + 1.0f,

Continue reading

C# properties and "tostring" method

Issue I was trying to understand properties better and I came across this page with this example: https://www.tutorialspoint.com/csharp/csharp_properties.htm using System; namespace tutorialspoint { class Student { private string code = "N.A"; private string name = "not known"; private int age

Continue reading

How to print matrix?

Issue public override string ToString() { string matrixView = ""; for (int r=0; r<=this.rows; r++) { for (int c=0; c<=this.columns; c++) { } } return matrixView; } Note: ################################## this.rows = row number this.columns = column number this.matrix= 2-dimensional array

Continue reading

ControlTemplate for ScrollBar apply only to DataGrid

Issue Hello I have a ScrollBar Template as per below – only relevant portion shown: <ControlTemplate x:Key=”VerticalScrollBar” TargetType=”{x:Type ScrollBar}”> <Grid> <Grid.RowDefinitions> <RowDefinition MaxHeight=”18″/> <RowDefinition Height=”0.00001*”/> <RowDefinition MaxHeight=”18″/> </Grid.RowDefinitions> <Rectangle Height=”35″ Width=”19″ Fill=”{StaticResource GreenTeaBrush}” Margin=”-35″ VerticalAlignment=”Top”/> <Border…. Now the Rectangle Portion:

Continue reading

Removing an item from a generic Dictionary?

Issue I have this: public static void Remove<T>(string controlID) where T: new() { Logger.InfoFormat(“Removing control {0}”, controlID); T states = RadControlStates.GetStates<T>(); //Not correct. (states as SerializableDictionary<string, object>).Remove(controlID); RadControlStates.SetStates<T>(states); } states will always be a SerializableDictionary with string keys. The values’

Continue reading

A better way to do replacement tags in c#?

Issue I need a better way to do this: Regex.Replace(Regex.Replace(Regex.Replace(Regex.Replace(Regex.Replace(textMessage.Trim(), “{birthday}”, person.Birthday, RegexOptions.None), “{phone}”, person.MobilePhone, RegexOptions.None), “{email}”, person.Email, RegexOptions.None), “{lastname}”, person.LastName, RegexOptions.None), “{firstname}”, person.FirstName, RegexOptions.None) Solution textMessage.Trim() .Replace(“{birthday}”,person.Birthday) .Replace(“{phone}”,person.Phone) … Answered By – Reza ArabQaeni Answer Checked By – Gilberto

Continue reading