public CSharpClassBox(Canvas canvas) : base(canvas) { Text = ".cs"; TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 6); TextAlign = ContentAlignment.TopLeft; }
public ToolboxAssemblyAgentShape(Canvas canvas) : base(canvas) { Text = "Agent"; TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 6); FillBrush.Color = Color.PowderBlue; }
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; }
public SemanticInstance(Canvas canvas) : base(canvas) { TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 6); TextAlign = ContentAlignment.TopCenter; Text = "ST"; }
public SemanticTypeShape(Canvas canvas) : base(canvas) { Text = "SemType"; TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 6); FillBrush.Color = Color.LightGreen; }
protected override void DisposeManagedResources() { base.DisposeManagedResources(); textBrush.Dispose(); TextFont.Dispose(); backgroundBrush.Dispose(); }
public PythonFileBox(Canvas canvas) : base(canvas) { Text = ".py"; TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 6); TextAlign = ContentAlignment.TopCenter; }
public AssemblyBox(Canvas canvas) : base(canvas) { Text = "Assy"; TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 6); TextAlign = ContentAlignment.TopCenter; }
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; }
public ToolboxAssemblyAgentReceptorShape(Canvas canvas) : base(canvas) { Text = "Rcptr"; TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 6); FillBrush.Color = Color.LightGreen; }
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; } }
public WorkflowBox(Canvas canvas) : base(canvas) { Text = "WF"; TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 6); TextAlign = ContentAlignment.TopCenter; FillBrush.Color = Color.LightBlue; }
public ToolboxAssemblyReferenceBox(Canvas canvas) : base(canvas) { Text = "AssyRef"; TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 6); TextAlign = ContentAlignment.MiddleCenter; HasCornerConnections = false; }
public AssemblyReferenceBox(Canvas canvas) : base(canvas) { Text = "AssyRef"; TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 6); TextAlign = ContentAlignment.TopCenter; Filename = ""; }
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); }
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; }
private void FreeFont() { if (TextFont != null) { TextFont.Dispose(); TextFont = null; } if (TextBrush != null) { TextBrush.Dispose(); TextBrush = null; } }
public override void Free() { if (TextFont != null) { TextFont.Dispose(); TextFont = null; } if (TextBrush != null) { TextBrush.Dispose(); TextBrush = null; } }
/// <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); }
public void Dispose() { if (TextFont != null) { TextFont.Dispose(); } if (TitleFont != null) { TitleFont.Dispose(); } if (Image != null) { Image.Dispose(); } }
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(); }
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(); } } }
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; } }
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(); } }
public Receptor(Canvas canvas) : base(canvas) { Text = "Rcptr"; TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 6); }
public ToolboxListBoxShape(Canvas canvas) : base(canvas) { TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 8); }
public ToolboxText(Canvas canvas) : base(canvas) { TextFont.Dispose(); TextFont = new Font(FontFamily.GenericSansSerif, 20); }
/// <summary> /// Disposes painter class. /// </summary> public void Dispose() { BoxPen.Dispose(); PointPen.Dispose(); TextFont.Dispose(); }
public void Dispose() { TextFont?.Dispose(); TitleFont?.Dispose(); Image?.Dispose(); }