MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / LoadBounds

Method LoadBounds

Source/Editor/Modules/WindowsModule.cs:519–533  ·  view source on GitHub ↗
(XmlElement node, ref bool isMaximized, ref bool isMinimized)

Source from the content-addressed store, hash-verified

517 }
518
519 private static Rectangle LoadBounds(XmlElement node, ref bool isMaximized, ref bool isMinimized)
520 {
521 var bounds = node["Bounds"];
522 var isMaximizedText = bounds.GetAttribute("IsMaximized");
523 if (!string.IsNullOrEmpty(isMaximizedText) && bool.TryParse(isMaximizedText, out var tmpBool))
524 isMaximized = tmpBool;
525 var isMinimizedText = bounds.GetAttribute("IsMinimized");
526 if (!string.IsNullOrEmpty(isMinimizedText) && bool.TryParse(isMinimizedText, out tmpBool))
527 isMinimized = tmpBool;
528 float x = float.Parse(bounds.GetAttribute("X"), CultureInfo.InvariantCulture);
529 float y = float.Parse(bounds.GetAttribute("Y"), CultureInfo.InvariantCulture);
530 float width = float.Parse(bounds.GetAttribute("Width"), CultureInfo.InvariantCulture);
531 float height = float.Parse(bounds.GetAttribute("Height"), CultureInfo.InvariantCulture);
532 return new Rectangle(x, y, width, height);
533 }
534
535 private static void LoadWindow(Window win, ref Rectangle bounds, bool isMaximized, bool isMinimized)
536 {

Callers

nothing calls this directly

Calls 3

GetAttributeMethod · 0.45
TryParseMethod · 0.45
ParseMethod · 0.45

Tested by

no test coverage detected