Exemple #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);
            }
        }
 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);
     }
 }
Exemple #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);
            }
        }
Exemple #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);
		}
Exemple #5
0
 /// <override></override>
 protected override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     FillStyle = styleSet.FillStyles.Transparent;
     Width     = 40;
     Height    = 70;
 }
Exemple #6
0
 /// <override></override>
 protected override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     pointBuffer = new Point[6];
     Height      = 60;
     Width       = 20;
 }
Exemple #7
0
 /// <override></override>
 protected internal override void InitializeToDefault(IStyleSet styleSet)
 {
     foreach (Shape shape in ChildrenCollection)
     {
         shape.InitializeToDefault(styleSet);
     }
 }
Exemple #8
0
 /// <override></override>
 public override void MakePreview(IStyleSet styleSet)
 {
     foreach (Shape shape in ChildrenCollection)
     {
         shape.MakePreview(styleSet);
     }
 }
Exemple #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);
 }
 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);
     }
 }
Exemple #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;
 }
Exemple #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);
		}
Exemple #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;
        }
		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;
		}
Exemple #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);
 }
Exemple #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);
 }
 /// <ToBeCompleted></ToBeCompleted>
 public void SetPreviewStyles(IStyleSet styleSet)
 {
     if (styleSet == null)
     {
         throw new ArgumentNullException("styleSet");
     }
     foreach (Shape shape in shapes)
     {
         shape.MakePreview(styleSet);
     }
 }
Exemple #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;
     }
 }
Exemple #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);
 }
Exemple #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);
 }
Exemple #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);
		}
        /// <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;
            }
        }
 protected FreeTriangle(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #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);
		}
Exemple #26
0
 /// <override></override>
 protected internal DocumentSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #27
0
 protected internal ExtractSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
 protected internal Polyline(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #29
0
 /// <override></override>
 protected override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     Height = 40;
     Width = 40;
 }
Exemple #30
0
 /// <ToBeCompleted></ToBeCompleted>
 protected internal PathBasedPlanarShape(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
     Construct();
 }
Exemple #31
0
 /// <override></override>
 public override void MakePreview(IStyleSet styleSet)
 {
     base.MakePreview(styleSet);
     privateFillStyle = styleSet.GetPreviewStyle(FillStyle);
 }
Exemple #32
0
 /// <summary>
 /// Sets private preview styles for all used styles.
 /// </summary>
 /// <param name="styleSet"></param>
 public abstract void MakePreview(IStyleSet styleSet);
Exemple #33
0
 /// <override></override>
 protected internal override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     controlPoints = new Point[ControlPointCount];
     FillStyle = styleSet.FillStyles.Blue;
 }
 protected internal IsoscelesTriangle(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #35
0
 protected internal CoreSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #36
0
		/// <override></override>
		public override void MakePreview(IStyleSet styleSet) {
			base.MakePreview(styleSet);
			privateCharacterStyle = styleSet.GetPreviewStyle(CharacterStyle);
			privateParagraphStyle = styleSet.GetPreviewStyle(ParagraphStyle);
		}
Exemple #37
0
 /// <override></override>
 protected internal DecisionSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #38
0
 /// <override></override>
 public override void MakePreview(IStyleSet styleSet)
 {
     base.MakePreview(styleSet);
     privateFillStyle = styleSet.GetPreviewStyle(FillStyle);
 }
Exemple #39
0
 protected internal DisplaySymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #40
0
 protected internal CommLinkSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
     pointBuffer = new Point[6];
 }
Exemple #41
0
 protected internal DrumStorageSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #42
0
 protected internal PreparationSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #43
0
		/// <override></override>
		public override void MakePreview(IStyleSet styleSet)
		{
			foreach (Shape shape in children)
				shape.MakePreview(styleSet);
		}
Exemple #44
0
 /// <override></override>
 protected internal ProcessSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #45
0
		/// <override></override>
		protected internal override void InitializeToDefault(IStyleSet styleSet)
		{
			foreach (Shape shape in children)
				shape.InitializeToDefault(styleSet);
		}
Exemple #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();
 }
Exemple #48
0
 /// <override></override>
 protected override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     pointBuffer = new Point[6];
     Height = 60;
     Width = 20;
 }
Exemple #49
0
 protected internal FlowChartDiamondBase(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #50
0
 /// <ToBeCompleted></ToBeCompleted>
 protected internal PathBasedPlanarShape(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
     Construct();
 }
Exemple #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);
Exemple #52
0
 protected internal FlowChartEllipseBase(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #53
0
 /// <override></override>
 protected internal override void InitializeToDefault(IStyleSet styleSet)
 {
     base.InitializeToDefault(styleSet);
     controlPoints = new Point[ControlPointCount];
     FillStyle     = styleSet.FillStyles.Blue;
 }
Exemple #54
0
 protected internal FlowChartTriangleBase(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
 protected internal RectangularLine(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #56
0
 protected internal ManualInputSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #57
0
		/// <override></override>
		protected internal override void InitializeToDefault(IStyleSet styleSet) {
			base.InitializeToDefault(styleSet);
			CharacterStyle = styleSet.CharacterStyles.Normal;
			ParagraphStyle = styleSet.ParagraphStyles.Title;
		}
Exemple #58
0
 /// <override></override>
 protected internal ManualOperationSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }
Exemple #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) {
		}
Exemple #60
0
 protected internal OffpageConnectorSymbol(ShapeType shapeType, IStyleSet styleSet)
     : base(shapeType, styleSet)
 {
 }