107 {
108 string content = s.Substring(
109 s.IndexOf('[') + 1,
110 s.IndexOf(']') - s.IndexOf('[') - 1
111 );
112
113 var components = content.Split(',').Select(a => a.Trim());
114
115 string sx = components.ElementAtOrDefault(0);
116 string sy = components.ElementAtOrDefault(1);
117 string sw = components.ElementAtOrDefault(2);
118 string sh = components.ElementAtOrDefault(3);
119
120 float? x = null;
121 float? y = null;
122 float? w = null;
123 float? h = null;
124
125 if (sx == null || sx == "") x = null;
126 else x = float.Parse(sx);
127
128 if (sy == null || sy == "") y = null;
129 else y = float.Parse(sy);
130
131 if (sw == null || sw == "") w = null;
132 else w = float.Parse(sw);
133
134 if (sh == null || sh == "") h = null;
135 else h = float.Parse(sh);
136
137 return new CUINullRect(x, y, w, h);
138 }