예제 #1
0
        public void ShowTreeView <T>(AdvTree adv, List <T> auths, bool showcheck)
        {
            adv.Nodes.Clear();
            List <Node> nodes = GetNodes(auths, showcheck);

            foreach (Node tn in nodes)
            {
                adv.Nodes.Add(tn);
            }
            adv.ExpandAll();
        }
예제 #2
0
        /// <summary>
        /// 创建树
        /// </summary>
        /// <param name="intLevel">模板级别</param>
        private void GetPresTemplate(int intLevel, int presType, AdvTree tree)
        {
            List <OPD_PresMouldHead> listHead = (List <OPD_PresMouldHead>)controller.PresLoadTemplate(intLevel, presType).Where(item => item.MouldType == 0).ToList();

            tree.Nodes.Clear();
            LoadTree(tree, listHead, "99999", null);
            if (tree.Nodes.Count > 0)
            {
                tree.SelectedNode = tree.Nodes[0];
            }
            tree.ExpandAll();
        }
예제 #3
0
        /// <summary>
        /// 创建树
        /// </summary>
        /// <param name="intLevel">模板级别</param>
        /// <param name="tree">当前树对象</param>
        private void GetPresTemplate(int intLevel, AdvTree tree)
        {
            ListHead = (List <OPD_OMRTmpHead>)InvokeController("GetOMRTemplate", intLevel);
            tree.Nodes.Clear();
            LoadTree(tree, ListHead, "-1", null);
            if (tree.Nodes.Count > 0)
            {
                tree.SelectedNode = tree.Nodes[0];
            }

            tree.ExpandAll();
        }
예제 #4
0
        /// <summary>
        /// 创建树
        /// </summary>
        /// <param name="intLevel">模板级别</param>
        /// <param name="presType">类型</param>
        /// <param name="tree">当前树对象</param>
        private void GetPresTemplate(int intLevel, int presType, AdvTree tree)
        {
            ListHead = (List <OPD_PresMouldHead>)InvokeController("GetPresTemplate", intLevel, presType);

            tree.Nodes.Clear();
            LoadTree(tree, ListHead, "99999", null);
            if (tree.Nodes.Count > 0)
            {
                tree.SelectedNode = tree.Nodes[0];
            }

            tree.ExpandAll();
        }
예제 #5
0
        //获取图层属性
        private void ReadLayerProperties(ILayer layer, AdvTree tree)
        {
            tree.BeginUpdate();
            tree.Nodes.Clear();
            if (layer is IFeatureLayer)
            {
                ILayerGeneralProperties layerProperties = layer as ILayerGeneralProperties;
                AddChildNode(tree.Nodes, "LastMaximumScale", layerProperties.LastMaximumScale.ToString());
                AddChildNode(tree.Nodes, "LastMinimumScale", layerProperties.LastMinimumScale.ToString());
                AddChildNode(tree.Nodes, "LayerDescription ", layerProperties.LayerDescription);
            }
            else if (layer is IRasterLayer)
            {
                IRasterLayer rasterLayer = layer as IRasterLayer;
                if (rasterLayer.Raster != null)
                {
                    IRaster  raster                   = rasterLayer.Raster;
                    IRaster2 raster2                  = raster as IRaster2;
                    IRasterBandCollection coll        = raster2 as IRasterBandCollection;
                    IRasterProps          rasterProps = raster2 as IRasterProps;
                    //基本信息
                    Node node = AddChildNode(tree.Nodes, "基本信息", null);
                    AddChildNode(node.Nodes, "行数,列数", rasterProps.Height.ToString() + "," + rasterProps.Width.ToString());
                    AddChildNode(node.Nodes, "波段数", coll.Count.ToString());
                    AddChildNode(node.Nodes, "像元大小(x,y)", rasterProps.MeanCellSize().X.ToString() + "," + rasterProps.MeanCellSize().Y.ToString());
                    AddChildNode(node.Nodes, "波段数", coll.Count.ToString());
                    AddChildNode(node.Nodes, "像素类型", rasterProps.PixelType.ToString());
                    AddChildNode(node.Nodes, "无效值", ClsGetCameraView.getNoDataValue(rasterProps.NoDataValue).ToString());

                    node = AddChildNode(tree.Nodes, "坐标范围", null);
                    AddChildNode(node.Nodes, "上", rasterProps.Extent.YMax.ToString());
                    AddChildNode(node.Nodes, "左", rasterProps.Extent.XMin.ToString());
                    AddChildNode(node.Nodes, "右", rasterProps.Extent.XMax.ToString());
                    AddChildNode(node.Nodes, "下", rasterProps.Extent.YMin.ToString());

                    node = AddChildNode(tree.Nodes, "统计信息", null);
                    ClsGDBDataCommon cls = new ClsGDBDataCommon();
                    for (int i = 0; i < coll.Count; i++)
                    {
                        double[] dValue   = cls.GetRasterStatistics(m_pLayer, i);
                        Node     nodeBand = AddChildNode(node.Nodes, "Band_" + (i + 1).ToString(), null);
                        AddChildNode(nodeBand.Nodes, "最大值", dValue[0].ToString());
                        AddChildNode(nodeBand.Nodes, "最小值", dValue[1].ToString());
                        AddChildNode(nodeBand.Nodes, "平均值", dValue[2].ToString());
                        AddChildNode(nodeBand.Nodes, "标准差", dValue[3].ToString());
                    }
                }
            }
            tree.EndUpdate(true);
            tree.ExpandAll();
        }