示例#1
0
        /// <summary>
        /// Releases resources used for styles of the given <see cref="T:Dataweb.NShape.IStyleSet" />.
        /// </summary>
        public static void RemoveStyleSetTools(IStyleSet styleSet)
        {
            if (styleSet == null)
            {
                throw new ArgumentNullException("styleSet");
            }

            // Delete GDI+ objects created from styles
            foreach (ICapStyle style in styleSet.CapStyles)
            {
                ToolCache.NotifyCapStyleChanged(style);
            }
            foreach (ICharacterStyle style in styleSet.CharacterStyles)
            {
                ToolCache.NotifyCharacterStyleChanged(style);
            }
            foreach (IColorStyle style in styleSet.ColorStyles)
            {
                ToolCache.NotifyColorStyleChanged(style);
            }
            foreach (IFillStyle style in styleSet.FillStyles)
            {
                ToolCache.NotifyFillStyleChanged(style);
            }
            foreach (ILineStyle style in styleSet.LineStyles)
            {
                ToolCache.NotifyLineStyleChanged(style);
            }
            foreach (IParagraphStyle style in styleSet.ParagraphStyles)
            {
                ToolCache.NotifyParagraphStyleChanged(style);
            }
        }
示例#2
0
 public static void Compare(IStyleSet designA, IStyleSet designB, int version)
 {
     foreach (ICapStyle styleA in designA.CapStyles)
     {
         ICapStyle styleB = designB.CapStyles[styleA.Name];
         Compare(styleA, styleB, version);
     }
     foreach (ICharacterStyle styleA in designA.CharacterStyles)
     {
         ICharacterStyle styleB = designB.CharacterStyles[styleA.Name];
         Compare(styleA, styleB, version);
     }
     foreach (IColorStyle styleA in designA.ColorStyles)
     {
         IColorStyle styleB = designB.ColorStyles[styleA.Name];
         Compare(styleA, styleB, version);
     }
     foreach (IFillStyle styleA in designA.FillStyles)
     {
         IFillStyle styleB = designB.FillStyles[styleA.Name];
         Compare(styleA, styleB, version);
     }
     foreach (ILineStyle styleA in designA.LineStyles)
     {
         ILineStyle styleB = designB.LineStyles[styleA.Name];
         Compare(styleA, styleB, version);
     }
     foreach (IParagraphStyle styleA in designA.ParagraphStyles)
     {
         IParagraphStyle styleB = designB.ParagraphStyles[styleA.Name];
         Compare(styleA, styleB, version);
     }
 }
示例#3
0
        /// <summary>
        /// Closes the project.
        /// </summary>
        public void Close()
        {
            if (Closing != null)
            {
                Closing(this, EventArgs.Empty);
            }
            if (IsOpen)
            {
                if (repository.IsOpen)
                {
                    // Get styleSet before closing the repository
                    IStyleSet styleSet = ((IStyleSetProvider)this).StyleSet;
                    // Delete GDI+ objects created from styles
                    ToolCache.RemoveStyleSetTools(styleSet);

                    // Close Repository
                    repository.Close();
                }

                // Clean up project data
                settings.Clear();
                model = null;
                history.Clear();
                settings = new ProjectSettings();

                // TODO 2: Unload dynamic libraries and remove the corresponding shape and model types.
                //RemoveAllLibraries();
            }
            if (Closed != null)
            {
                Closed(this, EventArgs.Empty);
            }
        }
示例#4
0
		public StyleListBox(IStyleSet styleSet, Style style, bool showDefaultStyleItem, bool showOpenDesignerItem) :
			this()
		{
			if (styleSet == null) throw new ArgumentNullException("design");
			if (style == null) throw new ArgumentNullException("style");
			Initialize(styleSet, showDefaultStyleItem, showOpenDesignerItem, style.GetType(), style);
		}
示例#5
0
 /// <override></override>
 protected override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     FillStyle = styleSet.FillStyles.Transparent;
     Width     = 40;
     Height    = 70;
 }
示例#6
0
 /// <override></override>
 protected override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     pointBuffer = new Point[6];
     Height      = 60;
     Width       = 20;
 }
示例#7
0
 /// <override></override>
 protected internal override void InitializeToDefault(IStyleSet styleSet)
 {
     foreach (Shape shape in ChildrenCollection)
     {
         shape.InitializeToDefault(styleSet);
     }
 }
示例#8
0
 /// <override></override>
 public override void MakePreview(IStyleSet styleSet)
 {
     foreach (Shape shape in ChildrenCollection)
     {
         shape.MakePreview(styleSet);
     }
 }
示例#9
0
 /// <override></override>
 protected override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     FillStyle       = styleSet.FillStyles.Transparent;
     bodyHeightRatio = 1d / 3d;
     headWidth       = (int)Math.Round(Width / 2f);
 }
示例#10
0
 public static void Compare(IStyleSet savedDesign, IStyleSet loadedDesign, int version)
 {
     foreach (ICapStyle savedStyle in savedDesign.CapStyles)
     {
         ICapStyle loadedStyle = loadedDesign.CapStyles[savedStyle.Name];
         Compare(savedStyle, loadedStyle, version);
     }
     foreach (ICharacterStyle savedStyle in savedDesign.CharacterStyles)
     {
         ICharacterStyle loadedStyle = loadedDesign.CharacterStyles[savedStyle.Name];
         Compare(savedStyle, loadedStyle, version);
     }
     foreach (IColorStyle savedStyle in savedDesign.ColorStyles)
     {
         IColorStyle loadedStyle = loadedDesign.ColorStyles[savedStyle.Name];
         Compare(savedStyle, loadedStyle, version);
     }
     foreach (IFillStyle savedStyle in savedDesign.FillStyles)
     {
         IFillStyle loadedStyle = loadedDesign.FillStyles[savedStyle.Name];
         Compare(savedStyle, loadedStyle, version);
     }
     foreach (ILineStyle savedStyle in savedDesign.LineStyles)
     {
         ILineStyle loadedStyle = loadedDesign.LineStyles[savedStyle.Name];
         Compare(savedStyle, loadedStyle, version);
     }
     foreach (IParagraphStyle savedStyle in savedDesign.ParagraphStyles)
     {
         IParagraphStyle loadedStyle = loadedDesign.ParagraphStyles[savedStyle.Name];
         Compare(savedStyle, loadedStyle, version);
     }
 }
示例#11
0
 /// <override></override>
 protected internal override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     gluePointPos.X      = (int)Math.Round(X - (Width / 2f)) - 10;
     gluePointPos.Y      = (int)Math.Round(Y - (Height / 2f)) - 10;
     calcInfo            = GluePointCalcInfo.Empty;
     maintainOrientation = true;
 }
示例#12
0
		public StyleListBox(IWindowsFormsEditorService editorService, IStyleSetProvider styleSetProvider, IStyleSet styleSet, Type selectedStyleType, bool showDefaultStyleItem, bool showOpenDesignerItem)
			: this(editorService) {
			if (styleSetProvider == null) throw new ArgumentNullException("styleSetProvider");
			if (styleSet == null) throw new ArgumentNullException("styleSet");
			if (selectedStyleType == null) throw new ArgumentNullException("selectedStyleType");
			this.styleSetProvider = styleSetProvider;
			Initialize(styleSet, showDefaultStyleItem, showOpenDesignerItem, selectedStyleType, null);
		}
示例#13
0
 /// <override></override>
 protected internal override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     AutoSize = true;
     Text     = "Text";
     // override standard Line- and FillStyles
     FillStyle = styleSet.FillStyles.Transparent;
     LineStyle = styleSet.LineStyles.None;
 }
        /// <summary>
        /// ctor with a stylesheet for customized formatting
        /// </summary>
        /// <param name="styleSet"></param>
        public PdfTextFormatter(IStyleSet styleSet)
        {
            BackColor        = new Color(211, 223, 240);
            TableBorderColor = new Color(217, 230, 245);
            HeadLineColor    = Colors.Black;
            DetailsColor     = Colors.Black;

            StyleSet = styleSet;
        }
示例#15
0
		private void Initialize(IStyleSet styleSet, bool showDefaultStyleItem, bool showOpenDesignerItem, Type styleType, IStyle style) {
			this.styleSet = styleSet;
			if (showDefaultStyleItem)
				defaultStyleItem = new DefaultStyleItem();
			if (showOpenDesignerItem && styleSetProvider != null)
				openDesignerItem = new OpenDesignerItem();

			StyleCategoryFromType(styleType);
			if (style != null) SelectedItem = preselectedStyle = style;
		}
示例#16
0
 /// <override></override>
 protected internal ShapeGroup(ShapeType shapeType, IStyleSet styleSet)
     : base()
 {
     if (shapeType == null)
     {
         throw new ArgumentNullException("shapeType");
     }
     this.shapeType     = shapeType;
     this.template      = null;
     ChildrenCollection = (GroupShapeAggregation)CreateChildrenCollection(DefaultCapacity);
 }
示例#17
0
 /// <override></override>
 protected internal ShapeGroup(ShapeType shapeType, IStyleSet styleSet)
     : base()
 {
     if (shapeType == null)
     {
         throw new ArgumentNullException("shapeType");
     }
     this.shapeType = shapeType;
     this.template  = null;
     children       = new GroupShapeAggregation(this);
 }
示例#18
0
 /// <ToBeCompleted></ToBeCompleted>
 public void SetPreviewStyles(IStyleSet styleSet)
 {
     if (styleSet == null)
     {
         throw new ArgumentNullException("styleSet");
     }
     foreach (Shape shape in shapes)
     {
         shape.MakePreview(styleSet);
     }
 }
示例#19
0
 /// <override></override>
 protected override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     if (Template == null)
     {
         //StartEndCapStyle = styleSet.GetCapStyle("Circle Cap");
         // @@Kurt
         // Den Style "Circle Cap" gibt es nicht in den Standard-Designs. Da müssen wir uns erst noch was überlegen wie
         // man das Design um benötigte Styles erweitern kann (am Besten beim Registrieren der GeneralShapes)
         EndCapStyleInternal = styleSet.CapStyles.Special1;
     }
 }
示例#20
0
 public StyleListBox(IWindowsFormsEditorService editorService, IStyleSet styleSet, Type selectedStyleType, bool showDefaultStyleItem, bool showOpenDesignerItem)
     : this(editorService) {
     if (styleSet == null)
     {
         throw new ArgumentNullException("styleSet");
     }
     if (selectedStyleType == null)
     {
         throw new ArgumentNullException("selectedStyleType");
     }
     Initialize(styleSet, showDefaultStyleItem, showOpenDesignerItem, selectedStyleType, null);
 }
示例#21
0
 public StyleListBox(IStyleSet styleSet, Style style, bool showDefaultStyleItem, bool showOpenDesignerItem) :
     this()
 {
     if (styleSet == null)
     {
         throw new ArgumentNullException("design");
     }
     if (style == null)
     {
         throw new ArgumentNullException("style");
     }
     Initialize(styleSet, showDefaultStyleItem, showOpenDesignerItem, style.GetType(), style);
 }
示例#22
0
		/// <summary>
		/// Releases resources used for styles of the given <see cref="T:Dataweb.NShape.IStyleSet" />.
		/// </summary>
		public static void RemoveStyleSetTools(IStyleSet styleSet) {
			if (styleSet == null) throw new ArgumentNullException("styleSet");

			// delete GDI+ objects created from styles
			foreach (ICapStyle style in styleSet.CapStyles)
				ToolCache.NotifyCapStyleChanged(style);
			foreach (ICharacterStyle style in styleSet.CharacterStyles)
				ToolCache.NotifyCharacterStyleChanged(style);
			foreach (IColorStyle style in styleSet.ColorStyles)
				ToolCache.NotifyColorStyleChanged(style);
			foreach (IFillStyle style in styleSet.FillStyles)
				ToolCache.NotifyFillStyleChanged(style);
			foreach (ILineStyle style in styleSet.LineStyles)
				ToolCache.NotifyLineStyleChanged(style);
			foreach (IParagraphStyle style in styleSet.ParagraphStyles)
				ToolCache.NotifyParagraphStyleChanged(style);
		}
示例#23
0
        /// <override></override>
        protected internal override void InitializeToDefault(IStyleSet styleSet)
        {
            base.InitializeToDefault(styleSet);
            pointBuffer[0].X = 0;
            pointBuffer[0].Y = -20;
            pointBuffer[1].X = -20;
            pointBuffer[1].Y = 20;
            pointBuffer[2].X = 20;
            pointBuffer[2].Y = 20;
            int x, y;

            Geometry.CalcPolygonBalancePoint(pointBuffer, out x, out y);

            for (int i = shapePoints.Length - 1; i >= 0; --i)
            {
                shapePoints[i].X = pointBuffer[i].X - x;
                shapePoints[i].Y = pointBuffer[i].Y - y;
            }
        }
示例#24
0
 protected FreeTriangle(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#25
0
		/// <override></override>
		protected internal ShapeGroup(ShapeType shapeType, IStyleSet styleSet)
			: base()
		{
			if (shapeType == null) throw new ArgumentNullException("shapeType");
			this.shapeType = shapeType;
			this.template = null;
			children = new GroupShapeAggregation(this);
		}
示例#26
0
 /// <override></override>
 protected internal DocumentSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#27
0
 protected internal ExtractSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#28
0
 protected internal Polyline(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#29
0
 /// <override></override>
 protected override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     Height = 40;
     Width = 40;
 }
示例#30
0
 /// <ToBeCompleted></ToBeCompleted>
 protected internal PathBasedPlanarShape(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
     Construct();
 }
示例#31
0
 /// <override></override>
 public override void MakePreview(IStyleSet styleSet)
 {
     base.MakePreview(styleSet);
     privateFillStyle = styleSet.GetPreviewStyle(FillStyle);
 }
示例#32
0
 /// <summary>
 /// Sets private preview styles for all used styles.
 /// </summary>
 /// <param name="styleSet"></param>
 public abstract void MakePreview(IStyleSet styleSet);
示例#33
0
 /// <override></override>
 protected internal override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     controlPoints = new Point[ControlPointCount];
     FillStyle = styleSet.FillStyles.Blue;
 }
示例#34
0
 protected internal IsoscelesTriangle(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#35
0
 protected internal CoreSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#36
0
		/// <override></override>
		public override void MakePreview(IStyleSet styleSet) {
			base.MakePreview(styleSet);
			privateCharacterStyle = styleSet.GetPreviewStyle(CharacterStyle);
			privateParagraphStyle = styleSet.GetPreviewStyle(ParagraphStyle);
		}
示例#37
0
 /// <override></override>
 protected internal DecisionSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#38
0
 /// <override></override>
 public override void MakePreview(IStyleSet styleSet)
 {
     base.MakePreview(styleSet);
     privateFillStyle = styleSet.GetPreviewStyle(FillStyle);
 }
示例#39
0
 protected internal DisplaySymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#40
0
 protected internal CommLinkSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
     pointBuffer = new Point[6];
 }
示例#41
0
 protected internal DrumStorageSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#42
0
 protected internal PreparationSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#43
0
		/// <override></override>
		public override void MakePreview(IStyleSet styleSet)
		{
			foreach (Shape shape in children)
				shape.MakePreview(styleSet);
		}
示例#44
0
 /// <override></override>
 protected internal ProcessSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#45
0
		/// <override></override>
		protected internal override void InitializeToDefault(IStyleSet styleSet)
		{
			foreach (Shape shape in children)
				shape.InitializeToDefault(styleSet);
		}
示例#46
0
 /// <override></override>
 protected internal TerminatorSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
 protected internal CustomPicture(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
     Construct();
 }
示例#48
0
 /// <override></override>
 protected override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     pointBuffer = new Point[6];
     Height = 60;
     Width = 20;
 }
示例#49
0
 protected internal FlowChartDiamondBase(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#50
0
 /// <ToBeCompleted></ToBeCompleted>
 protected internal PathBasedPlanarShape(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
     Construct();
 }
示例#51
0
 /// <summary>
 /// Sets the state of a freshly created shape to the default values.
 /// </summary>
 /// <param name="styleSet"></param>
 /// <remarks>Only used by the ShapeType class.</remarks>
 protected internal abstract void InitializeToDefault(IStyleSet styleSet);
示例#52
0
 protected internal FlowChartEllipseBase(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#53
0
 /// <override></override>
 protected internal override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     controlPoints = new Point[ControlPointCount];
     FillStyle     = styleSet.FillStyles.Blue;
 }
示例#54
0
 protected internal FlowChartTriangleBase(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#55
0
 protected internal RectangularLine(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#56
0
 protected internal ManualInputSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#57
0
		/// <override></override>
		protected internal override void InitializeToDefault(IStyleSet styleSet) {
			base.InitializeToDefault(styleSet);
			CharacterStyle = styleSet.CharacterStyles.Normal;
			ParagraphStyle = styleSet.ParagraphStyles.Title;
		}
示例#58
0
 /// <override></override>
 protected internal ManualOperationSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
示例#59
0
		/// <summary>
		/// Initializes a new instance of <see cref="T:Dataweb.NShape.Advanced.CaptionedShape" />.
		/// </summary>
		protected internal CaptionedShapeBase(ShapeType shapeType, IStyleSet styleSet)
			: base(shapeType, styleSet) {
		}
示例#60
0
 protected internal OffpageConnectorSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }