コード例 #1
0
ファイル: Utils.cs プロジェクト: mdjabirov/C1Decompiled
        public static void LoadShapeFromResource(C1VectorLayer vl, string resname, string dbfname, bool clear, ProcessShapeItem pv)
        {
            using (Stream shapeStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resname))
            {
            using (Stream dbfStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(dbfname))
            {
                if (shapeStream != null)
                {
                    if (clear)
                        vl.Children.Clear();

                    vl.LoadShape(shapeStream, dbfStream, true, pv);
                }
            }
            }
        }
コード例 #2
0
        public static void LoadShape(this C1VectorLayer vl, Stream stream, Stream dbfStream, Location location, bool centerAndZoom,
                                     ProcessShapeItem processShape)
        {
            Dictionary <C1VectorItemBase, C1ShapeAttributes> vects = ShapeReader.Read(stream, dbfStream);

            vl.BeginUpdate();
            foreach (C1VectorItemBase vect in vects.Keys)
            {
                if (processShape != null)
                {
                    processShape(vect, vects[vect], location);
                }

                vl.Children.Add(vect);
            }
            vl.EndUpdate();
        }
コード例 #3
0
        public static void LoadShape(this C1VectorLayer vl, Stream stream, Stream dbfStream, bool centerAndZoom,
      ProcessShapeItem processShape)
        {
            Dictionary<C1VectorItemBase, C1ShapeAttributes> vects = ShapeReader.Read(stream, dbfStream);

            vl.BeginUpdate();
            foreach (C1VectorItemBase vect in vects.Keys)
            {
                if (processShape != null)
                {
                    processShape(vect, vects[vect]);
                }

                vl.Children.Add(vect);
            }
            vl.EndUpdate();
        }
コード例 #4
0
        public static void LoadShapeFromResource(C1VectorLayer vl, string resname, string dbfname, Location location, bool clear, ProcessShapeItem pv)
        {
            using (Stream shapeStream = typeof(Utils).GetTypeInfo().Assembly.GetManifestResourceStream(resname))
            {
                using (Stream dbfStream = typeof(Utils).GetTypeInfo().Assembly.GetManifestResourceStream(dbfname))
                {
                    if (shapeStream != null)
                    {
                        if (clear)
                        {
                            vl.Children.Clear();
                        }

                        vl.LoadShape(shapeStream, dbfStream, location, true, pv);
                    }
                }
            }
        }