This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class suppressionData | |
| { | |
| // ... properties go here ... | |
| public override void Equals(object obj) | |
| { | |
| if (!(obj is suppressionData)) | |
| { | |
| return false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function()%7Bfunction%20callback()%7Binit()%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22https%3A%2F%2Fcdn.rawgit.com%2FCelarix%2Fcd009edde135c196f6a8%2Fraw%2F54297cb3fc7d30220676224e444e7ab61a144ae5%2Frtu_scripts.js%22%3Bif(s.addEventListener)%7Bs.addEventListener(%22load%22%2Ccallback%2Cfalse)%7Delse%20if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string[] names = new string[userlist.Length] // or however Java handles array init and array length, idunnolo | |
| for (int i = 0; i < userlist.Length; i++) | |
| { | |
| names[i] = userlist[i].getNick(); | |
| } | |
| // use names here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class IndexerExample1 | |
| { | |
| int[] array = new int[] { 1, 2, 3 }; | |
| public int this[int index] | |
| { | |
| // like properties, indexers have getters and setters, but the main difference is the index | |
| get | |
| { | |
| return this.array[index]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Returns the cell number for a given position. | |
| /// </summary> | |
| /// <param name="position">The position to return for.</param> | |
| /// <returns>The cell number for the given position.</returns> | |
| public Point GetCellAtPosition(Vector2 position) | |
| { | |
| int x = (int)(position.X / this.CellWidth); | |
| int y = (int)(position.Y / this.CellHeight); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public string[] SeparateCommandLine(string commandLine) | |
| { | |
| commandLine = commandLine.Trim(); // trim the starting and ending spaces/tabs off the line | |
| string[] words = commandLine.Split(' '); // split the string into "words" by spaces | |
| string command = words[0]; // the first "word" is guaranteed to be the command name | |
| // Now, since the values contain spaces, the remainder of the words array is the values. | |
| // For example, the command line "COMMAND_NAME value value value" would, when split into an array, look like | |
| // { "COMMAND_NAME", "value", "value", "value" } | |
| // To get the value back, we need to combine every string in the array except the first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ... | |
| j++; | |
| string searchtext="The Marked for Review status"; | |
| int indexToText =richTextBox3.Find(searchtext); | |
| int endIndex =searchtext.Length; | |
| richTextBox3.Select(indexToText, endIndex); | |
| richTextBox3.SelectedFont = new Font(/* args args args */) | |
| // ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void button1_Click(object sender, EventArgs e) | |
| { | |
| // Put a NumericUpDown control somewhere on the form | |
| int numberOfRandomValues = this.numericUpDown1.Value; | |
| Random random = new Random(); | |
| StringBuilder stringBuilder = new StringBuilder(); | |
| string newLine = Environment.NewLine; | |
| for (int i = 0; i < numberOfRandomValues; i++) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (prio.ShowDialog() == DialogResult.OK) | |
| { | |
| // read the data here | |
| } |