コード例 #1
0
        void RefreshProps()
        {
            Sections.Remove(_propsSec);

            if (_feedElement.Value != null)
            {
                Sections.Insert(Sections.IndexOf(_helpSec), _propsSec);

                if (_metaDoc == null || _metaDoc.BaseUrl != _feedElement.Value.BaseUrl)
                {
                    using (var repo = new Repo()) {
                        _metaDoc = repo.FindMetadataDocument(_feedElement.Value.BaseUrl, _feedElement.Value.ServiceId);
                    }
                }

                _propsSec.Clear();
                if (_metaDoc != null)
                {
                    var ent = _metaDoc.Metadata.FindEntityTypeForEntitySet(_feedElement.Value.Name);
                    if (ent != null)
                    {
                        foreach (var p in ent.Properties)
                        {
                            if (p.IsBasicType)
                            {
                                _propsSec.Add(new PropertyElement(p.Name, p.TypeFullName));
                            }
                            else
                            {
                                var cent = _metaDoc.Metadata.FindEntityType(p.TypeFullName);
                                if (cent != null)
                                {
                                    foreach (var cp in cent.Properties)
                                    {
                                        if (cp.IsBasicType)
                                        {
                                            _propsSec.Add(new PropertyElement(p.Name + "/" + cp.Name, cp.TypeFullName));
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            TableView.ReloadData();
        }
コード例 #2
0
ファイル: QueryController.cs プロジェクト: jorik041/odata
        void RefreshProps()
        {
            Sections.Remove (_propsSec);

            if (_feedElement.Value != null) {

                Sections.Insert (Sections.IndexOf(_helpSec), _propsSec);

                if (_metaDoc == null || _metaDoc.BaseUrl != _feedElement.Value.BaseUrl) {
                    using (var repo = new Repo ()) {
                        _metaDoc = repo.FindMetadataDocument (_feedElement.Value.BaseUrl, _feedElement.Value.ServiceId);
                    }
                }

                _propsSec.Clear ();
                if (_metaDoc != null) {

                    var ent = _metaDoc.Metadata.FindEntityTypeForEntitySet (_feedElement.Value.Name);
                    if (ent != null) {

                        foreach (var p in ent.Properties) {

                            if (p.IsBasicType) {
                                _propsSec.Add (new PropertyElement (p.Name, p.TypeFullName));
                            }
                            else {
                                var cent = _metaDoc.Metadata.FindEntityType(p.TypeFullName);
                                if (cent != null) {
                                    foreach (var cp in cent.Properties) {
                                        if (cp.IsBasicType) {
                                            _propsSec.Add (new PropertyElement (p.Name +"/" + cp.Name, cp.TypeFullName));
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            TableView.ReloadData ();
        }