| ofs | hex dump | ascii |
|---|
| 0000 | 4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00 b8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 | MZ......................@....... |
| 0020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 01 00 00 | ................................ |
| 0040 | 0e 1f ba 0e 00 b4 09 cd 21 b8 01 4c cd 21 54 68 69 73 20 70 72 6f 67 72 61 6d 20 63 61 6e 6e 6f | ........!..L.!This.program.canno |
| 0060 | 74 20 62 65 20 72 75 6e 20 69 6e 20 44 4f 53 20 6d 6f 64 65 2e 0d 0d 0a 24 00 00 00 00 00 00 00 | t.be.run.in.DOS.mode....$....... |
| 0080 | 5e f5 3a b5 1a 94 54 e6 1a 94 54 e6 1a 94 54 e6 89 f4 57 e7 1d 94 54 e6 89 f4 51 e7 01 94 54 e6 | ^.:...T...T...T...W...T...Q...T. |
| 00a0 | 89 f4 50 e7 11 94 54 e6 89 f4 55 e7 1e 94 54 e6 38 f4 55 e7 1e 94 54 e6 1a 94 54 e6 1e 94 54 e6 | ..P...T...U...T.8.U...T...T...T. |
| 00c0 | 40 51 99 e6 18 94 54 e6 a1 f5 55 e7 1d 94 54 e6 1a 94 55 e6 2e 95 54 e6 a1 f5 51 e7 03 94 54 e6 | @Q....T...U...T...U...T...Q...T. |
| 00e0 | a1 f5 54 e7 1b 94 54 e6 a1 f5 ab e6 1b 94 54 e6 1a 94 c3 e6 1b 94 54 e6 a1 f5 56 e7 1b 94 54 e6 | ..T...T.......T.......T...V...T. |
| 0100 | 52 69 63 68 1a 94 54 e6 00 00 00 00 00 00 00 00 50 45 00 00 4c 01 09 00 e4 44 e3 59 00 00 00 00 | Rich..T.........PE..L....D.Y.... |
| 0120 | 00 00 00 00 e0 00 02 21 0b 01 0e 0a 00 04 16 00 00 cc 05 00 00 00 00 00 e5 1b 00 00 00 10 00 00 | .......!........................ |
| 0140 | 00 20 16 00 00 00 00 10 00 10 00 00 00 02 00 00 06 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 | ................................ |
| 0160 | 00 30 1c 00 00 04 00 00 00 00 00 00 03 00 40 01 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 | .0............@................. |
| 0180 | 00 00 00 00 10 00 00 00 50 bd 19 00 fa f6 00 00 ec 06 1b 00 a0 00 00 00 00 70 1b 00 f6 07 00 00 | ........P................p...... |
| 01a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 1b 00 90 91 00 00 40 e3 17 00 38 00 00 00 | ........................@...8... |
| 01c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f8 e6 17 00 18 00 00 00 78 e3 17 00 40 00 00 00 | ........................x...@... |
| 01e0 | 00 00 00 00 00 00 00 00 00 00 1b 00 ec 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0200 | 00 00 00 00 00 00 00 00 2e 74 65 78 74 00 00 00 4e e5 15 00 00 10 00 00 00 e6 15 00 00 04 00 00 | .........text...N............... |
| 0220 | 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 60 49 50 50 43 4f 44 45 00 eb 1c 00 00 00 00 16 00 | ............using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace RealTimeGraphEx.Components
{
public abstract class ComponentBase : UserControl
{
public ComponentLocationEnum Location
{
get { return (ComponentLocationEnum)GetValue(LocationProperty); }
set { SetValue(LocationProperty, value); }
}
public static readonly DependencyProperty LocationProperty =
DependencyProperty.Register("Location", typeof(ComponentLocationEnum), typeof(ComponentBase), new PropertyMetadata(ComponentLocationEnum.None));
public RealTimeGraphExBase Graph
{
get { return (RealTimeGraphExBase)GetValue(GraphProperty); }
set { SetValue(GraphProperty, value); }
}
public static readonly DependencyProperty GraphProperty =
DependencyProperty.Register("Graph", typeof(RealTimeGraphExBase), typeof(ComponentBase), new PropertyMetadata(null));
public ComponentBase()
{
this.Loaded += ComponentBase_Loaded;
}
private void ComponentBase_Loaded(object sender, RoutedEventArgs e)
{
if (Graph != null)
{
Graph.ZoomComplete += OnGraphZoomComplete;
Graph.PanningComplete += OnGraphPanningComplete;
Graph.MinMaxChanged += Graph_MinMaxChanged;
Render(Graph);
}
}
private void Graph_MinMaxChanged(object sender, EventArgs e)
{
OnGraphMinMaxChanged();
}
public abstract void Render(RealTimeGraphExBase graph, bool animate = false);
public void RemoveFromParent()
{
var parent = this.Parent;
var child = this;
var panel = parent as Panel;
if (panel != null)
{
panel.Children.Remove(child);
return;
}
var decorator = parent as Decorator;
if (decorator != null)
{
if (decorator.Child == child)
{
decorator.Child = null;
}
return;
}
var contentPresenter = parent as ContentPresenter;
if (contentPresenter != null)
{
if (contentPresenter.Content == child)
{
contentPresenter.Content = null;
}
return;
}
var contentControl = parent as ContentControl;
if (contentControl != null)
{
if (contentControl.Content == child)
{
contentControl.Content = null;
}
return;
}
// maybe more
}
protected virtual void OnGraphZoomComplete(Point transformOrigin, double scaleX, double scaleY)
{
}
protected virtual void OnGraphPanningComplete(Point translate)
{
}
protected virtual void OnGraphMinMaxChanged()
{
}
}
}
|