コード例 #1
0
        public static RailService CreateFromNode(UriNode _service)
        {
            RailService result = new RailService(_service);

            result.txtName.Text = _service.ToDisplayString();
            return(result);
        }
コード例 #2
0
        private void addRSDisplay(IGraph sourceGraph, int rsSpaceTaken, uint nCol, ref uint col, ref uint row, Triple service)
        {
            RailService rsToAdd = RailService.CreateFromNode(service.Subject as UriNode);

            cnvServices.Children.Add(rsToAdd);
            Canvas.SetLeft(rsToAdd, col * rsSpaceTaken);
            if (col++ > nCol)
            {
                col = 0;
                row++;
            }
            double top = row * rsSpaceTaken;

            Canvas.SetTop(rsToAdd, top);//allow a square space for now. This should probably be improved
            if (top + rsSpaceTaken > cnvServices.ActualHeight)
            {
                cnvServices.Height = top + rsSpaceTaken;
            }
        }