system\diagnostics\eventing\eventsource.cs (36)
876descrs[0].Size = ((arg1.Length + 1) * 2);
895descrs[0].Size = ((arg1.Length + 1) * 2);
897descrs[1].Size = ((arg2.Length + 1) * 2);
918descrs[0].Size = ((arg1.Length + 1) * 2);
920descrs[1].Size = ((arg2.Length + 1) * 2);
922descrs[2].Size = ((arg3.Length + 1) * 2);
940descrs[0].Size = ((arg1.Length + 1) * 2);
959descrs[0].Size = ((arg1.Length + 1) * 2);
981descrs[0].Size = ((arg1.Length + 1) * 2);
1003descrs[1].Size = ((arg2.Length + 1) * 2);
1023descrs[1].Size = ((arg2.Length + 1) * 2);
2255data.Size = (uint)(2 * (msgString.Length + 1));
3446string taskName = eventName.Substring(0, eventName.Length - s_ActivityStartSuffix.Length); // Remove the Stop suffix to get the task name
3447if (string.Compare(eventName, 0, taskName, 0, taskName.Length) == 0 &&
3448string.Compare(eventName, taskName.Length, s_ActivityStartSuffix, 0, Math.Max(eventName.Length - taskName.Length, s_ActivityStartSuffix.Length)) == 0)
3466string taskName = eventName.Substring(0, eventName.Length - s_ActivityStopSuffix.Length); // Remove the Stop suffix to get the task name
3468string.Compare(startEventMetadata.Name, 0, taskName, 0, taskName.Length) == 0 &&
3469string.Compare(startEventMetadata.Name, taskName.Length, s_ActivityStartSuffix, 0, Math.Max(startEventMetadata.Name.Length - taskName.Length, s_ActivityStartSuffix.Length)) == 0)
5373if (ed[j].Name != null && ed[j].Name.Length == activityFilterString.Length &&
6581var evtName = key.Substring("event_".Length);
6717if (ret.Length != 0 && keyword.Length != 0)
6789if (i >= eventMessage.Length)
6805else if (i < eventMessage.Length - 1 &&
6819while (i < eventMessage.Length && Char.IsDigit(eventMessage[i]))
6824if (i < eventMessage.Length && eventMessage[i] == '}')
6833if (i < eventMessage.Length && eventMessage[i] == '!')
system\globalization\compareinfo.cs (51)
240if (0 == text.Length) {
247return (InternalIsSortable(c.m_dataHandle, c.m_handleOrigin, c.m_sortName, text, text.Length));
442return InternalCompareString(m_dataHandle, m_handleOrigin, m_sortName, string1, 0, string1.Length, string2, 0, string2.Length, GetNativeCompareFlags(options));
467return Compare(string1, offset1, string1 == null ? 0 : string1.Length-offset1,
468string2, offset2, string2 == null ? 0 : string2.Length-offset2, options);
498if (offset1 > (string1 == null ? 0 : string1.Length) - length1)
502if (offset2 > (string2 == null ? 0 : string2.Length) - length2)
576int prefixLen = prefix.Length;
604source, source.Length, 0, prefix, prefix.Length) > -1);
631int suffixLen = suffix.Length;
655source, source.Length, source.Length - 1, suffix, suffix.Length) >= 0;
684return IndexOf(source, value, 0, source.Length, CompareOptions.None);
694return IndexOf(source, value, 0, source.Length, CompareOptions.None);
704return IndexOf(source, value, 0, source.Length, options);
714return IndexOf(source, value, 0, source.Length, options);
724return IndexOf(source, value, startIndex, source.Length - startIndex, CompareOptions.None);
734return IndexOf(source, value, startIndex, source.Length - startIndex, CompareOptions.None);
744return IndexOf(source, value, startIndex, source.Length - startIndex, options);
754return IndexOf(source, value, startIndex, source.Length - startIndex, options);
778if (startIndex < 0 || startIndex > source.Length)
781if (count < 0 || startIndex > source.Length - count)
814if (startIndex > source.Length)
822if (source.Length == 0)
824if (value.Length == 0)
836if (count < 0 || startIndex > source.Length - count)
854source, count, startIndex, value, value.Length);
878return LastIndexOf(source, value, source.Length - 1,
879source.Length, CompareOptions.None);
890return LastIndexOf(source, value, source.Length - 1,
891source.Length, CompareOptions.None);
902return LastIndexOf(source, value, source.Length - 1,
903source.Length, options);
913return LastIndexOf(source, value, source.Length - 1,
914source.Length, options);
972if (source.Length == 0 && (startIndex == -1 || startIndex == 0))
976if (startIndex < 0 || startIndex > source.Length)
980if (startIndex == source.Length)
1024if (source.Length == 0 && (startIndex == -1 || startIndex == 0))
1025return (value.Length == 0) ? 0 : -1;
1028if (startIndex < 0 || startIndex > source.Length)
1032if (startIndex == source.Length)
1039if (value.Length == 0 && count >= 0 && startIndex - count + 1 >= 0)
1057source, count, startIndex, value, value.Length);
1112int length = InternalGetSortKey(m_dataHandle, m_handleOrigin, m_sortName, flags, source, source.Length, null, 0);
1127length = InternalGetSortKey(m_dataHandle, m_handleOrigin, m_sortName, flags, source, source.Length, keyData, keyData.Length);
1255if(0 == source.Length)
1262return (InternalGetGlobalizedHashCode(m_dataHandle, m_handleOrigin, this.m_sortName, source, source.Length, GetNativeCompareFlags(options), forceRandomizedHashing, additionalEntropy));
system\globalization\culturedata.cs (24)
1267this.SENGLISHLANGUAGE.Substring(0, this.sEnglishLanguage.Length - 1) +
2069for (int j = 0; j < time.Length; j++)
2135for (; index < time.Length; index++)
2825for (int i = start; i < str.Length && i <= end; i++)
2832result = new StringBuilder(str, start, i - start, str.Length);
2838result = new StringBuilder(str, start, i - start, str.Length);
2841if (i < str.Length)
2884for (int i = 0; i < str.Length; i++)
2893if (i + 1 < str.Length && str[i + 1] == '\'')
2898result = new StringBuilder(str, 0, i, str.Length * 2);
2921result = new StringBuilder(str, 0, i, str.Length * 2);
2996} while (index < format.Length && format[index] == cTimePart);
3001if (separatorStart < format.Length)
3020for (int i = startIndex; i < format.Length; ++i)
3030if (i + 1 < format.Length)
3210if (nfi.positiveSign == null || nfi.positiveSign.Length == 0) nfi.positiveSign = "+";
3215if (nfi.currencyDecimalSeparator == null || nfi.currencyDecimalSeparator.Length == 0)
3249StringBuilder sb = new StringBuilder(testString.Length);
3251for (int ich = 0; ich < testString.Length; ich++)
3266if (win32Str == null || win32Str.Length == 0)
3278if (win32Str[win32Str.Length - 1] == '0')
3281values = new int[(win32Str.Length / 2)];
3286values = new int[(win32Str.Length / 2) + 2];
3292for (i = 0, j = 0; i < win32Str.Length && j < values.Length; i += 2, j++)
system\globalization\datetimeformatinfo.cs (19)
742if (eraName.Length == 0) {
754if (m_eraNames[i].Length > 0) {
1262for (int i = 0; !foundZ && i < LongTimePattern.Length; i++) {
2613if (twDtfi.GetEraName(i).Length > 0) {
2670if (str.Length > 0) {
2724} while (i < str.Value.Length && (state != HebrewNumberParsingState.FoundEndOfHebrewNumber));
2774Contract.Assert(str.Index < str.Value.Length, "DateTimeFormatInfo.Tokenize(): start < value.Length");
2812if (((int)value.tokenType & (int)TokenMask) > 0 && value.tokenString.Length <= remaining) {
2813if (String.Compare(str.Value, str.Index, value.tokenString, 0, value.tokenString.Length, this.Culture, CompareOptions.IgnoreCase)==0) {
2817if ((nextCharIndex = str.Index + value.tokenString.Length) < str.len) {
2828str.Advance(value.tokenString.Length);
2889if (str == null || str.Length == 0) {
2896if (Char.IsWhiteSpace(str[0]) || Char.IsWhiteSpace(str[str.Length - 1])) {
2899if (str.Length == 0)
2913if (str.Length >= value.tokenString.Length) {
2916if (String.Compare(str, 0, value.tokenString, 0, value.tokenString.Length, this.Culture, CompareOptions.IgnoreCase) == 0) {
2917if (str.Length > value.tokenString.Length) {
system\globalization\idnmapping.cs (55)
100return GetAscii(unicode, index, unicode.Length - index);
109if (index > unicode.Length)
112if (index > unicode.Length - count)
133Contract.Assert(unicode.Length >= 1, "[IdnMapping.GetAscii]Expected 0 length strings to fail before now.");
134if (unicode[unicode.Length - 1] <= 0x1f)
137Environment.GetResourceString("Argument_InvalidCharSequence", unicode.Length-1 ),
142bool bHasLastDot = (unicode.Length > 0) && IsDot(unicode[unicode.Length - 1]);
147if ((!bHasLastDot) && unicode.Length > 0 && IsDot(unicode[unicode.Length - 1]))
167if (unicode.Length == 0)
173if (unicode[unicode.Length - 1] == 0)
176Environment.GetResourceString("Argument_InvalidCharSequence", unicode.Length - 1),
181int length = IdnToAscii(flags, unicode, unicode.Length, null, 0);
198length = IdnToAscii(flags, unicode, unicode.Length, output, length);
223return GetUnicode(ascii, index, ascii.Length - index);
232if (index > ascii.Length)
235if (index > ascii.Length - count)
271int length = IdnToUnicode(flags, ascii, ascii.Length, null, 0);
287length = IdnToUnicode(flags, ascii, ascii.Length, output, length);
340if (unicode.Length == 0)
348for (int i = 0; i < unicode.Length; i++)
392if (iLastDot == -1 && unicode.Length > M_labelLimit)
397if (unicode.Length > M_defaultNameLimit - (IsDot(unicode[unicode.Length-1])? 0 : 1))
400M_defaultNameLimit - (IsDot(unicode[unicode.Length-1]) ? 0 : 1)),
404if (bUseStd3 && !IsDot(unicode[unicode.Length-1]))
405ValidateStd3(unicode[unicode.Length-1], true);
562if (unicode.Length == 0)
567StringBuilder output = new StringBuilder(unicode.Length);
573while (iNextDot < unicode.Length)
577Contract.Assert(iNextDot <= unicode.Length, "[IdnMapping.punycode_encode]IndexOfAny is broken");
579iNextDot = unicode.Length;
585if (iNextDot != unicode.Length)
667output.Remove(iOutputAfterLastDot, M_strAcePrefix.Length);
672if (unicode.Length - iAfterLastDot >= M_strAcePrefix.Length &&
673unicode.Substring(iAfterLastDot, M_strAcePrefix.Length).Equals(
766if (iNextDot != unicode.Length)
774if (output.Length > M_defaultNameLimit - (IsDot(unicode[unicode.Length-1]) ? 0 : 1))
777M_defaultNameLimit - (IsDot(unicode[unicode.Length-1]) ? 0 : 1)),
810if (ascii.Length == 0)
816if (ascii.Length > M_defaultNameLimit - (IsDot(ascii[ascii.Length-1]) ? 0 : 1))
819M_defaultNameLimit - (IsDot(ascii[ascii.Length-1]) ? 0 : 1)), "ascii");
822StringBuilder output = new StringBuilder(ascii.Length);
829while (iNextDot < ascii.Length)
833if (iNextDot < 0 || iNextDot > ascii.Length)
834iNextDot = ascii.Length;
840if (iNextDot != ascii.Length)
854if (ascii.Length < M_strAcePrefix.Length + iAfterLastDot ||
855!ascii.Substring(iAfterLastDot, M_strAcePrefix.Length).Equals(
876iAfterLastDot += M_strAcePrefix.Length;
1073if (iNextDot != ascii.Length)
system\globalization\textinfo.cs (22)
246return InternalTryFindStringOrdinalIgnoreCase(searchFlags, source, count, startIndex, value, value.Length, ref foundIndex);
257return InternalCompareStringOrdinalIgnoreCase(str1, 0, str2, 0, str1.Length, str2.Length);
267Contract.Assert(strA.Length >= indexA + lengthA, "[TextInfo.CompareOrdinalIgnoreCaseEx] Caller should've validated strA.Length >= indexA + lengthA");
268Contract.Assert(strB.Length >= indexB + lengthB, "[TextInfo.CompareOrdinalIgnoreCaseEx] Caller should've validated strB.Length >= indexB + lengthB");
278Contract.Assert(startIndex + count <= source.Length, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex + count <= source.Length");
281if (source.Length == 0 && value.Length == 0)
300int maxStartIndex = end - value.Length;
305Contract.Assert(end - startIndex >= value.Length);
307if (CompareOrdinalIgnoreCaseEx(source, startIndex, value, 0, value.Length, value.Length) == 0)
324Contract.Assert(startIndex <= source.Length, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex <= source.Length");
327if (value.Length == 0)
343if (value.Length > 0)
345startIndex -= (value.Length - 1);
350if (CompareOrdinalIgnoreCaseEx(source, startIndex, value, 0, value.Length, value.Length) == 0)
717if (str.Length == 0) {
724for (int i = 0; i < str.Length; i++) {
745while (i < str.Length) {
789if (i < str.Length) {
system\runtime\remoting\identity.cs (15)
75if ((uri == null) || (uri.Length <= 1) || (uri[0] != '/'))
83if (uri.Length > guidStr.Length)
88return uri.Substring(guidStr.Length);
96if (uri.Length > guidStr.Length)
101return uri.Substring(guidStr.Length);
110if (uri.Length > (appName.Length + 2))
112if (String.Compare(uri, 1, appName, 0, appName.Length, true, CultureInfo.InvariantCulture) == 0)
115if (uri[appName.Length + 1] == '/')
118return uri.Substring(appName.Length + 2);
136if (s1.Length < prefix.Length)
139return (String.CompareOrdinal(s1, 0, prefix, 0, prefix.Length) == 0);
system\security\util\stringexpressionset.cs (26)
131if (str.Length == 0)
232if (oneString != null && oneString.Length != 0)
242if (temp != null && temp.Length != 0)
592if (right == null || left == null || right.Length == 0 || left.Length == 0 ||
593right.Length > left.Length)
597else if (right.Length == left.Length)
602else if (left.Length - right.Length == 1 && left[left.Length-1] == m_directorySeparator)
604return String.Compare( left, 0, right, 0, right.Length, strComp) == 0;
606else if (right[right.Length-1] == m_directorySeparator)
609return String.Compare( right, 0, left, 0, right.Length, strComp) == 0;
611else if (left[right.Length] == m_directorySeparator)
614return String.Compare( right, 0, left, 0, right.Length, strComp) == 0;
625if (right == null || left == null || right.Length == 0 || left.Length == 0)
629else if (right.Length == left.Length)
638if (right.Length < left.Length)
649if (String.Compare( shortString, 0, longString, 0, shortString.Length, strComp) != 0)
654if (shortString.Length == 3 &&
660return longString[shortString.Length] == m_directorySeparator;
system\string.cs (193)
233jointLength += value[stringToJoinIndex].Length;
238jointLength += (count - 1) * separator.Length;
274int length = Math.Min(strA.Length, strB.Length);
301return strA.Length - strB.Length;
333int length = strIn.Length;
368Contract.Requires(strA.Length == strB.Length);
370int length = strA.Length;
422Contract.Requires(strA.Length == strB.Length, "Lengths of strA and strB must be the same");
423int length = strA.Length;
467int length = Math.Min(strA.Length, strB.Length);
544return strA.Length - strB.Length;
561if (this.Length != str.Length)
580if (this.Length != value.Length)
615if (this.Length != value.Length)
620if (this.Length != value.Length)
647if (a.Length != b.Length)
682if (a.Length != b.Length)
688if (a.Length != b.Length)
738if (count > Length - sourceIndex)
757int length = Length;
775if (startIndex < 0 || startIndex > Length || startIndex > Length - length)
794return (value == null || value.Length == 0);
801for(int i = 0; i < value.Length; i++) {
838return InternalMarvin32HashString(this, this.Length, 0);
844Contract.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'");
857int len = this.Length;
901Contract.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'");
914int len = this.Length;
1023if ((count == 0) || (omitEmptyEntries && this.Length == 0))
1028int[] sepList = new int[Length];
1072if ((count == 0) || (omitEmptyEntries && this.Length ==0)) {
1076int[] sepList = new int[Length];
1077int[] lengthList = new int[Length];
1115for (int i = 0; i < numActualReplaces && currIndex < Length; i++) {
1121if (currIndex < Length && numActualReplaces >= 0) {
1151for(int i=0; i< numReplaces && currIndex < Length; i++) {
1169if (currIndex< Length) {
1196for (int i=0; i < Length && foundCount < sepList.Length; i++) {
1208for (int i=0; i< Length && foundCount < sepListCount; i++) {
1238for (int i=0; i< Length && foundCount < sepListCount; i++) {
1244Int32 currentSepLength = separator.Length;
1245if ( pwzChars[i] == separator[0] && currentSepLength <= Length - i) {
1264return this.Substring (startIndex, Length-startIndex);
1277if (startIndex > Length) {
1285if (startIndex > Length - length) {
1294if( startIndex == 0 && length == this.Length) {
1303Contract.Assert( startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!");
1304Contract.Assert( length >= 0 && startIndex <= this.Length - length, "length is out of range!");
1441Contract.Assert(cbNativeBuffer >= (Length + 1) * Marshal.SystemMaxDBCSCharSize, "Insufficient buffer length passed to ConvertToAnsi");
1457this.Length,
1541if (src.Length > dest.Length - destPos) {
1548wstrcpy(pDest + destPos, pSrc, src.Length);
1902if (strA.Length - indexA < lengthA) {
1903lengthA = (strA.Length - indexA);
1908if (strB.Length - indexB < lengthB) {
1909lengthB = (strB.Length - indexB);
1926if (strA.Length - indexA < lengthA) {
1927lengthA = (strA.Length - indexA);
1932if (strB.Length - indexB < lengthB) {
1933lengthB = (strB.Length - indexB);
1959if (strA.Length - indexA < lengthA) {
1960lengthA = (strA.Length - indexA);
1965if (strB.Length - indexB < lengthB) {
1966lengthB = (strB.Length - indexB);
1993if (strA.Length - indexA < lengthA) {
1994lengthA = (strA.Length - indexA);
1999if (strB.Length - indexB < lengthB) {
2000lengthB = (strB.Length - indexB);
2039if (strA.Length - indexA < 0) {
2044if (strB.Length - indexB < 0) {
2058if (strA.Length - indexA < lengthA) {
2059lengthA = (strA.Length - indexA);
2064if (strB.Length - indexB < lengthB) {
2065lengthB = (strB.Length - indexB);
2203if( value.Length == 0) {
2221return this.Length < value.Length ? false : (nativeCompareOrdinalEx(this, this.Length -value.Length, value, 0, value.Length) == 0);
2224return this.Length < value.Length ? false : (TextInfo.CompareOrdinalIgnoreCaseEx(this, this.Length - value.Length, value, 0, value.Length, value.Length) == 0);
2253int thisLen = this.Length;
2267return IndexOf(value, 0, this.Length);
2272return IndexOf(value, startIndex, this.Length - startIndex);
2286return IndexOfAny(anyOf,0, this.Length);
2291return IndexOfAny(anyOf, startIndex, this.Length - startIndex);
2326if (startIndex < 0 || startIndex > this.Length) {
2330if (count < 0 || count > this.Length - startIndex) {
2340return IndexOf(value, 0, this.Length, comparisonType);
2345return IndexOf(value, startIndex, this.Length - startIndex, comparisonType);
2355if (startIndex < 0 || startIndex > this.Length)
2358if (count < 0 || startIndex > this.Length - count)
2396return LastIndexOf(value, this.Length-1, this.Length);
2419return LastIndexOfAny(anyOf,this.Length-1,this.Length);
2442return LastIndexOf(value, this.Length-1,this.Length, StringComparison.CurrentCulture);
2462return LastIndexOf(value, this.Length-1, this.Length, comparisonType);
2478if (this.Length == 0 && (startIndex == -1 || startIndex == 0))
2479return (value.Length == 0) ? 0 : -1;
2482if (startIndex < 0 || startIndex > this.Length)
2486if (startIndex == this.Length)
2493if (value.Length == 0 && count >= 0 && startIndex - count + 1 >= 0)
2583if( value.Length == 0) {
2601if( this.Length < value.Length) {
2604return (nativeCompareOrdinalEx(this, 0, value, 0, value.Length) == 0);
2607if( this.Length < value.Length) {
2611return (TextInfo.CompareOrdinalIgnoreCaseEx(this, 0, value, 0, value.Length, value.Length) == 0);
2748int end = this.Length-1;
2753for (start=0; start < this.Length; start++) {
2759for (end= Length -1; end >= start; end--) {
2772int end = this.Length-1;
2777for (start=0; start < this.Length; start++) {
2790for (end= Length -1; end >= start; end--) {
2810if (len == this.Length) {
2826if (startIndex < 0 || startIndex > this.Length)
2829Contract.Ensures(Contract.Result<String>().Length == this.Length + value.Length);
2831int oldLength = Length;
2832int insertLength = value.Length;
2866Contract.Ensures(Contract.Result<String>().Length == this.Length);
2918if (count > Length - startIndex)
2922Contract.Ensures(Contract.Result<String>().Length == this.Length - count);
2924int newLength = Length - count;
2949if (startIndex >= Length) {
3022.Acquire(format.Length + args.Length * 8)
3034int length = str.Length;
3135totalLength += sArgs[i].Length;
3189Contract.Ensures(Contract.Result<String>().Length ==
3190(str0 == null ? 0 : str0.Length) +
3191(str1 == null ? 0 : str1.Length));
3205int str0Length = str0.Length;
3207String result = FastAllocateString(str0Length + str1.Length);
3218Contract.Ensures(Contract.Result<String>().Length ==
3219(str0 == null ? 0 : str0.Length) +
3220(str1 == null ? 0 : str1.Length) +
3221(str2 == null ? 0 : str2.Length));
3240int totalLength = str0.Length + str1.Length + str2.Length;
3244FillStringChecked(result, str0.Length, str1);
3245FillStringChecked(result, str0.Length + str1.Length, str2);
3253Contract.Ensures(Contract.Result<String>().Length ==
3254(str0 == null ? 0 : str0.Length) +
3255(str1 == null ? 0 : str1.Length) +
3256(str2 == null ? 0 : str2.Length) +
3257(str3 == null ? 0 : str3.Length));
3280int totalLength = str0.Length + str1.Length + str2.Length + str3.Length;
3284FillStringChecked(result, str0.Length, str1);
3285FillStringChecked(result, str0.Length + str1.Length, str2);
3286FillStringChecked(result, str0.Length + str1.Length + str2.Length, str3);
3297Contract.Assert((currPos <= totalLength - values[i].Length),
3301currPos+=values[i].Length;
3321totalLength += internalValues[i].Length;
3336Contract.Ensures(Contract.Result<String>().Length == str.Length);
3349Contract.Ensures(Contract.Result<String>() == null || Contract.Result<String>().Length == str.Length);
system\text\stringbuilder.cs (29)
112: this(value, 0, ((value != null) ? value.Length : 0), capacity) {
136if (startIndex > value.Length - length) {
215if (persistedMaxCapacity < 1 || persistedString.Length > persistedMaxCapacity) {
222if (persistedCapacity < persistedString.Length) {
223persistedCapacity = persistedString.Length;
229if (persistedCapacity < 0 || persistedCapacity < persistedString.Length || persistedCapacity > persistedMaxCapacity) {
236persistedString.CopyTo(0, m_ChunkChars, 0, persistedString.Length);
237m_ChunkLength = persistedString.Length;
353if ((uint)(chunkLength + chunkOffset) <= ret.Length && (uint)chunkLength <= (uint)sourceArray.Length)
642int valueLen = value.Length;
676Append(valueChars, value.Length);
730if (startIndex > value.Length - count) {
834if (value == null || value.Length == 0 || count == 0) {
840long insertingChars = (long) value.Length * count;
853ReplaceInPlaceAtChunk(ref chunk, ref indexInChunk, valuePtr, value.Length);
1048Insert(index, sourcePtr, value.Length);
1330int len = format.Length;
1471int pad = width - s.Length;
1552if (oldValue.Length == 0)
1560int deltaLength = newValue.Length - oldValue.Length;
1585indexInChunk += oldValue.Length;
1586count -= oldValue.Length;
1601ReplaceAllInChunk(replacements, replacementsCount, chunk, oldValue.Length, newValue);
1603index += ((newValue.Length - oldValue.Length) * replacementsCount);
1738int delta = (value.Length - removeCount) * replacementsCount;
1751ReplaceInPlaceAtChunk(ref targetChunk, ref targetIndexInChunk, valuePtr, value.Length);
1787for (int i = 0; i < value.Length; i++)
Core\CSharp\System\Windows\Media\FormattedText.cs (22)
249_latestPosition = _formatRuns.SetValue(0, _text.Length, runProps, _latestPosition);
316if (startIndex < 0 || startIndex > _text.Length)
321if (count < 0 || limit < startIndex || limit > _text.Length)
339SetForegroundBrush(foregroundBrush, 0, _text.Length);
389SetFontFamily(fontFamily, 0, _text.Length);
412SetFontFamily(fontFamily, 0, _text.Length);
468SetFontSize(emSize, 0, _text.Length);
521SetCulture(culture, 0, _text.Length);
577SetNumberSubstitution(numberSubstitution, 0, _text.Length);
641SetFontWeight(weight, 0, _text.Length);
693SetFontStyle(style, 0, _text.Length);
746SetFontStretch(stretch, 0, _text.Length);
799SetFontTypeface(typeface, 0, _text.Length);
851SetTextDecorations(textDecorations, 0, _text.Length);
1020if (_that._text.Length == 0)
1065if (_textStorePosition + _currentLine.Length < _that._text.Length)
1147Debug.Assert(_that._text.Length > 0 && textSourcePosition + line.Length <= _that._text.Length + 1);
1152Math.Min(textSourcePosition + line.Length - 1, _that._text.Length - 1)
1602return BuildHighlightGeometry(origin, 0, _text.Length);
1774if (_text.Length == 0)
1880if (textSourceCharacterIndex >= _that._text.Length)
src\Framework\System\Windows\Documents\TextFindEngine.cs (18)
125SafeNativeMethods.GetStringTypeEx(0 /* ignored */, SafeNativeMethods.CT_CTYPE1, new char[] { charFindPattern[findPattern.Length - 1] }, 1, findPatternEndCharType1);
221int textBlockLength = Math.Max(TextBlockLength, findPattern.Length * 2 * 2);
243if (!matchDiacritics || findTextLength >= findPattern.Length)
294if (findTextLength > findPattern.Length)
298navigator.MoveByOffset(matchLast ? - findTextPositionMap[findText.Length - findTextLength + findPattern.Length] : findTextPositionMap[findTextLength - findPattern.Length]);
429int searchLength = textString.Length;
439matchLength = findPattern.Length;
459searchLength = textString.Length - searchStart;
484int startIndex = matchLast ? textString.Length - 1 : 0;
485int endIndex = matchLast ? -1 : textString.Length;
536for (int j = i; j < textString.Length; j++)
566for (int j = i; j < textString.Length; j++)
568if (compareInfo.Compare(textString, i, j - i + 1, findPattern, 0, findPattern.Length, options) == 0 &&
595sourceString, sourceString.Length, findString, findString.Length, out found);
804for (int index = 0; index < textString.Length; index++)
843int textLength = textString.Length;
net\System\Net\cookie.cs (42)
196return (Plain || m_domain_implicit || (m_domain.Length == 0))
279return (Plain || m_path_implicit || (m_path.Length == 0))
332if ((host.Length + 1 == domain.Length) &&
333(string.Compare(host, 0, domain, 1, host.Length, StringComparison.OrdinalIgnoreCase) == 0)) {
373if (m_name == null || m_name.Length == 0 || m_name[0] == '$' || m_name.IndexOfAny(Reserved2Name) != -1) {
382(!(m_value.Length > 2 && m_value[0] == '\"' && m_value[m_value.Length-1] == '\"') && m_value.IndexOfAny(Reserved2Value) != -1)) {
390if (Comment != null && !(Comment.Length > 2 && Comment[0] == '\"' && Comment[Comment.Length-1] == '\"')
398if (Path != null && !(Path.Length > 2 && Path[0] == '\"' && Path[Path.Length-1] == '\"')
446else if (domain.IndexOf('.', 1, domain.Length-2) == -1) {
458if (host.Length <= domain.Length ||
459string.Compare(host, host.Length-domain.Length, domain, 0, domain.Length, StringComparison.OrdinalIgnoreCase) != 0) {
465domain.Length != host.Length-host_dot ||
466string.Compare(host, host_dot, domain, 0, domain.Length, StringComparison.OrdinalIgnoreCase) != 0) {
526if (set_default && (m_port_implicit == false && m_port.Length == 0)) {
552if (name == null || name.Length == 0) {
555for(int i=0; i < name.Length; ++i) {
578if ((value == null || value.Length == 0)) {
584if (value[0] != '\"' || value[value.Length-1] != '\"') {
624+ ((m_port.Length == 0) ? string.Empty : (EqualsLiteral + m_port))
765((version.Length == 0)? string.Empty : (version + SeparatorLiteral))
767+ ((path.Length == 0) ? string.Empty : (SeparatorLiteral + path))
768+ ((domain.Length == 0) ? string.Empty : (SeparatorLiteral + domain))
769+ ((port.Length == 0) ? string.Empty : (SeparatorLiteral + port))
779if (m_comment!=null && m_comment.Length>0) {
788if (!m_domain_implicit && m_domain!=null && m_domain.Length>0) {
800if (!m_path_implicit && m_path!=null && m_path.Length>0) {
803if (!Plain && !m_port_implicit && m_port!=null && m_port.Length>0) {
902m_length = tokenStream.Length;
1199if ((Name = Extract()).Length != 0) {
1520bool first = cookie==null || cookie.Name==null || cookie.Name.Length==0;
1604if (value.Length < 2 || value[0] != '\"' || value[value.Length-1] != '\"')
1607return value.Length == 2? string.Empty: value.Substring(1, value.Length-2);
net\System\Net\HttpWebRequest.cs (24)
3109if (value.Length != 0) {
4214if (cacheUri.Fragment.Length != 0)
4693int writeBufferLength = CurrentMethod.Name.Length +
4698offset = Encoding.ASCII.GetBytes(CurrentMethod.Name, 0, CurrentMethod.Name.Length, WriteBuffer, 0);
4788int writeBufferLength = CurrentMethod.Name.Length +
4789scheme.Length +
4791path.Length +
4796offset = Encoding.ASCII.GetBytes(CurrentMethod.Name, 0, CurrentMethod.Name.Length, WriteBuffer, 0);
4798offset += Encoding.ASCII.GetBytes(scheme, 0, scheme.Length, WriteBuffer, offset);
4801offset += Encoding.ASCII.GetBytes(path, 0, path.Length, WriteBuffer, offset);
4853int writeBufferLength = CurrentMethod.Name.Length +
4854scheme.Length +
4855userInfo.Length +
4857path.Length +
4862offset = Encoding.ASCII.GetBytes(CurrentMethod.Name, 0, CurrentMethod.Name.Length, WriteBuffer, 0);
4864offset += Encoding.ASCII.GetBytes(scheme, 0, scheme.Length, WriteBuffer, offset);
4865offset += Encoding.ASCII.GetBytes(userInfo, 0, userInfo.Length, WriteBuffer, offset);
4868offset += Encoding.ASCII.GetBytes(path, 0, path.Length, WriteBuffer, offset);
4894CurrentMethod.Name.Length +
4895pathAndQuery.Length +
4900offset = Encoding.ASCII.GetBytes(CurrentMethod.Name, 0, CurrentMethod.Name.Length, WriteBuffer, 0);
4902offset += Encoding.ASCII.GetBytes(pathAndQuery, 0, pathAndQuery.Length, WriteBuffer, offset);
5109WebHeaderCollection.HeaderEncoding.GetBytes(requestHeadersString, 0, requestHeadersString.Length, WriteBuffer, offset);
6280if ((curRange == null) || (curRange.Length == 0)) {
net\System\Net\mail\Message.cs (12)
343EnvelopeHeaders.InternalSet(xSenderHeader, sender.Encode(xSenderHeader.Length, allowUnicode));
350EnvelopeHeaders.InternalAdd(headerName, address.Encode(headerName.Length, allowUnicode));
353EnvelopeHeaders.InternalAdd(headerName, address.Encode(headerName.Length, allowUnicode));
356EnvelopeHeaders.InternalAdd(headerName, address.Encode(headerName.Length, allowUnicode));
377Headers.InternalAdd(headerName, Sender.Encode(headerName.Length, allowUnicode));
384Headers.InternalAdd(headerName, From.Encode(headerName.Length, allowUnicode));
388Headers.InternalAdd(headerName, To.Encode(headerName.Length, allowUnicode));
396Headers.InternalAdd(headerName, CC.Encode(headerName.Length, allowUnicode));
404Headers.InternalAdd(headerName, ReplyTo.Encode(headerName.Length, allowUnicode));
407Headers.InternalAdd(headerName, ReplyToList.Encode(headerName.Length, allowUnicode));
444headerName.Length));
486headerName.Length);
net\System\Net\WebSockets\WebSocketProtocolComponent.cs (21)
41NameLength = (uint)HttpKnownHeaderNames.Connection.Length,
43ValueLength = (uint)HttpKnownHeaderNames.Upgrade.Length
48NameLength = (uint)HttpKnownHeaderNames.Upgrade.Length,
50ValueLength = (uint)WebSocketHelpers.WebSocketUpgradeToken.Length
161NameLength = (uint)HttpKnownHeaderNames.Connection.Length,
163ValueLength = (uint)HttpKnownHeaderNames.Upgrade.Length
168NameLength = (uint)HttpKnownHeaderNames.Upgrade.Length,
170ValueLength = (uint)WebSocketHelpers.WebSocketUpgradeToken.Length
175NameLength = (uint)HttpKnownHeaderNames.Host.Length,
182NameLength = (uint)HttpKnownHeaderNames.SecWebSocketVersion.Length,
184ValueLength = (uint)s_SupportedVersion.Length
189NameLength = (uint)HttpKnownHeaderNames.SecWebSocketKey.Length,
191ValueLength = (uint)s_DummyWebsocketKeyBase64.Length
482NameLength = (uint)HttpKnownHeaderNames.Connection.Length,
484ValueLength = (uint)HttpKnownHeaderNames.Upgrade.Length
489NameLength = (uint)HttpKnownHeaderNames.Upgrade.Length,
491ValueLength = (uint)WebSocketHelpers.WebSocketUpgradeToken.Length
496NameLength = (uint)HttpKnownHeaderNames.SecWebSocketAccept.Length,
498ValueLength = (uint)acceptValue.Length
805(httpHeader.Name != null && length != httpHeader.Name.Length))
828(httpHeader.Value != null && length != httpHeader.Value.Length))
net\System\URI.cs (114)
254if (m_Syntax.SchemeName.Length > 32)
305for (int i = 0; i < schemeHost.Length; ++i)
560for (int i=0; i < relativeStr.Length; ++i)
577if (CheckSchemeSyntax(sptr, (ushort) scheme.Length, ref syntax) == ParsingError.None) {
580if (i+1 < relativeStr.Length) {
599if (relativeStr.Length == 0) {
656if (uriString.Length != 0)
900if (path.Length == 0) {
906while (current < path.Length) {
909next = path.Length - 1;
1065for (int i = 0; i < str.Length; ++i) {
1082result = new char [host.Length + 3 + m_Info.Offset.Fragment - m_Info.Offset.Path ];
1090UriHelper.UnescapeString(host, 0, host.Length, result, ref count, c_DummyChar, c_DummyChar,
1263} else if (m_Info.Host.Length == 0) {
1273ret = ret.Substring(1, ret.Length - 2);
1284char[] dest = new char[ret.Length];
1286UriHelper.UnescapeString(ret, 0, ret.Length, dest, ref count, c_DummyChar, c_DummyChar,
1357if ((object)name == null || name.Length == 0 || name.Length > short.MaxValue) {
1360int end = name.Length;
1364if (name[0] == '[' && name[name.Length-1] == ']') {
1366if (IPv6AddressHelper.IsValid(fixedName, 1, ref end) && end == name.Length) {
1370end = name.Length;
1371if (IPv4AddressHelper.IsValid(fixedName, 0 , ref end, false, false, false) && end == name.Length) {
1374end = name.Length;
1376if (DomainNameHelper.IsValid(fixedName, 0, ref end, ref dummyBool, false) && end == name.Length) {
1380end = name.Length;
1383&& end == name.Length) {
1389end = name.Length+2;
1393if (IPv6AddressHelper.IsValid(newFixedName, 1, ref end) && end == name.Length) {
1499if ((index < 0) || (index >= pattern.Length)) {
1503&& (pattern.Length - index >= 3)) {
1536if ((pattern.Length - index) < 3) {
1564|| (schemeName.Length == 0)
1568for (int i = schemeName.Length - 1; i > 0; --i) {
1774if (m_String.Length == obj.m_String.Length) {
1780int i = (m_String.Length-1);
1881if (me.Length != she.Length) {
1888char *endMe = pMe + me.Length;
1889char *endShe = pShe + me.Length;
1974char[] dest = UriHelper.EscapeString(rawString, 0, rawString.Length, null, ref position, true, '?', '#', '%');
1987int length = uriString.Length;
2039ushort length = (ushort) m_String.Length;
2247m_Flags |= (Flags)m_String.Length;
2249m_String += m_originalUnicodeString.Substring(idx, m_originalUnicodeString.Length - idx);
2270info.Offset.End = (ushort)m_String.Length;
2300idx = (ushort)m_Syntax.SchemeName.Length;
2396info.Offset.End = (ushort)m_originalUnicodeString.Length;
2489if (host.Length != 0)
2499result = CheckCanonical(pHost, ref idx, (ushort)host.Length, c_DummyChar);
2521char[] dest = UriHelper.EscapeString(host, 0, host.Length, null, ref position, true, '?',
2539for (int i=0 ; i < host.Length; ++i) {
2595if (host.Length == 0) {
2629if (host.Length >= c_MaxUriBufferSize)
2638if (CheckAuthorityHelper(pHost, 0, (ushort)host.Length, ref err, ref flags, m_Syntax, ref newHost) !=
2639(ushort)host.Length)
2654host = CreateHostStringHelper(host, 0, (ushort)host.Length, ref flags, ref m_Info.ScopeId);
2655for (int i=0 ; i < host.Length; ++i) {
2669if ((object)portStr == null || portStr.Length == 0)
2678for (int idx=0; idx < portStr.Length; ++idx)
2781char[] chars = new char[stemp.Length + count + m_Syntax.SchemeName.Length + 3 + 1];
2786m_Syntax.SchemeName.CopyTo(0, chars, count, m_Syntax.SchemeName.Length);
2787count += m_Syntax.SchemeName.Length;
2850if ((parts & UriComponents.Host) != 0 && stemp.Length != 0)
2877hostPtr, 0, stemp.Length, ref allAscii, ref atLeastOneValidIdn);
2885chars = UriHelper.UnescapeString(stemp, 0, stemp.Length, chars, ref count, '/', '?', '#', mode,
2892m_Info.ScopeId.CopyTo(0, chars, count-1, m_Info.ScopeId.Length);
2893count += m_Info.ScopeId.Length;
2914stemp.CopyTo(0, chars, count, stemp.Length);
2915count += stemp.Length;
2923stemp.CopyTo(0, chars, count, stemp.Length);
2924count += stemp.Length;
3095if (m_Info.Offset.Scheme == 0 && m_Info.Offset.End == m_String.Length)
3106if (m_Info.Offset.Scheme == 0 && m_Info.Offset.Fragment == m_String.Length)
3117if (m_Info.Offset.Scheme == 0 && m_Info.Offset.Fragment == m_String.Length)
3199if (m_Info.Offset.Scheme == 0 && m_Info.Offset.End == m_String.Length)
3253ushort length = (ushort)m_String.Length;
3275ushort syntaxLength = (ushort)m_Syntax.SchemeName.Length;
3343m_Info.Offset.Path = (ushort)m_String.Length;
3348FindEndOfComponent(m_originalUnicodeString, ref origIdx, (ushort)m_originalUnicodeString.Length, c_DummyChar);
3351FindEndOfComponent(m_originalUnicodeString, ref origIdx, (ushort)m_originalUnicodeString.Length,
3370if (!ServicePointManager.AllowAllUriEncodingExpansion && m_String.Length > ushort.MaxValue){
3375length = (ushort)m_String.Length;
3473if (origIdx < m_originalUnicodeString.Length && m_originalUnicodeString[origIdx] == '?'){
3475FindEndOfComponent(m_originalUnicodeString, ref origIdx, (ushort)m_originalUnicodeString.Length, ((syntaxFlags &(UriSyntaxFlags.MayHaveFragment)) != 0) ? '#' : c_EOL);
3492if (!ServicePointManager.AllowAllUriEncodingExpansion && m_String.Length > ushort.MaxValue){
3497length = (ushort)m_String.Length;
3530if (origIdx < m_originalUnicodeString.Length && m_originalUnicodeString[origIdx] == '#')
3533FindEndOfComponent(m_originalUnicodeString, ref origIdx, (ushort)m_originalUnicodeString.Length, c_EOL);
3550if (!ServicePointManager.AllowAllUriEncodingExpansion && m_String.Length > ushort.MaxValue){
3555length = (ushort)m_String.Length;
3986if (!ServicePointManager.AllowAllUriEncodingExpansion && newHost.Length > ushort.MaxValue){
5009(relativePart.Length == 1 || (relativePart[1] != '/' && relativePart[1] != '\\')))
5028if(relativePart.Length >= 2 && (relativePart[1] == '\\' || relativePart[1] == '/')) {
5038for (int i = 1; i < share.Length; ++i) {
5072if (relativePart.Length >= 2 && relativePart[1] == '/') {
5099int length = left.Length;
5100char[] path = new char[length + relativePart.Length];
5113relativePart.CopyTo(0, path, length, relativePart.Length);
5127for (;i < relativePart.Length; ++i) {
5135else if (i < relativePart.Length) {
5141length += relativePart.Length;
5207for (i = 0; (i < path1.Length) && (i < path2.Length); ++i) {
5223if ((i == path1.Length) && (i == path2.Length)) {
5229for (; i < path1.Length; ++i) {
5235if (relPath.Length == 0 && path2.Length - 1 == si)
5366char[] dest = new char[path.Length];
5368dest = UriHelper.UnescapeString(path, 0, path.Length, dest, ref count, c_DummyChar, c_DummyChar,
5384char[] dest = UriHelper.EscapeString(str, 0, str.Length, null, ref destStart, true, '?', '#', '%');
net\System\UriExt.cs (30)
67(uriKind == UriKind.Relative || (m_String.Length >= 2 && (m_String[0] != '\\' || m_String[1] != '\\'))))
238m_String = EscapeUnescapeIri(m_originalUnicodeString, 0, m_originalUnicodeString.Length,
265int length = data.Length;
292char[] chars = new char[data.Length];
295chars = UriHelper.UnescapeString(data, 0, data.Length, chars, ref count, c_DummyChar, c_DummyChar,
313for (int i = 0; i < data.Length - 2; ++i)
497return (CheckCanonical(str, ref idx, (ushort)m_String.Length, c_EOL)
526idx = (ushort)(m_Info.Offset.Scheme + m_Syntax.SchemeName.Length + 2);
582idx = (ushort)m_Syntax.SchemeName.Length;
584if (idx + 1 >= m_String.Length || str[idx] != '/' || str[idx + 1] != '/')
603if (stringToUnescape.Length == 0)
610for (position = 0; position < stringToUnescape.Length; ++position)
614if (position == stringToUnescape.Length)
619char[] dest = new char[stringToUnescape.Length];
620dest = UriHelper.UnescapeString(stringToUnescape, 0, stringToUnescape.Length, dest, ref position,
636if (stringToEscape.Length == 0)
640char[] dest = UriHelper.EscapeString(stringToEscape, 0, stringToEscape.Length, null, ref position, true,
655if (stringToEscape.Length == 0)
659char[] dest = UriHelper.EscapeString(stringToEscape, 0, stringToEscape.Length, null, ref position, false,
763if (relativeStr.Length > 0 && (IsLWS(relativeStr[0]) || IsLWS(relativeStr[relativeStr.Length - 1])))
766if (relativeStr.Length == 0)
790if (relativeStr.Length >= 3
836if (m_String.Length == 0)
839char[] dest = UriHelper.EscapeString(m_String, 0, m_String.Length, null, ref position, true,
851if (m_String.Length == 0)
854char[] dest = new char[m_String.Length];
856dest = UriHelper.UnescapeString(m_String, 0, m_String.Length, dest, ref position, c_DummyChar,
985return UriHelper.TestForSubPath(pMe, (ushort)me.Length, pShe, (ushort)she.Length,
regex\system\text\regularexpressions\Regex.cs (15)
698for (int i = 0; i < name.Length; i++) {
767return IsMatch(input, UseOptionR() ? input.Length : 0);
786return (null == Run(true, -1, input, 0, input.Length, startat));
841return Match(input, UseOptionR() ? input.Length : 0);
856return Run(false, -1, input, 0, input.Length, startat);
928return Matches(input, UseOptionR() ? input.Length : 0);
946return new MatchCollection(this, input, 0, input.Length, startat);
1001return Replace(input, replacement, -1, UseOptionR() ? input.Length : 0);
1018return Replace(input, replacement, count, UseOptionR() ? input.Length : 0);
1101return Replace(input, evaluator, -1, UseOptionR() ? input.Length : 0);
1119return Replace(input, evaluator, count, UseOptionR() ? input.Length : 0);
1189return Split(input, 0, UseOptionR() ? input.Length : 0);
1206return RegexReplacement.Split(this, input, count, UseOptionR() ? input.Length : 0);
1290if (startat < 0 || startat > input.Length)
1293if (length < 0 || length > input.Length)
security\system\security\cryptography\x509\x509utils.cs (10)
230return DiscardWhiteSpaces(inputBuffer, 0, inputBuffer.Length);
248uint cbHex = (uint) hexString.Length / 2;
316byte[] arr = new byte[s.Length + 1];
317Encoding.ASCII.GetBytes(s, 0, s.Length, arr, 0);
327byte[] arr = new byte[2 * (s.Length + 1)];
328Encoding.Unicode.GetBytes(s, 0, s.Length, arr, 0);
394if (keyValue.Length == 0)
455int len = keyValue.Length;
505oidSize += (oidStr.Length + 1);
514pOid = new IntPtr((long)pOid + oidStrs[index].Length + 1);
services\monitoring\system\diagnosticts\EventLog.cs (22)
403if (logName == null || logName.Length==0)
407if (source == null || source.Length==0)
409if (source.Length + EventLogKey.Length > 254)
410throw new ArgumentException(SR.GetString(SR.ParameterTooLong, "source", 254 - EventLogKey.Length));
463if (logKey == null && logName.Length >= 8) {
594if (logName == null || logName.Length==0)
725if ( string.Compare(keyname, index+1, source, 0, keyname.Length - index, StringComparison.Ordinal) == 0 )
806if (logName == null || logName.Length==0)
846if ( currentLogName.Length >= 8 &&
871if (source != null && source.Length != 0) {
1187if (logName.Length > 8)
1242for (int i = 0; i < formatString.Length; i++) {
1245if(formatString.Length > i + 1) {
1247while (i + 1 < formatString.Length && Char.IsDigit(formatString[i + 1])) {
1335if (msg.Length > 1 && msg[msg.Length-1] == '\n')
1336msg = msg.Substring(0, msg.Length-2);
1358if (logName.Length == 0 && !ignoreEmpty)
1494if (source.Length + EventLogKey.Length > 254)
1495throw new ArgumentException(SR.GetString(SR.ParameterTooLong, "source", 254 - EventLogKey.Length));
fx\src\data\Microsoft\SqlServer\Server\ValueUtilsSmi.cs (7)
181return value.Length;
183length = CheckXetParameters( metaData.SqlDbType, metaData.MaxLength * sizeof(char), value.Length,
2678int length = CheckXetParameters(metaData.SqlDbType, metaData.MaxLength, value.Length, 0, NoLengthLimit /* buffer */, offset, NoLengthLimit /* request */);
2704int length = CheckXetParameters( metaData.SqlDbType, metaData.MaxLength, NoLengthLimit /* actual */, 0, stringValue.Length, offset, stringValue.Length - offset );
2711int length = CheckXetParameters( metaData.SqlDbType, metaData.MaxLength, NoLengthLimit /* actual */, 0, value.Length, offset, checked( value.Length - offset ) );
fx\src\data\System\Data\SqlClient\SqlCommand.cs (21)
2620if ((null != part) && (2 <= part.Length)) {
2621if ('[' == part[0] && ']' == part[part.Length-1]) {
2622part = part.Substring(1, part.Length-2); // strip outer '[' & ']'
2638if (Char.IsDigit(sproc[sproc.Length-1])) { // If last char is a digit, parse.
3696SqlParameter sqlParam = new SqlParameter(null, ((queryText.Length << 1) <= TdsEnums.TYPE_SIZE_LIMIT) ? SqlDbType.NVarChar : SqlDbType.NText, queryText.Length);
3790sqlParam = new SqlParameter(null, ((parameterList.Length << 1) <= TdsEnums.TYPE_SIZE_LIMIT) ? SqlDbType.NVarChar : SqlDbType.NText, parameterList.Length);
5492sqlParam = new SqlParameter(null, ((paramList.Length<<1)<=TdsEnums.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, paramList.Length);
5498sqlParam = new SqlParameter(null, ((text.Length<<1)<=TdsEnums.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, text.Length);
5640sqlParam = new SqlParameter(null, ((commandText.Length<<1)<=TdsEnums.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, commandText.Length);
5646sqlParam = new SqlParameter(null, ((paramList.Length<<1)<=TdsEnums.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, paramList.Length);
5887if (null != strings[i] && 0 != strings[i].Length) {
5968sqlParam = new SqlParameter(null, ((paramList.Length<<1)<=TdsEnums.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, paramList.Length);
5974sqlParam = new SqlParameter(null, ((text.Length<<1)<=TdsEnums.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, text.Length);
fx\src\data\System\Data\SqlClient\TdsParser.cs (82)
1395Debug.Assert(errorMessage.Length>iColon+1 && errorMessage[iColon+1]==' ', "Expecting a space after the ':' character");
1399int len = errorMessage.Length;
2406Debug.Assert(env.newValue.Length > TdsEnums.CHARSET_CODE_PAGE_OFFSET, "TdsParser.ProcessEnvChange(): charset value received with length <=10");
4429stateObj.WriteByte((byte)database.Length);
4438stateObj.WriteByte((byte)schema.Length);
4447stateObj.WriteByte((byte)type.Length);
6050length = s.Length;
6074length = s.Length * 2;
6532stateObj.WriteByte(checked((byte)s.Length));
6542WriteShort(checked((short)s.Length), stateObj);
6551return WriteString(s, s.Length, 0, stateObj, canAccumulate);
6647if (checked(sourceOffset + charLength) > source.Length || sourceOffset < 0) {
6670return WriteEncodingChar(s, s.Length, 0, encoding, stateObj, canAccumulate);
7111Debug.Assert(TdsEnums.MAXLEN_HOSTNAME>=rec.hostName.Length, "_workstationId.Length exceeds the max length for this value");
7118Debug.Assert(rec.userName == null || (rec.userName != null && TdsEnums.MAXLEN_USERNAME >= rec.userName.Length), "_userID.Length exceeds the max length for this value");
7119Debug.Assert(rec.credential == null || (rec.credential != null && TdsEnums.MAXLEN_USERNAME >= rec.credential.UserId.Length), "_credential.UserId.Length exceeds the max length for this value");
7121Debug.Assert(rec.password == null || (rec.password != null && TdsEnums.MAXLEN_PASSWORD>=rec.password.Length), "_password.Length exceeds the max length for this value");
7126Debug.Assert(TdsEnums.MAXLEN_APPNAME>=rec.applicationName.Length, "_applicationName.Length exceeds the max length for this value");
7127Debug.Assert(TdsEnums.MAXLEN_SERVERNAME>=rec.serverName.Length, "_dataSource.Length exceeds the max length for this value");
7128Debug.Assert(TdsEnums.MAXLEN_LANGUAGE>=rec.language.Length, "_currentLanguage .Length exceeds the max length for this value");
7129Debug.Assert(TdsEnums.MAXLEN_DATABASE>=rec.database.Length, "_initialCatalog.Length exceeds the max length for this value");
7130Debug.Assert(TdsEnums.MAXLEN_ATTACHDBFILE>=rec.attachDBFilename.Length, "_attachDBFileName.Length exceeds the max length for this value");
7171Debug.Assert(TdsEnums.MAXLEN_CLIENTINTERFACE >= clientInterfaceName.Length, "cchCltIntName can specify at most 128 unicode characters. See Tds spec");
7176length += (rec.hostName.Length + rec.applicationName.Length +
7177rec.serverName.Length + clientInterfaceName.Length +
7178rec.language.Length + rec.database.Length +
7179rec.attachDBFilename.Length) * 2;
7192length += (userName.Length * 2) + encryptedPasswordLengthInBytes
7332WriteShort(rec.hostName.Length, _physicalStateObj);
7333offset += rec.hostName.Length * 2;
7339WriteShort(userName.Length, _physicalStateObj);
7340offset += userName.Length * 2;
7356WriteShort(rec.applicationName.Length, _physicalStateObj);
7357offset += rec.applicationName.Length * 2;
7360WriteShort(rec.serverName.Length, _physicalStateObj);
7361offset += rec.serverName.Length * 2;
7373WriteShort(clientInterfaceName.Length, _physicalStateObj);
7374offset += clientInterfaceName.Length * 2;
7377WriteShort(rec.language.Length, _physicalStateObj);
7378offset += rec.language.Length * 2;
7381WriteShort(rec.database.Length, _physicalStateObj);
7382offset += rec.database.Length * 2;
7401WriteShort(rec.attachDBFilename.Length, _physicalStateObj);
7402offset += rec.attachDBFilename.Length * 2;
7796stateObj.WriteByte((byte)(transactionName.Length * 2)); // Write number of bytes (unicode string).
7808Debug.Assert(transactionName.Length == 0, "Should not have a transaction name on Commit");
7820stateObj.WriteByte((byte)(transactionName.Length * 2)); // Write number of bytes (unicode string).
7832stateObj.WriteByte((byte)(transactionName.Length * 2)); // Write number of bytes (unicode string).
7992WriteString(text, text.Length, 0, stateObj);
8113tempLen = rpcext.rpcName.Length;
8399if (!ADP.IsEmpty(names[0]) && TdsEnums.MAX_SERVERNAME < names[0].Length) {
8402if (!ADP.IsEmpty(names[1]) && TdsEnums.MAX_SERVERNAME < names[names.Length - 2].Length) {
8405if (TdsEnums.MAX_SERVERNAME < names[2].Length) {
8470tempLen = (param.XmlSchemaCollectionDatabase).Length;
8479tempLen = (param.XmlSchemaCollectionOwningSchema).Length;
8487tempLen = (param.XmlSchemaCollectionName).Length;
8748Debug.Assert(parameterName.Length <= 0xff, "parameter name can only be 255 bytes, shouldn't get to TdsParser!");
8749int tempLen = parameterName.Length & 0xff;
9274Debug.Assert (md.cipherMD.CipherAlgorithmName.Length < 256);
9275stateObj.WriteByte((byte)md.cipherMD.CipherAlgorithmName.Length);
9364WriteShort(md.tableName.Length, stateObj);
9370stateObj.WriteByte((byte)md.column.Length);
9447actualLengthInBytes = ((isSqlType) ? ((SqlString)value).Value.Length : ((string)value).Length) * 2;
9557ccb = stringValue.Length;
9563ccb = ((isSqlType) ? ((SqlString)value).Value.Length : ((string)value).Length) * 2;
9570ccb = ((isSqlType) ? ((SqlString)value).Value.Length : ((string)value).Length) * 2;
9693else if (UInt16.MaxValue < callbackId.Length) {
9700else if (UInt16.MaxValue < service.Length) {
9717int headerLength = 4 + 2 + 2 + (callbackId.Length * 2) + 2 + (service.Length * 2);
9741Debug.Assert(UInt16.MaxValue >= callbackId.Length, "CallbackId length is out of range");
9743Debug.Assert(UInt16.MaxValue >= service.Length, "Service length is out of range");
9751WriteShort(callbackId.Length * 2, stateObj); // Length in bytes
9754WriteShort(service.Length * 2, stateObj); // Length in bytes
9904if (!((SqlString)value).IsNull && ((((SqlString)value).Value).Length > 0)) {
9909else if ((currentType == typeof(String)) && (((String)value).Length > 0)) {
System\Xml\Xsl\Runtime\XmlQueryOutput.cs (18)
153Debug.Assert(prefix != null && localName != null && localName.Length != 0 && ns != null, "Invalid argument");
211if (prefix.Length == 5 && prefix == "xmlns") {
223if (ns.Length != 0 && this.depth != 0)
496Debug.Assert(prefix.Length == 0 || ns.Length != 0);
506if (ns.Length == 0 && prefix.Length == 0)
658throw new XslTransformException(Res.XmlIl_NmspConflict, new string[] { prefix.Length == 0 ? "" : ":", prefix, ns, nsExisting });
1108if (navigator.NamespaceURI.Length == 0) {
1109Debug.Assert(navigator.LocalName.Length != 0, "xmlns:foo='' isn't allowed");
1225Debug.Assert(prefix.Length != 0 && ns.Length != 0);
1268Debug.Assert(prefix != null && ns != null && ns.Length != 0);
1282if (isElemPrefix || genPrefix.Length != 0)
1290if (isElemPrefix || genPrefix.Length != 0)
1367Debug.Assert(ValidateNames.ParseNCName(name.Name, 0) == name.Name.Length);
1370prefix = (name.Namespace.Length != 0) ? RemapPrefix(string.Empty, name.Namespace, nodeType == XPathNodeType.Element) : string.Empty;
1387prefix = (ns.Length != 0) ? RemapPrefix(string.Empty, ns, nodeType == XPathNodeType.Element) : string.Empty;
System\Xml\Xsl\XsltOld\RecordBuilder.cs (9)
533for (; index < comment.Length; index ++) {
538newComment = new StringBuilder(comment, begin, index, 2 * comment.Length);
554if (begin < comment.Length)
555newComment.Append(comment, begin, comment.Length - begin);
576for (; index < pi.Length; index ++) {
584newPI = new StringBuilder(pi, begin, index, 2 * pi.Length);
601if (begin < pi.Length) {
602newPI.Append(pi, begin, pi.Length - begin);
665Debug.Assert(prefix != null && prefix.Length > 0);
System\ServiceModel\Description\ServiceMetadataExtension.cs (9)
992int start = (q.Length > 0 && q[0] == '?') ? 1 : 0;
993if (String.Compare(q, start, WsdlQueryString, 0, WsdlQueryString.Length, StringComparison.OrdinalIgnoreCase) == 0)
995else if (String.Compare(q, start, XsdQueryString, 0, XsdQueryString.Length, StringComparison.OrdinalIgnoreCase) == 0)
997else if (String.Compare(q, start, SingleWsdlQueryString, 0, SingleWsdlQueryString.Length, StringComparison.OrdinalIgnoreCase) == 0)
999else if (String.Compare(q, start, HealthQueryString, 0, HealthQueryString.Length, StringComparison.OrdinalIgnoreCase) == 0)
1001else if (parent.HelpPageEnabled && (String.Compare(q, start, DiscoQueryString, 0, DiscoQueryString.Length, StringComparison.OrdinalIgnoreCase) == 0))
1011if (queryString.Length > maxQueryStringChars)
1017string[] queries = queryString.Length > 0 ? queryString.Split('&') : NoQueries;
1413while (ci.Name.Length > 0)
System\ServiceModel\Diagnostics\EndpointPerformanceCountersBase.cs (9)
88int length = service.Length + contract.Length + uri.Length + 2;
95length, service.Length, contract.Length, uri.Length);
101service = GetHashedString(service, count - hashLength, service.Length - count + hashLength, true);
108contract = GetHashedString(contract, count - hashLength, contract.Length - count + hashLength, true);
115uri = GetHashedString(uri, 0, uri.Length - count + hashLength, false);
System\ServiceModel\Diagnostics\OperationPerformanceCountersBase.cs (12)
84int length = service.Length + contract.Length + operation.Length + uri.Length + 3;
91length, service.Length, contract.Length, operation.Length, uri.Length);
97service = GetHashedString(service, count - hashLength, service.Length - count + hashLength, true);
104contract = GetHashedString(contract, count - hashLength, contract.Length - count + hashLength, true);
111operation = GetHashedString(operation, count - hashLength, operation.Length - count + hashLength, true);
118uri = GetHashedString(uri, 0, uri.Length - count + hashLength, false);
CachedPathData.cs (16)
159s_appConfigPathLength = (HostingEnvironment.IsHosted) ? HostingEnvironment.AppConfigPath.Length : WebConfigurationHost.RootWebConfigPath.Length;
162return (configPath.Length > s_appConfigPathLength);
515if (configRecord.ConfigPath.Length == _configPath.Length) {
553if (_physicalPath.Length == physicalPath.Length) {
555if (0 == String.Compare(_physicalPath, 0, physicalPath, 0, physicalPath.Length, StringComparison.OrdinalIgnoreCase)) {
559else if (_physicalPath.Length - physicalPath.Length == 1) {
561if (_physicalPath[_physicalPath.Length-1] == System.IO.Path.DirectorySeparatorChar
562&& (0 == String.Compare(_physicalPath, 0, physicalPath, 0, physicalPath.Length, StringComparison.OrdinalIgnoreCase))) {
566else if (physicalPath.Length - _physicalPath.Length == 1) {
568if (physicalPath[physicalPath.Length-1] == System.IO.Path.DirectorySeparatorChar
569&& (0 == String.Compare(_physicalPath, 0, physicalPath, 0, _physicalPath.Length, StringComparison.OrdinalIgnoreCase))) {
Configuration\MachineKeySection.cs (16)
339strKey = strKey.Substring(0, strKey.Length - ",IsolateByAppId".Length);
344strKey = strKey.Substring(0, strKey.Length - ",IsolateApps".Length);
361if (strKey.Length < 40 || (strKey.Length & 0x1) == 1)
362throw new ConfigurationErrorsException(SR.GetString(SR.Unable_to_get_cookie_authentication_validation_key, strKey.Length.ToString(CultureInfo.InvariantCulture)), ElementInformation.Properties["validationKey"].Source, ElementInformation.Properties["validationKey"].LineNumber);
391strKey = strKey.Substring(0, strKey.Length - ",IsolateByAppId".Length);
396strKey = strKey.Substring(0, strKey.Length - ",IsolateApps".Length);
417if ((strKey.Length & 1) != 0)
973if (((uint)str.Length & 0x1) == 0x1) // must be 2 nibbles per byte
1000byte[] result = new byte[str.Length / 2];
1100_CustomValidationName = _CustomValidationName.Substring(ALGO_PREFIX.Length);
1185s_oSymAlgoDecryption = SymmetricAlgorithm.Create(Decryption.Substring(ALGO_PREFIX.Length));
Security\FormsAuthentication.cs (15)
136if (String.IsNullOrEmpty(encryptedTicket) || encryptedTicket.Length > MAX_TICKET_LENGTH)
141if ((encryptedTicket.Length % 2) == 0) { // Could be a hex string
486if (strCookiePath == null || strCookiePath.Length < 1)
503if (strTicket == null || strTicket.Length < 1)
703if (_LoginUrl.Length == 0 || (_LoginUrl[0] != '/' && _LoginUrl.IndexOf("//", StringComparison.Ordinal) < 0))
716if (_DefaultUrl.Length == 0 || (_DefaultUrl[0] != '/' && _DefaultUrl.IndexOf("//", StringComparison.Ordinal) < 0))
744if (pos < loginUrl.Length -1)
877RemoveQSVar(ref strUrl, posQ, token, amp, amp.Length);
880RemoveQSVar(ref strUrl, posQ, token, amp, question.Length);
887RemoveQSVar(ref strUrl, posQ, token, amp, amp.Length);
890RemoveQSVar(ref strUrl, posQ, token, amp, question.Length);
900int end = strUrl.IndexOf(sep, pos + token.Length, StringComparison.Ordinal) + sep.Length;
901if (end < sep.Length || end >= strUrl.Length)
UI\WebControls\Calendar.cs (7)
870if (titleStyle.CssClass.Length > 0) {
873else if (CssClass.Length > 0) {
1163if (String.Compare(eventArgument, 0, NAVIGATE_MONTH_COMMAND, 0, NAVIGATE_MONTH_COMMAND.Length, StringComparison.Ordinal) == 0) {
1170int newDateDiff = Int32.Parse(eventArgument.Substring(NAVIGATE_MONTH_COMMAND.Length), CultureInfo.InvariantCulture);
1181else if (String.Compare(eventArgument, 0, SELECT_RANGE_COMMAND, 0, SELECT_RANGE_COMMAND.Length, StringComparison.Ordinal) == 0) {
1185int rangeValue = Int32.Parse(eventArgument.Substring(SELECT_RANGE_COMMAND.Length), CultureInfo.InvariantCulture);
1292if (caption.Length > 0) {
Util\StringUtil.cs (25)
41if (trimmedValue.Length == 0) {
46if (lengthToCheck > -1 && trimmedValue.Length > lengthToCheck) {
73if ((s1 == null ? 0 : s1.Length) - offset1 < length)
75if ((s2 == null ? 0 : s2.Length) - offset2 < length)
98if(s2.Length != s1.Length) {
101return 0 == string.Compare(s1, 0, s2, 0, s2.Length, StringComparison.OrdinalIgnoreCase);
124int len = s.Length;
133int offset = s1.Length - s2.Length;
140int c = s2.Length;
155int offset = s1.Length - s2.Length;
160return 0 == string.Compare(s1, offset, s2, 0, s2.Length, StringComparison.OrdinalIgnoreCase);
168return s.Length != 0 && (s[0] == c);
176if (s2.Length > s1.Length) {
182int c = s2.Length;
201if (s2.Length > s1.Length) {
205return 0 == string.Compare(s1, 0, s2, 0, s2.Length, StringComparison.OrdinalIgnoreCase);
216Debug.Assert(srcIndex + len <= src.Length, "src");
265int len = s.Length;
328bytes = new byte[enc.GetMaxByteCount(s.Length) + 1];
329return enc.GetBytes(s, 0, s.Length, bytes, 0);
misc\GDI\UnsafeNativeMethods.cs (11)
387int byteCount = IntUnsafeNativeMethods.WideCharToMultiByte( IntNativeMethods.CP_ACP, 0, text, text.Length, null, 0, IntPtr.Zero, IntPtr.Zero );
389IntUnsafeNativeMethods.WideCharToMultiByte( IntNativeMethods.CP_ACP, 0, text, text.Length, textBytes, textBytes.Length, IntPtr.Zero, IntPtr.Zero );
397retVal = DrawTextW( hDC, text, text.Length, ref lpRect, nFormat );
426int byteCount = IntUnsafeNativeMethods.WideCharToMultiByte(IntNativeMethods.CP_ACP, 0, text, text.Length, null, 0, IntPtr.Zero, IntPtr.Zero);
428IntUnsafeNativeMethods.WideCharToMultiByte(IntNativeMethods.CP_ACP, 0, text, text.Length, textBytes, textBytes.Length, IntPtr.Zero, IntPtr.Zero);
436retVal = DrawTextExW( hDC, text, text.Length, ref lpRect, nFormat, lpDTParams );
456int byteCount = text.Length;
461byteCount = IntUnsafeNativeMethods.WideCharToMultiByte(IntNativeMethods.CP_ACP, 0, text, text.Length, null, 0, IntPtr.Zero, IntPtr.Zero);
463IntUnsafeNativeMethods.WideCharToMultiByte(IntNativeMethods.CP_ACP, 0, text, text.Length, textBytes, textBytes.Length, IntPtr.Zero, IntPtr.Zero);
466byteCount = Math.Min( text.Length, IntNativeMethods.MaxTextLengthInWin9x);
471retVal = GetTextExtentPoint32W(hDC, text, text.Length, size);
winforms\Managed\System\WinForms\Control.cs (21)
1253return accName != null && accName.Length > 0;
4557if (value.Length == 0) {
7698if (pos + 1 >= text.Length)
7701if (pos <= 0 || pos >= text.Length)
7864m.Result = (IntPtr)((value.Length + 1) * Marshal.SystemDefaultCharSize);
7868if (unchecked((int)(long)m.WParam) < value.Length + 1) {
8791if (text != null && text.Length != 0) {
8894if (text != null && text.Length == 0) text = null;
10605int bytesNeeded = UnsafeNativeMethods.WideCharToMultiByte(0 /*CP_ACP*/, 0, keyChar, keyChar.Length, null, 0, IntPtr.Zero, IntPtr.Zero);
10610UnsafeNativeMethods.WideCharToMultiByte(0 /*CP_ACP*/, 0, keyChar, keyChar.Length, mbcsBytes, mbcsBytes.Length, IntPtr.Zero, IntPtr.Zero);
10629keyChar.Length,
12469return Text.Length != 0;
16774StringBuilder sb = new StringBuilder(text.Length);
16775for (int i=0; i<text.Length; i++) {
16995int len = streamName.Length;
20153if (companyName == null || companyName.Length == 0) {
20160if (companyName == null || companyName.Length == 0) {
20195if (productName == null || productName.Length == 0) {
20202if (productName == null || productName.Length == 0) {
20240if (productVersion == null || productVersion.Length == 0) {
20249if (productVersion == null || productVersion.Length == 0) {
winforms\Managed\System\WinForms\DataObject.cs (7)
1001sizeInBytes += (files[i].Length + 1) * 2;
1042UnsafeNativeMethods.CopyMemoryW(currentPtr, files[i], files[i].Length*2);
1043currentPtr = (IntPtr)((long)currentPtr + (files[i].Length * 2));
1081int byteSize = (str.Length*2 + 2);
1095char[] chars = str.ToCharArray(0, str.Length);
1103int pinvokeSize = UnsafeNativeMethods.WideCharToMultiByte(0 /*CP_ACP*/, 0, str, str.Length, null, 0, IntPtr.Zero, IntPtr.Zero);
1106UnsafeNativeMethods.WideCharToMultiByte(0 /*CP_ACP*/, 0, str, str.Length, strBytes, strBytes.Length, IntPtr.Zero, IntPtr.Zero);
winforms\Managed\System\WinForms\VisualStyles\VisualStyleRenderer.cs (3)
497lastHResult = SafeNativeMethods.DrawThemeText( new HandleRef( this, Handle ), hdc, part, state, textToDraw, textToDraw.Length, (int) flags, disableFlag, new NativeMethods.COMRECT( bounds ) );
878lastHResult = SafeNativeMethods.GetThemeTextExtent( new HandleRef( this, Handle ), hdc, part, state, textToDraw, textToDraw.Length, (int) flags, null, rect );
903lastHResult = SafeNativeMethods.GetThemeTextExtent( new HandleRef( this, Handle ), hdc, part, state, textToDraw, textToDraw.Length, (int) flags, new NativeMethods.COMRECT( bounds ), rect );
System\Xml\Core\XmlTextReaderImpl.cs (37)
501if ( url == null || url.Length == 0 ) {
537if ( context == null || context.BaseURI == null || context.BaseURI.Length == 0 ) {
600if ( url.Length == 0 ) {
630if ( context.BaseURI != null && context.BaseURI.Length > 0 &&
632if ( baseUriStr.Length > 0 ) {
715if ( context.BaseURI != null && context.BaseURI.Length > 0 &&
717if ( baseUriStr.Length > 0 ) {
2205if ( ps.baseUriStr.Length > 0 && ps.baseUri == null && xmlResolver != null ) {
2392Debug.Assert( ( systemId != null && systemId.Length > 0 ) || ( publicId != null && publicId.Length > 0 ) );
2423RegisterConsumedCharacters(internalDtd.Length, false);
2720int len = str.Length;
2722str.CopyTo( 0, ps.chars, 0, str.Length );
2816Debug.Assert( url != null && url.Length > 0 );
3984if ( prefixLen == lastPrefix.Length && XmlConvert.StrEqual( chars, startPos, prefixLen, lastPrefix ) ) {
4109string qname = ( prefix.Length == 0 ) ? defaultAttributeInfo.LocalName : ( prefix + ':' + defaultAttributeInfo.LocalName );
4128int prefLen = startTagNode.prefix.Length;
4129int locLen = startTagNode.localName.Length;
4139if ( startTagNode.prefix.Length == 0 ) {
4499if ( attr.prefix.Length == 0 ) {
4549if ( curNode.prefix.Length == 0 ) {
4560if ( at.type == XmlNodeType.Attribute && at.prefix.Length > 0 ) {
4616if ( ns.Length == 0 ) {
5632curNode.lineInfo.linePos += curNode.localName.Length;
6928if ( prefixLen == lastPrefix.Length && XmlConvert.StrEqual( ps.chars, startPos, prefixLen, lastPrefix ) ) {
7026if ( uri.Length == 0 && prefix.Length > 0 ) {
7241RegisterConsumedCharacters(entity.Text.Length, true);
7895if ( Ref.Equal( nodes[i].localName, name ) && nodes[i].prefix.Length == 0 ) {
8204if ( defAttrInfo.Prefix.Length > 0 ) {
8252if ( prefix.Length == 0 && ns.Length > 0 ) {
8284NodeData attr = AddAttribute( localName, prefix, prefix.Length > 0 ? null : localName );
8295if ( attr.prefix.Length == 0 ) {
8302if ( nodes[index].prefix.Length == 0 ) {
8539Debug.Assert(endPos < str.Length);
8578int len = value.Length;
System\Xml\Schema\DtdParser.cs (23)
286if ( docTypeName == null || docTypeName.Length == 0 ) {
303if ( systemId != null && systemId.Length > 0 ) {
311if ( publicId != null && publicId.Length > 0 ) {
319if ( internalSubset != null && internalSubset.Length > 0 ) {
463if ( systemId != null && systemId.Length > 0 ) {
475if ( systemId != null && systemId.Length > 0 ) {
650if ( attrDef != null && attrDef.Prefix.Length > 0 && attrDef.Prefix.Equals( "xml" ) && attrDef.Name.Name == "space" ) {
672if (attrDef.Prefix.Length > 0 && attrDef.Prefix.Equals("xml")) {
892SendValidationEvent( curPos - name.Name.Length, XmlSeverityType.Error, Res.Sch_DupElementDecl, GetNameString() );
1286entity.DeclaredURI = ( externalDtdBaseUri.Length == 0 ) ? documentBaseUri : externalDtdBaseUri;
1377SendValidationEvent( curPos - notationName.Name.Length, XmlSeverityType.Error, Res.Sch_DupNotation, notationName.Name );
1409UndeclaredNotation un = new UndeclaredNotation(notationName, LineNo, LinePos - notationName.Length);
1524Throw( curPos - systemId.Length - 1, Res.Xml_FragmentId, new string[] { systemId.Substring( systemId.IndexOf( '#' ) ), systemId } );
1539ThrowInvalidChar( curPos - 1 - publicId.Length + i, publicId, i );
3099Throw( curPos - entityName.Name.Length - 1, Res.Xml_InvalidParEntityRef );
3107Throw( curPos - entityName.Name.Length - 1, paramEntity ? Res.Xml_RecursiveParEntity : Res.Xml_RecursiveGenEntity, entityName.Name );
3120if ( entity.Text.Length == 0 ) {
3186SendValidationEvent( curPos - entityName.Name.Length - 1, XmlSeverityType.Error, Res.Xml_UndeclaredParEntity, entityName.Name );
3194SendValidationEvent( curPos - entityName.Name.Length - 1, XmlSeverityType.Error, Res.Xml_UndeclaredEntity, entityName.Name );
3199Throw( curPos - entityName.Name.Length - 1, Res.Xml_UndeclaredEntity, entityName.Name );
3206Throw( curPos - entityName.Name.Length - 1, Res.Xml_UnparsedEntityRef, entityName.Name );
3210Throw( curPos - entityName.Name.Length - 1, Res.Xml_ExternalEntityInAttValue, entityName.Name );
3345int len = value.Length;
System\Xml\Schema\DtdParserAsync.cs (12)
108if ( systemId != null && systemId.Length > 0 ) {
120if ( systemId != null && systemId.Length > 0 ) {
295if ( attrDef != null && attrDef.Prefix.Length > 0 && attrDef.Prefix.Equals( "xml" ) && attrDef.Name.Name == "space" ) {
317if (attrDef.Prefix.Length > 0 && attrDef.Prefix.Equals("xml")) {
537SendValidationEvent( curPos - name.Name.Length, XmlSeverityType.Error, Res.Sch_DupElementDecl, GetNameString() );
910entity.DeclaredURI = ( externalDtdBaseUri.Length == 0 ) ? documentBaseUri : externalDtdBaseUri;
1003SendValidationEvent( curPos - notationName.Name.Length, XmlSeverityType.Error, Res.Sch_DupNotation, notationName.Name );
1138Throw( curPos - systemId.Length - 1, Res.Xml_FragmentId, new string[] { systemId.Substring( systemId.IndexOf( '#' ) ), systemId } );
1153ThrowInvalidChar( curPos - 1 - publicId.Length + i, publicId, i );
2465Throw( curPos - entityName.Name.Length - 1, Res.Xml_InvalidParEntityRef );
2473Throw( curPos - entityName.Name.Length - 1, paramEntity ? Res.Xml_RecursiveParEntity : Res.Xml_RecursiveGenEntity, entityName.Name );
2489if ( entity.Text.Length == 0 ) {
System\Xml\Schema\Inference\Infer.cs (62)
272if (ns.Length != 0) { //Do not add xmlns=""
344if (childURI.Length == 0)
360if (childURI.Length != 0)
364if (prefix.Length != 0 && String.Compare(prefix, "xml", StringComparison.OrdinalIgnoreCase) != 0)
376if (childURI.Length != 0) //
485if (childURI.Length != 0)
500Debug.Assert(targetNS == null || targetNS.Length > 0 , "targetns for schema is empty");
556if (prefix.Length!=0)
1055if (childURI.Length == 0)
1421if (attr.RefName.Name.Length == 0) { //If the attribute is not present in this instance, make it optional
1740if (s.Length==0) return TF_string;
1767if (i==s.Length)
1786i++; if (i==s.Length) return TF_decimal | TF_float | TF_double | TF_string; //"9999.9" was matched
1799i++; if (i==s.Length) return TF_string;
1812i++; if (i==s.Length) return TF_string; //".9999e+" was matched
1818i++; if (i==s.Length) return TF_float | TF_double | TF_string; //".9999e+99" was matched
1825i++; if (i==s.Length) return TF_string;
1841i++; if (i==s.Length) return TF_string;
1855i++; if (i==s.Length) return TF_string;
1866i++; if (i==s.Length) return TF_string; //"P999" was matched
1883if (i==s.Length)
1899i++; if (i==s.Length) return TF_string; //"P999Y9" was matched
1914if (i==s.Length)
1930i++; if (i==s.Length) return TF_string; //"P999Y999M9" was matched
1943if (i==s.Length)
1956i++; if (i==s.Length) return TF_string; //"P999Y999M9999DT" was matched
1962i++; if (i==s.Length) return TF_string; //"___T9" was matched
1981if (i==s.Length)
1991i++; if (i==s.Length) return TF_string; //"___T999H9" was matched
2008if (i==s.Length)
2018i++; if (i==s.Length) return TF_string; //"___T999H999M9" was matched
2033if (i==s.Length)
2043i++; if (i==s.Length) return TF_string; //"___T999H999M999.9" was matched
2056if (i==s.Length)
2065if (i==s.Length)
2096if (i==s.Length)
2125if (i==s.Length)
2150if (i==s.Length)
2178i++; if (i==s.Length) return TF_string; //"9999-"
2181i++; if (i==s.Length) return TF_string; //"9999-9"
2185if (i==s.Length)
2205i++; if (i==s.Length) return TF_string; //"9999-99-"
2208i++; if (i==s.Length) return TF_string; //"9999-99-9"
2211i++; if (i==s.Length) return DateTime(s, bDate, bTime); //"9999-99-99"
2231if (i==s.Length)
2246i++; if (i==s.Length) return TF_string;
2249i++; if (i==s.Length) return TF_string;
2252i++; if (i==s.Length) return TF_string;
2256i++; if (i==s.Length) return TF_string;
2259i++; if (i==s.Length) return TF_string;
2263if (i==s.Length)
2277i++; if (i==s.Length) return TF_string;
2280i++; if (i==s.Length) return TF_string;
2283i++; if (i==s.Length) return TF_string;
2287i++; if (i==s.Length) return TF_string;
2290i++; if (i==s.Length) return TF_string;
2293i++; if (i==s.Length) return TF_string;
2296i++; if (i==s.Length) return TF_string;
2299i++; if (i==s.Length) return TF_string;
2302i++; if (i==s.Length) return DateTime(s, bDate, bTime);
2317i++; if (i==s.Length) return TF_string;
2321i++; if (i==s.Length) return DateTime(s, bDate, bTime);