Beispiel #1
0
        // Get SourceLocation for object deserialized with XamlDebuggerXmlReader in deserializer stack.
        static bool TryGetSourceLocation(object obj, string path, byte[] checksum, out SourceLocation sourceLocation)
        {
            sourceLocation = null;
            int startLine, startColumn, endLine, endColumn;

            if (AttachablePropertyServices.TryGetProperty <int>(obj, XamlDebuggerXmlReader.StartLineName, out startLine) &&
                AttachablePropertyServices.TryGetProperty <int>(obj, XamlDebuggerXmlReader.StartColumnName, out startColumn) &&
                AttachablePropertyServices.TryGetProperty <int>(obj, XamlDebuggerXmlReader.EndLineName, out endLine) &&
                AttachablePropertyServices.TryGetProperty <int>(obj, XamlDebuggerXmlReader.EndColumnName, out endColumn) &&
                SourceLocation.IsValidRange(startLine, startColumn, endLine, endColumn))
            {
                sourceLocation = new SourceLocation(path, checksum, startLine, startColumn, endLine, endColumn);
                return(true);
            }
            return(false);
        }
Beispiel #2
0
        private static bool TryGetSourceLocation(object obj, string path, out SourceLocation sourceLocation)
        {
            int num;
            int num2;
            int num3;
            int num4;

            sourceLocation = null;
            if (((AttachablePropertyServices.TryGetProperty <int>(obj, XamlDebuggerXmlReader.StartLineName, out num) && AttachablePropertyServices.TryGetProperty <int>(obj, XamlDebuggerXmlReader.StartColumnName, out num2)) && (AttachablePropertyServices.TryGetProperty <int>(obj, XamlDebuggerXmlReader.EndLineName, out num3) && AttachablePropertyServices.TryGetProperty <int>(obj, XamlDebuggerXmlReader.EndColumnName, out num4))) && SourceLocation.IsValidRange(num, num2, num3, num4))
            {
                sourceLocation = new SourceLocation(path, num, num2, num3, num4);
                return(true);
            }
            return(false);
        }