namespace FooEditEngine
{
- sealed class InlineChar : CallbackBase, DW.InlineObject
+ sealed class InlineChar : DW.InlineObject
{
DW.TextLayout Layout;
ColorBrushCollection brushes;
Color4 DefaultFore;
- public InlineChar(DW.Factory factory, DW.TextFormat format,ColorBrushCollection brushes, Color4 Fore, char c)
+ public InlineChar(DW.Factory factory, DW.TextFormat format, ColorBrushCollection brushes, Color4 Fore, char c)
{
- this.Layout = new DW.TextLayout(factory,c.ToString(),format,float.MaxValue,float.MaxValue);
+ this.Layout = new DW.TextLayout(factory, c.ToString(), format, float.MaxValue, float.MaxValue);
this.Layout.ReadingDirection = DW.ReadingDirection.LeftToRight;
this.AlternativeChar = c;
this.brushes = brushes;
{
get
{
- if(_Metrics == null)
+ if (_Metrics == null)
{
DW.InlineObjectMetrics value = new DW.InlineObjectMetrics();
value.Height = this.Layout.Metrics.Height;
{
get
{
- if(_OverhangMetrics == null)
+ if (_OverhangMetrics == null)
{
DW.OverhangMetrics value = new DW.OverhangMetrics();
DW.TextMetrics metrics = this.Layout.Metrics;
set;
}
- //disposeしてはいけないらしい
- //protected override void Dispose(bool disposing)
- //{
- // base.Dispose(disposing);
- // this.Layout.Dispose();
- //}
-
+ public void Dispose()
+ {
+ this.Layout.Dispose();
+ return;
+ }
}
- sealed class InlineTab : CallbackBase,DW.InlineObject
+ sealed class InlineTab : DW.InlineObject
{
double _TabWidth;
double LineHeight;
ColorBrushCollection brushes;
Color4 DefaultFore;
- public InlineTab(ColorBrushCollection brushes, Color4 Fore, double witdh,double lineHeight)
+ public InlineTab(ColorBrushCollection brushes, Color4 Fore, double witdh, double lineHeight)
{
this._TabWidth = witdh;
this.LineHeight = lineHeight;
{
get
{
- if(_Metrics == null)
+ if (_Metrics == null)
{
DW.InlineObjectMetrics value = new DW.InlineObjectMetrics();
value.Width = (float)this._TabWidth;
set;
}
+ public void Dispose()
+ {
+ }
}
}
{
if (c == '\t')
{
- this.InlineTabs = new MultiSet<double,InlineTab>();
+ this.InlineTabs = new MultiSet<double, InlineTab>();
}
else
{
}
set
{
- this._TabWidth = value;
- if(this.InlineTabs != null)
+ this._TabWidth = value;
+ if (this.InlineTabs != null)
this.InlineTabs.Clear();
}
}
- public DW.InlineObject Get(MyTextLayout layout,int index, string str)
+ public DW.InlineObject Get(MyTextLayout layout, int index, string str)
{
if (str[index] == '\t')
{
collection = new List<InlineTab>();
D2D.SolidColorBrush brush = this.Brushes.Get(this.Fore);
for (int i = 0; i < DuplicateCount; i++)
- collection.Add(new InlineTab(this.Brushes, this.Fore, width,layout.Height));
+ collection.Add(new InlineTab(this.Brushes, this.Fore, width, layout.Height));
this.InlineTabs.Add(width, collection);
}
return collection[index % DuplicateCount];
public void Clear()
{
- if(this.InlineChars != null)
+ if (this.InlineChars != null)
this.InlineChars.Clear();
- if(this.InlineTabs != null)
+ if (this.InlineTabs != null)
this.InlineTabs.Clear();
}
return this.Collection.TryGetValue(key, out value);
}
- public J Get(T key,int index)
+ public J Get(T key, int index)
{
return this.Collection[key][index];
}
public void Clear()
{
- /*
- * Dispose()すると落ちる
foreach (List<J> list in this.Collection.Values)
foreach (J value in list)
value.Dispose();
- */
this.Collection.Clear();
}
namespace FooEditEngine
{
- class D2DRenderBase: D2DRenderCommon,IDisposable
+ class D2DRenderBase : D2DRenderCommon, IDisposable
{
public new const int MiniumeWidth = 40; //これ以上ないと誤操作が起こる
{
this.Brushes.Clear();
this.Strokes.Clear();
- //ここでDispose()する必要はない。すると落ちる
- //if (this.textRender != null)
- // this.textRender.Dispose();
+ if (this.textRender != null)
+ this.textRender.Dispose();
if (this.D2DDevice != null)
this.D2DDevice.Dispose();
if (this.D2DContext != null)
return false;
}
- public void DrawOneLine(Document doc,LineToIndexTable lti, int row, double x, double y)
+ public void DrawOneLine(Document doc, LineToIndexTable lti, int row, double x, double y)
{
this.DrawOneLine(doc,
lti,
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="SharpDX">
- <Version>4.2.0</Version>
+ <Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="SharpDX.Direct2D1">
- <Version>4.2.0</Version>
+ <Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="SharpDX.Direct3D11">
- <Version>4.2.0</Version>
+ <Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="SharpDX.DXGI">
- <Version>4.2.0</Version>
+ <Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="SharpDX.Mathematics">
- <Version>4.2.0</Version>
+ <Version>4.0.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
FontStyle fontStyle;
D3DImage imageSource;
- public D2DRender(FooTextBox textbox, double width, double height,Image image)
+ public D2DRender(FooTextBox textbox, double width, double height, Image image)
{
this.fontFamily = textbox.FontFamily;
this.fontSize = textbox.FontSize;
set
{
this.fontWeigth = value;
- this.InitTextFormat(this.fontFamily.Source, (float)this.fontSize, this.GetDWFontWeigth(value),this.GetDWFontStyle(this.fontStyle));
+ this.InitTextFormat(this.fontFamily.Source, (float)this.fontSize, this.GetDWFontWeigth(value), this.GetDWFontStyle(this.fontStyle));
}
}
this.ConstructRenderAndResource(width, height);
}
- public void DrawContent(EditView view,bool IsEnabled,Rectangle updateRect)
+ public void DrawContent(EditView view, bool IsEnabled, Rectangle updateRect)
{
if (this.imageSource.IsFrontBufferAvailable)
{
}
}
- public void DrawOneLine(Document doc,LineToIndexTable lti, int row, double x, double y)
+ public void DrawOneLine(Document doc, LineToIndexTable lti, int row, double x, double y)
{
PreDrawOneLineHandler PreDrawOneLine = null;
);
}
- private void DrawImeConversionLine(MyTextLayout layout,LineToIndexTable lti,int row,double x,double y)
+ private void DrawImeConversionLine(MyTextLayout layout, LineToIndexTable lti, int row, double x, double y)
{
using (Unlocker locker = this.store.LockDocument(false))
{
private Color4? GetColor4(TF_DA_COLOR cr)
{
COLORREF colorref;
- switch(cr.type)
+ switch (cr.type)
{
case TF_DA_COLORTYPE.TF_CT_SYSCOLOR:
colorref = new COLORREF(NativeMethods.GetSysColor((int)cr.indexOrColorRef));
this.cachedBitMap.Dispose();
this.Brushes.Clear();
this.Strokes.Clear();
- //ここでDispose()すると落ちる
- //if (this.textRender != null)
- // this.textRender.Dispose();
+ if (this.textRender != null)
+ this.textRender.Dispose();
if (this.texture != null)
this.texture.Dispose();
if (this.surface != null)
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="SharpDX.Direct2D1">
- <Version>4.2.0</Version>
+ <Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="SharpDX.Direct3D11">
- <Version>4.2.0</Version>
+ <Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="SharpDX.Direct3D9">
- <Version>4.2.0</Version>
+ <Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="SharpDX.Mathematics">
- <Version>4.2.0</Version>
+ <Version>4.0.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="..\..\Core\Core.projitems" Label="Shared" />