You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.0 KiB
C#
73 lines
2.0 KiB
C#
using GeoSigma.SigmaDrawerElement;
|
|
using SigmaDrawerElement;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing.Design;
|
|
using System.Drawing.Drawing2D;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms.Design;
|
|
|
|
namespace GeoSigma.SigmaDrawerStyle
|
|
{
|
|
|
|
public class PropertyEditorCommonDataTrackSetData : UITypeEditor
|
|
{
|
|
|
|
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
|
|
{
|
|
return UITypeEditorEditStyle.Modal;
|
|
}
|
|
|
|
public override bool GetPaintValueSupported(ITypeDescriptorContext context)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public override void PaintValue(PaintValueEventArgs e)
|
|
{
|
|
if (e.Value is DataItems style)
|
|
{
|
|
var g = e.Graphics;
|
|
var rect = e.Bounds;
|
|
}
|
|
}
|
|
|
|
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
|
|
{
|
|
if (!(value is DataItems dataItems))
|
|
{
|
|
return value;
|
|
}
|
|
|
|
IWindowsFormsEditorService edSvc = provider?.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
|
|
if (edSvc == null)
|
|
{
|
|
return value;
|
|
}
|
|
|
|
if (context.Instance is WellCommonDataTrack commonDataTrack)
|
|
{
|
|
|
|
}
|
|
else
|
|
return value;
|
|
|
|
using (var editorForm = new FrmTrackCommonDataSetData(dataItems) { StartPosition = FormStartPosition.CenterScreen })
|
|
{
|
|
if (edSvc.ShowDialog(editorForm) == DialogResult.OK)
|
|
{
|
|
DataItems titems = new DataItems();
|
|
titems.SetValue(editorForm.m_trackDataItems);
|
|
|
|
return titems;
|
|
}
|
|
}
|
|
|
|
return value;
|
|
}
|
|
}
|
|
}
|