예제 #1
0
 public DesignItemInfo(ItemShapeInfo itemShapeInfo)
     : this()
 {
     this.ShapeCategory = itemShapeInfo.ShapeCategory;
     this.SerialNo = itemShapeInfo.SerialNo;
     this.GroupID = itemShapeInfo.GroupID;
     this.IsInGroup = itemShapeInfo.IsInGroup;
     this.StyleKey = itemShapeInfo.StyleKey;
     this.Style = itemShapeInfo.Style;
     this.ToolTip = itemShapeInfo.ToolTip;
     this.IsChecked = itemShapeInfo.IsChecked;
     this.IsEnabled = itemShapeInfo.IsEnabled;
     this.SvgBuffer = itemShapeInfo.SvgBuffer;
 }
예제 #2
0
        private List<ShapeInfoUnit> GetSVGShapeInfoUnits()
        {
            var shapeInfoUnites = new List<ShapeInfoUnit>();
              var shapeInfoA = new ItemShapeInfo();
              shapeInfoA.ShapeType = ShapeType.DesignItem;
              shapeInfoA.ShapeCategory = ShapeCategory.Business;
              shapeInfoA.StyleKey = "SVGBusinessShapeStyle";
              shapeInfoA.Style = Application.Current.Resources["SVGBusinessShapeStyle"] as Style;
              shapeInfoA.ToolTip = "SVG";
              shapeInfoA.IsChecked = true;
              shapeInfoA.IsEnabled = true;
              shapeInfoA.SvgBuffer = File.ReadAllBytes(Path.Combine(AppDomain.CurrentDomain.BaseDirectory,@"Resources\Svg\Butterfly.svg"));
              var shapeInfoUnit = new ItemShapeInfoUnit(shapeInfoA);
              using (var stream = new MemoryStream(shapeInfoA.SvgBuffer))
              {
              shapeInfoUnit.SvgDrawing = SvgHelper.CreateSvgViewBox(stream);
              }
              shapeInfoUnites.Add(shapeInfoUnit);

              return shapeInfoUnites;
        }