Exemplo n.º 1
0
        protected override void ElementInserted(System.Collections.Generic.IList <Element> elements)
        {
            Element element = elements.FirstOrDefault();

            if (element != null && ActiveDiagramView.ElementRepresentations.IsElementPresent(element))
            {
                if (element is PIMClass && ActiveDiagramView.ElementRepresentations[element] is PIM_Class)
                {
                    //((PIM_Class)ActiveDiagramView.ElementRepresentations[element]).ClassController.ShowClassDialog();
                }
            }
        }
Exemplo n.º 2
0
        private Site GetSiteFromRequest()
        {
            string authority = _requestBase.Url.Authority;

            System.Collections.Generic.IList <Site>            allSites          = _session.QueryOver <Site>().Fetch(s => s.RedirectedDomains).Eager.Cacheable().List();
            System.Collections.Generic.List <RedirectedDomain> redirectedDomains = allSites.SelectMany(s => s.RedirectedDomains).ToList();
            Site site = allSites.FirstOrDefault(s => s.BaseUrl != null && s.BaseUrl.Equals(authority, StringComparison.OrdinalIgnoreCase));

            if (site == null)
            {
                RedirectedDomain redirectedDomain =
                    redirectedDomains.FirstOrDefault(
                        s => s.Url != null && s.Url.Equals(authority, StringComparison.OrdinalIgnoreCase));
                if (redirectedDomain != null)
                {
                    site = redirectedDomain.Site;
                }
            }

            return(site ?? allSites.First());
        }
Exemplo n.º 3
0
        public ActionResult <string[]> Get(string id, string table)
        {
            if (!memoryCache.TryGetValue(id, out IDataToSent data))
            {
                return(NotFound($"id not found {id}"));
            }
            System.Collections.Generic.IList <ITable> tables = data.Metadata.Tables;
            if (string.IsNullOrWhiteSpace(table))
            {
                return(tables.Select(it => it.Name).ToArray());
            }
            ITable t = tables.FirstOrDefault(it => string.Equals(it.Name, table, StringComparison.InvariantCultureIgnoreCase));

            if (t == null)
            {
                return(NotFound($"table {table} not found"));
            }
            DataTable ret = data.DataToBeSentFurther[t.Id];

            string[] obj = JArray.FromObject(ret).Select(it => it.ToString(Formatting.None)).ToArray();
            return(obj);
        }