Esempio n. 1
0
        void ListXrefs()
        {
            XrefListview.Items.Clear();
            List <ListViewItem> LocList;

            foreach (ListViewItem lvi in DwgListview.SelectedItems)
            {
                foreach (MyXrefInformation xrInfo in lvi.Tag as MyXrefInformation[])
                {
                    string curName = xrInfo.Name;
                    string newName = xrInfo.NewName;
                    string Path    = (xrInfo.Path == xrInfo.NewPath ? xrInfo.Path : xrInfo.NewPath);

                    bool DidAdd = false;
                    foreach (ListViewItem xrlvi in XrefListview.Items)
                    {
                        if (xrlvi.Text == curName && xrlvi.SubItems[1].Text == newName && xrlvi.SubItems[2].Text == Path)
                        {
                            LocList = xrlvi.Tag as List <ListViewItem>;
                            LocList.Add(lvi);
                            xrlvi.Tag = LocList;
                            DidAdd    = true;
                            break;
                        }
                    }
                    if (DidAdd)
                    {
                        continue;
                    }
                    LocList = new List <ListViewItem>();
                    ListViewItem tempLvi = new ListViewItem(xrInfo.Name);
                    //tempLvi.SubItems.Add(xrInfo.NewName);
                    tempLvi.SubItems.Add(xrInfo.NewPath);
                    if (xrInfo.IsNested)
                    {
                        tempLvi.ForeColor = Color.Crimson;
                    }
                    LocList.Add(lvi);
                    tempLvi.Tag = LocList;
                    XrefListview.Items.Add(tempLvi);
                }
            }
            XrefListview.Sort();
        }
Esempio n. 2
0
        public void OpenLocSelecter(int x, int y, List <LocationData> locationDatas)
        {
            MulitLocSelecter.Visibility = Visibility.Visible;
            PopupGrid.Visibility        = Visibility.Visible;
            PopupInnerGrid.Margin       = new Thickness(x, y, 0, 0);
            MapViewer.IsEnabled         = false;
            PopupReLocatied();

            LocList.Items.Clear();
            for (int i = 0; i < locationDatas.Count; i++)
            {
                ListBoxItem listBoxItem = new ListBoxItem();

                listBoxItem.Content = locationDatas[i].NAME;
                listBoxItem.Tag     = locationDatas[i];


                LocList.Items.Add(listBoxItem);
            }
            LocList.Focus();
        }
Esempio n. 3
0
        public LocList GetTables(int id)
        {
            LocList allLocs = new LocList();

            using (var con = new NpgsqlConnection(connectionString))
            {
                con.Open();
                using (var cmd = new NpgsqlCommand($"SELECT table_id, x_axis, y_axis, z_axis FROM table_bookings WHERE restaurant_id = {id} AND x_axis IS NOT NULL", con))
                    using (var reader = cmd.ExecuteReader())
                        while (reader.Read())
                        {
                            var locations = new Locations
                            {
                                table_id = reader.GetInt32(0),
                                x_axis   = reader.GetFloat(1),
                                y_axis   = reader.GetFloatOrDefault(2),
                                z_axis   = reader.GetFloatOrDefault(3)
                            };
                            allLocs.locations.Add(locations);
                        }
            }
            return(allLocs);
        }
        private static void ExtractNERTags(CoreDocument coredoc, Lucene.Net.Documents.Document document)
        {
            //I have no clue as to why NER-tagged messages are stored like that. I guess there is some deep idea behind copying the same info over and over again (or, most likely, this is because some documents have more than one sentence. even tho its stil really stupid)
            if (coredoc != null)
            {
                List nerList = coredoc.entityMentions();
                if (nerList.size() > 0)
                {
                    for (int j = 0; j < nerList.size(); j++)
                    {
                        CoreEntityMention em = (CoreEntityMention)nerList.get(j);
                        //Does this need to be a switch case?
                        if (em.entityType() == "DATE")
                        {
                            var datekey = document.GetField("id").GetInt32Value().Value;
                            if (!DateList.ContainsKey(datekey))
                            {
                                DateList.Add(datekey, em.text());
                            }
                            else
                            {
                                DateList.TryUpdate(datekey, DateList[datekey] + ", " + em.text());
                            }
                        }
                        if (em.entityType() == "TIME")
                        {
                            var timekey = document.GetField("id").GetInt32Value().Value;
                            if (!TimeList.ContainsKey(timekey))
                            {
                                TimeList.Add(timekey, em.text());
                            }
                            else
                            {
                                TimeList.TryUpdate(timekey, TimeList[timekey] + ", " + em.text());
                            }
                        }

                        if (em.entityType() == "LOCATION")
                        {
                            var lockey = document.GetField("id").GetInt32Value().Value;
                            if (!LocList.ContainsKey(lockey))
                            {
                                LocList.Add(lockey, em.text());
                            }
                            else
                            {
                                LocList.TryUpdate(lockey, LocList[lockey] + ", " + em.text());
                            }
                        }
                        if (em.entityType() == "ORGANIZATION")
                        {
                            var orgkey = document.GetField("id").GetInt32Value().Value;
                            if (!OrgList.ContainsKey(orgkey))
                            {
                                OrgList.Add(orgkey, em.text());
                            }
                            else
                            {
                                OrgList.TryUpdate(orgkey, OrgList[orgkey] + ", " + em.text());
                            }
                        }

                        if (em.entityType() == "URL")
                        {
                            var urlkey = document.GetField("id").GetInt32Value().Value;
                            if (!URLList.ContainsKey(urlkey))
                            {
                                URLList.Add(urlkey, em.text());
                            }
                            else
                            {
                                URLList.TryUpdate(urlkey, OrgList[urlkey] + ", " + em.text());
                            }
                        }
                    }
                }
            }
        }