コード例 #1
0
 public CSharpClassBox(Canvas canvas) : base(canvas)
 {
     Text = ".cs";
     TextFont.Dispose();
     TextFont  = new Font(FontFamily.GenericSansSerif, 6);
     TextAlign = ContentAlignment.TopLeft;
 }
コード例 #2
0
 public ToolboxAssemblyAgentShape(Canvas canvas) : base(canvas)
 {
     Text = "Agent";
     TextFont.Dispose();
     TextFont        = new Font(FontFamily.GenericSansSerif, 6);
     FillBrush.Color = Color.PowderBlue;
 }
コード例 #3
0
ファイル: GraphicElement.cs プロジェクト: nagyistge/FlowSharp
        public virtual void Deserialize(ElementPropertyBag epb)
        {
            Id = epb.Id;

            if (!String.IsNullOrEmpty(epb.Json))
            {
                Json = JsonConvert.DeserializeObject <Dictionary <string, string> >(epb.Json);
            }

            DisplayRectangle = epb.DisplayRectangle;
            BorderPen.Dispose();
            BorderPen = new Pen(epb.BorderPenColor, epb.BorderPenWidth);
            FillBrush.Dispose();
            FillBrush = new SolidBrush(epb.FillBrushColor);
            Text      = epb.Text;
            TextColor = epb.TextColor;
            // If missing (backwards compatibility) middle-center align.
            TextAlign = epb.TextAlign == 0 ? ContentAlignment.MiddleCenter : epb.TextAlign;
            TextFont.Dispose();
            FontStyle fontStyle = (epb.TextFontUnderline ? FontStyle.Underline : FontStyle.Regular) | (epb.TextFontItalic ? FontStyle.Italic : FontStyle.Regular) | (epb.TextFontStrikeout ? FontStyle.Strikeout : FontStyle.Regular);

            TextFont = new Font(epb.TextFontFamily, epb.TextFontSize, fontStyle);

            HasCornerAnchors    = epb.HasCornerAnchors;
            HasCenterAnchors    = epb.HasCenterAnchors;
            HasLeftRightAnchors = epb.HasLeftRightAnchors;
            HasTopBottomAnchors = epb.HasTopBottomAnchors;

            HasCornerConnections    = epb.HasCornerConnections;
            HasCenterConnections    = epb.HasCenterConnections;
            HasLeftRightConnections = epb.HasLeftRightConnections;
            HasTopBottomConnections = epb.HasTopBottomConnections;
        }
コード例 #4
0
 public SemanticInstance(Canvas canvas) : base(canvas)
 {
     TextFont.Dispose();
     TextFont  = new Font(FontFamily.GenericSansSerif, 6);
     TextAlign = ContentAlignment.TopCenter;
     Text      = "ST";
 }
コード例 #5
0
 public SemanticTypeShape(Canvas canvas) : base(canvas)
 {
     Text = "SemType";
     TextFont.Dispose();
     TextFont        = new Font(FontFamily.GenericSansSerif, 6);
     FillBrush.Color = Color.LightGreen;
 }
コード例 #6
0
 protected override void DisposeManagedResources()
 {
     base.DisposeManagedResources();
     textBrush.Dispose();
     TextFont.Dispose();
     backgroundBrush.Dispose();
 }
コード例 #7
0
 public PythonFileBox(Canvas canvas) : base(canvas)
 {
     Text = ".py";
     TextFont.Dispose();
     TextFont  = new Font(FontFamily.GenericSansSerif, 6);
     TextAlign = ContentAlignment.TopCenter;
 }
コード例 #8
0
 public AssemblyBox(Canvas canvas) : base(canvas)
 {
     Text = "Assy";
     TextFont.Dispose();
     TextFont  = new Font(FontFamily.GenericSansSerif, 6);
     TextAlign = ContentAlignment.TopCenter;
 }
コード例 #9
0
        public virtual void Deserialize(ElementPropertyBag epb)
        {
            Id = epb.Id;
            DisplayRectangle = epb.DisplayRectangle;
            BorderPen.Dispose();
            BorderPen = new Pen(epb.BorderPenColor, epb.BorderPenWidth);
            FillBrush.Dispose();
            FillBrush = new SolidBrush(epb.FillBrushColor);
            Text      = epb.Text;
            TextColor = epb.TextColor;
            TextFont.Dispose();
            FontStyle fontStyle = (epb.TextFontUnderline ? FontStyle.Underline : FontStyle.Regular) | (epb.TextFontItalic ? FontStyle.Italic : FontStyle.Regular) | (epb.TextFontStrikeout ? FontStyle.Strikeout : FontStyle.Regular);

            TextFont = new Font(epb.TextFontFamily, epb.TextFontSize, fontStyle);

            HasCornerAnchors    = epb.HasCornerAnchors;
            HasCenterAnchors    = epb.HasCenterAnchors;
            HasLeftRightAnchors = epb.HasLeftRightAnchors;
            HasTopBottomAnchors = epb.HasTopBottomAnchors;

            HasCornerConnections    = epb.HasCornerConnections;
            HasCenterConnections    = epb.HasCenterConnections;
            HasLeftRightConnections = epb.HasLeftRightConnections;
            HasTopBottomConnections = epb.HasTopBottomConnections;
        }
コード例 #10
0
 public ToolboxAssemblyAgentReceptorShape(Canvas canvas) : base(canvas)
 {
     Text = "Rcptr";
     TextFont.Dispose();
     TextFont        = new Font(FontFamily.GenericSansSerif, 6);
     FillBrush.Color = Color.LightGreen;
 }
コード例 #11
0
        void IDisposable.Dispose()
        {
            lock (this)
            {
                if (_disposed || _isPresets)//不销毁预置对象
                {
                    return;
                }

                _border.Dispose();
                BackBrush = null;
                if (!_keepFont && TextFont != null && !TextFont.IsSystemFont)
                {
                    TextFont.Dispose();
                    TextFont = null;
                }
                if (!_keepIcon && Icon != null)
                {
                    Icon.Dispose();
                    Icon = null;
                }

                _disposed = true;
            }
        }
コード例 #12
0
 public WorkflowBox(Canvas canvas) : base(canvas)
 {
     Text = "WF";
     TextFont.Dispose();
     TextFont        = new Font(FontFamily.GenericSansSerif, 6);
     TextAlign       = ContentAlignment.TopCenter;
     FillBrush.Color = Color.LightBlue;
 }
コード例 #13
0
 public ToolboxAssemblyReferenceBox(Canvas canvas) : base(canvas)
 {
     Text = "AssyRef";
     TextFont.Dispose();
     TextFont             = new Font(FontFamily.GenericSansSerif, 6);
     TextAlign            = ContentAlignment.MiddleCenter;
     HasCornerConnections = false;
 }
コード例 #14
0
 public AssemblyReferenceBox(Canvas canvas) : base(canvas)
 {
     Text = "AssyRef";
     TextFont.Dispose();
     TextFont  = new Font(FontFamily.GenericSansSerif, 6);
     TextAlign = ContentAlignment.TopCenter;
     Filename  = "";
 }
コード例 #15
0
        private void validate()
        {
            if (textLayout != null)
            {
                return;
            }

            if (font == null || font.Name != FontName || currentFontSize != FontSize || currentScaling != Scaling)
            {
                font?.Dispose();
                font = DrawState.TextFontManager.GetTextFont(FontName, FontSize, Scaling);

                currentFontSize = FontSize;
                currentScaling  = Scaling;
            }

            textLayout = new TextLayout(Text ?? "", font, alignment, trimming, MaxSize * scaling);
        }
コード例 #16
0
 public AgentReceptorShape(Canvas canvas) : base(canvas)
 {
     enabled = true;
     Text    = "Rcptr";
     TextFont.Dispose();
     TextFont            = new Font(FontFamily.GenericSansSerif, 6);
     FillBrush.Color     = Color.LightGreen;
     HasCenterAnchor     = true;
     HasCenterConnection = true;
 }
コード例 #17
0
 private void FreeFont()
 {
     if (TextFont != null)
     {
         TextFont.Dispose();
         TextFont = null;
     }
     if (TextBrush != null)
     {
         TextBrush.Dispose();
         TextBrush = null;
     }
 }
コード例 #18
0
 public override void Free()
 {
     if (TextFont != null)
     {
         TextFont.Dispose();
         TextFont = null;
     }
     if (TextBrush != null)
     {
         TextBrush.Dispose();
         TextBrush = null;
     }
 }
コード例 #19
0
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing && (components != null))
     {
         components.Dispose();
         TextFormat.Dispose();
         compassBitmap.Dispose();
         TextBrush.Dispose();
         TextFont.Dispose();
         Rose2.Dispose();
         Rose1.Dispose();
     }
     base.Dispose(disposing);
 }
コード例 #20
0
        public void Dispose()
        {
            if (TextFont != null)
            {
                TextFont.Dispose();
            }

            if (TitleFont != null)
            {
                TitleFont.Dispose();
            }

            if (Image != null)
            {
                Image.Dispose();
            }
        }
コード例 #21
0
        public static void Unload()
        {
            Subtitle.Dispose();
            Title.Dispose();
            Splash.Dispose();
            MapSheet.Dispose();
            MiniHP.Dispose();
            HPMenu.Dispose();
            Buttons.Dispose();
            Shadows.Dispose();
            Darkness.Dispose();
            BattleFactors.Dispose();
            Strip.Dispose();
            Cursor.Dispose();
            Arrows.Dispose();
            PicBorder.Dispose();
            MenuBorder.Dispose();
            MenuBG.Dispose();

            tileCache.Clear();
            objectCache.Clear();
            bgCache.Clear();
            itemCache.Clear();
            iconCache.Clear();
            vfxCache.Clear();
            portraitCache.Clear();
            spriteCache.Clear();

            DivTex.Dispose();

            EXPFont.Dispose();
            HealFont.Dispose();
            DamageFont.Dispose();
            DungeonFont.Dispose();
            TextFont.Dispose();

            SysFont.Dispose();

            Pixel.Dispose();
            defaultTex.Dispose();

            Loaded = false;
            //Notify script engine
            LuaEngine.Instance.OnGraphicsUnload();
        }
コード例 #22
0
        public virtual void Dispose(bool disposing)
        {
            if (!disposed)
            {
                disposed = true;

                if (disposing)
                {
                    BorderPen.Dispose();
                    FillBrush.Dispose();
                    background?.Dispose();
                    selectionPen.Dispose();
                    altSelectionPen.Dispose();
                    anchorPen.Dispose();
                    anchorBrush.Dispose();
                    TextFont.Dispose();
                    connectionPointPen.Dispose();
                }
            }
        }
コード例 #23
0
 public virtual void Grid(System.Windows.Forms.PaintEventArgs e)
 {
     try
     {
         SolidBrush.Color = GridColor;
         e.Graphics.FillRectangle(SolidBrush, XPos, YPos, Width, Height);
         if (ShowMinMax)
         {
             bool fontcreated = false;
             System.Globalization.NumberFormatInfo nfi = System.Globalization.NumberFormatInfo.CurrentInfo;
             System.Globalization.RegionInfo       ri  = System.Globalization.RegionInfo.CurrentRegion;
             if (TextFont == null)
             {
                 TextFont    = new System.Drawing.Font(System.Drawing.FontFamily.GenericSansSerif.Name, 7, System.Drawing.FontStyle.Bold);
                 fontcreated = true;
             }
             if (IsCurrency)
             {
                 e.Graphics.DrawString(YMax.ToString("n", nfi) + " " + ri.ISOCurrencySymbol, TextFont, TextBrush, XPos, YPos);
                 e.Graphics.DrawString(YMin.ToString("n", nfi) + " " + ri.ISOCurrencySymbol, TextFont, TextBrush, XPos, YPos + Height - TextFont.Height);
             }
             else
             {
                 e.Graphics.DrawString(YMax.ToString("n", nfi), TextFont, TextBrush, XPos, YPos);
                 e.Graphics.DrawString(YMin.ToString("n", nfi), TextFont, TextBrush, XPos, YPos + Height - TextFont.Height);
             }
             if (fontcreated)
             {
                 TextFont.Dispose();
                 TextFont = null;
             }
         }
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
コード例 #24
0
 public void Dispose()
 {
     if (RectanglePen != null)
     {
         RectanglePen.Dispose();
     }
     if (RectangleBrush != null)
     {
         RectangleBrush.Dispose();
     }
     if (TextFont != null)
     {
         TextFont.Dispose();
     }
     if (TextBrush != null)
     {
         TextBrush.Dispose();
     }
     if (TextShadowBrush != null)
     {
         TextShadowBrush.Dispose();
     }
 }
コード例 #25
0
 public Receptor(Canvas canvas) : base(canvas)
 {
     Text = "Rcptr";
     TextFont.Dispose();
     TextFont = new Font(FontFamily.GenericSansSerif, 6);
 }
コード例 #26
0
 public ToolboxListBoxShape(Canvas canvas) : base(canvas)
 {
     TextFont.Dispose();
     TextFont = new Font(FontFamily.GenericSansSerif, 8);
 }
コード例 #27
0
ファイル: ToolboxText.cs プロジェクト: jmptrader/FlowSharp
 public ToolboxText(Canvas canvas) : base(canvas)
 {
     TextFont.Dispose();
     TextFont = new Font(FontFamily.GenericSansSerif, 20);
 }
コード例 #28
0
ファイル: Painter.cs プロジェクト: asiryan/UMapx
 /// <summary>
 /// Disposes painter class.
 /// </summary>
 public void Dispose()
 {
     BoxPen.Dispose();
     PointPen.Dispose();
     TextFont.Dispose();
 }
コード例 #29
0
 public void Dispose()
 {
     TextFont?.Dispose();
     TitleFont?.Dispose();
     Image?.Dispose();
 }