Exemple #1
0
        public void TryAddWindowFromPoint(Point point)
        {
            IntPtr formHandle = ApiForm.Select(point);

            if (formHandle == IntPtr.Zero)
            {
                //parent could not be found
                return;
            }

            this.TryAddWindow(formHandle);
        }
Exemple #2
0
        private static ApiForm ParseFormsResourceObject(JObject outer, string name, ApiDefinition definition)
        {
            var form = new ApiForm {
                Name = name
            };

            foreach (var inner in outer.Properties())
            {
                var value = inner.Value.ToString();

                if (string.IsNullOrEmpty(value))
                {
                    continue;
                }

                switch (inner.Name.ToLowerInvariant())
                {
                case "action":
                    form.Action = TryCreateUri(value, UriKind.RelativeOrAbsolute);
                    break;

                case "templated":
                    form.Templated = value.Equals("true", StringComparison.OrdinalIgnoreCase);
                    break;

                case "method":
                    form.Method = value;
                    break;

                case "type":
                    form.Type = value;
                    break;

                case "title":
                    form.Title = value;
                    break;

                case "headers":
                    form.Headers = inner.Value.ToObject <IReadOnlyDictionary <string, string> >();
                    break;

                case "schema":
                    form.Schema = inner.Value.ToObject <IReadOnlyDictionary <string, object> >();
                    break;
                }
            }

            return(form);
        }