private void SetIndex(int index) { LineIndex = (index + _lines.Length) % _lines.Length; //Tell the recorder where to save files var dir = LineIndex.ToString().PadLeft(4, '0') + " " + _lines[LineIndex]; foreach (var c in System.IO.Path.GetInvalidFileNameChars()) { dir = dir.Replace(c.ToString(), ""); } dir = System.IO.Path.Combine(_root, dir); if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } _recording.SetDirectory(dir); OnPropertyChanged(nameof(LineText)); OnPropertyChanged(nameof(LineIndex)); OnPropertyChanged(nameof(IndexText)); }
public FileScanResult(FileNotification notification, LineIndex[] matchingLines, int totalLines, int endOfTail,int index) { Notification = notification; MatchingLines = matchingLines; TotalLines = totalLines; EndOfTail = endOfTail; Index = index; }
public override string ToString() { return ("Name: " + Name + "|" + "LineIndex: " + LineIndex.ToString() + "|" + "LinesCount: " + Lines.Count.ToString() + "|" + "AttributesCount: " + Attributes.Count.ToString() + "|" + "IntendationLevel: " + IntendationLevel.ToString()); }
public override int GetHashCode() { var hashCode = -702342995; hashCode = hashCode * -1521134295 + Time.GetHashCode(); hashCode = hashCode * -1521134295 + TimeInSeconds.GetHashCode(); hashCode = hashCode * -1521134295 + LineIndex.GetHashCode(); hashCode = hashCode * -1521134295 + LineLayer.GetHashCode(); hashCode = hashCode * -1521134295 + Hand.GetHashCode(); hashCode = hashCode * -1521134295 + CutDirection.GetHashCode(); return(hashCode); }
private void CalculateLineIndexes(int line) { var l = line; int j = line == 0 ? 0 : GetLineIndex(line).Start; var toRemove = LineIndexes.Count - line - 1; if (toRemove > 0) { LineIndexes.RemoveRange(line, toRemove); } int i = j, q = j; while (i < Text.Length - 1) { if (IsNewLine(Text[i])) { LineIndexes.Add(LineIndex.Specify(q, i - q)); l++; if (IsCR(Text[i])) { while (++i < Text.Length - 1 && IsLF(Text[i])) { ; } q = i; continue; } q = i + 1; if (i == Text.Length) { break; } } i++; } if (l == LineIndexes.Count) { LineIndexes.Add(LineIndex.Specify(q, i - q)); } }
public override bool Equals(object obj) { //objがnullか、型が違うときは、等価でない if (obj == null || this.GetType() != obj.GetType()) { return(false); } //この型が継承できないクラスや構造体であれば、次のようにできる //if (!(obj is TestClass)) //Numberで比較する LineIndex c = (LineIndex)obj; return(this.left == c.left && this.right == c.right); }
public GlyphRun GetRenderedLineIndexText(Typeface typeface, double fontSize, double dpiScale, out double runWidth) { if (renderedLineIndex != LineIndex || !typeface.Equals(renderedTypeface) || fontSize != renderedFontSize || dpiScale != renderedDpiScale) { renderedIndexText = TextUtils.CreateGlyphRun(LineIndex == -1 ? "+" : LineIndex.ToString(), typeface, fontSize, dpiScale, 0, out renderedIndexTextWidth); renderedLineIndex = LineIndex; renderedTypeface = typeface; renderedFontSize = fontSize; renderedDpiScale = dpiScale; } runWidth = renderedIndexTextWidth; return(renderedIndexText); }
private string GetDecrypted(LineIndex lineIndex) { string encrypted = null; string decrypted = null; encrypted = ReadLine((int)lineIndex); if (encrypted != null) { //get bytes byte[] encryptedBytes = System.Convert.FromBase64String(encrypted); byte[] encryptionKeyBytes = System.Text.Encoding.UTF8.GetBytes(ENCRYPTION_KEY); byte[] encryptionIVBytes = System.Text.Encoding.UTF8.GetBytes(ENCRYPTION_IV); //decrypt Decrypt objDecrypt = new Decrypt(); decrypted = objDecrypt.DecryptStringFromBytes(encryptedBytes, encryptionKeyBytes, encryptionIVBytes); } return(decrypted); }