public Command(Viking.UI.Controls.SectionViewerControl parent) { this.Parent = parent; MyMouseClick = new MouseEventHandler(this.OnMouseClick); MyMouseDoubleClick = new MouseEventHandler(this.OnMouseDoubleClick); MyMouseDown = new MouseEventHandler(this.OnMouseDown); MyMouseUp = new MouseEventHandler(this.OnMouseUp); MyMouseWheel = new MouseEventHandler(this.OnMouseWheel); MyMouseMove = new MouseEventHandler(this.OnMouseMove); MyMouseHover = new EventHandler(this.OnMouseHover); MyMouseLeave = new EventHandler(this.OnMouseLeave); MyMouseEnter = new EventHandler(this.OnMouseEnter); MyKeyPress = new KeyPressEventHandler(this.OnKeyPress); MyKeyDown = new KeyEventHandler(this.OnKeyDown); Parent.MouseClick += MyMouseClick; Parent.MouseDoubleClick += MyMouseDoubleClick; Parent.MouseDown += MyMouseDown; Parent.MouseUp += MyMouseUp; Parent.MouseWheel += MyMouseWheel; Parent.MouseMove += MyMouseMove; Parent.MouseHover += MyMouseHover; Parent.MouseLeave += MyMouseLeave; Parent.MouseEnter += MyMouseEnter; Parent.KeyPress += MyKeyPress; Parent.KeyDown += MyKeyDown; }
public LocationLinksViewModel(Viking.UI.Controls.SectionViewerControl Parent) { this.parent = Parent; NotifyCollectionChangedEventManager.AddListener(Store.LocationLinks, this); NotifyCollectionChangedEventManager.AddListener(Store.Locations, this); }
public SectionAnnotationViewModel(SectionViewModel section, Viking.UI.Controls.SectionViewerControl Parent) { this.parent = Parent; this.Section = section; Store.Locations.OnAddUpdateRemoveKey += new AddUpdateRemoveKeyEventHandler(OnStoreAddRemoveKey); Store.Locations.OnAllUpdatesCompleted += new OnAllUpdatesCompletedEventHandler(OnAllUpdatesCompleted); LocationLinkDeletedEventHandler = new EventHandler(OnLocationLinkDeleted); StructureLinkDeletedEventHandler = new EventHandler(OnStructureLinkDeleted); }
public SectionLocationsViewModel(SectionViewModel section, Viking.UI.Controls.SectionViewerControl Parent) { this.parent = Parent; Trace.WriteLine("Create SectionLocationsViewModel for " + section.Number.ToString()); this.Section = section; GridRectangle bounds = AnnotationOverlay.SectionBounds(parent, parent.Section.Number); if (Locations == null) Locations = new QuadTree<Location_CanvasViewModel>(bounds); LocationsForStructure = new ConcurrentDictionary<long, ConcurrentDictionary<long, Location_CanvasViewModel>>(); StructureLinksSearch = new LineSearchGrid<StructureLink>(bounds, 10000); CollectionChangedEventManager.AddListener(Store.Structures, this); CollectionChangedEventManager.AddListener(Store.StructureLinks, this); }
public void SetParent(Viking.UI.Controls.SectionViewerControl parent) { //I'm only expecting this to be set once Debug.Assert(_Parent == null, "Not expecting parent to be set twice, OK to ignore, but annotation display may be incorrect"); this._Parent = parent; //Load the locations for the current sections this._Parent.OnSectionChanged += new SectionChangedEventHandler(this.OnSectionChanged); this._Parent.OnSectionTransformChanged += new TransformChangedEventHandler(this.OnSectionTransformChanged); this._Parent.OnVolumeTransformChanged += new TransformChangedEventHandler(this.OnVolumeTransformChanged); this._Parent.OnReferenceSectionChanged += new EventHandler(this.OnReferenceSectionChanged); this._Parent.MouseDown += new MouseEventHandler(this.OnMouseDown); this._Parent.MouseMove += new MouseEventHandler(this.OnMouseMove); this._Parent.MouseUp += new MouseEventHandler(this.OnMouseUp); this._Parent.KeyDown += new KeyEventHandler(this.OnKeyDown); this._Parent.KeyUp += new KeyEventHandler(this.OnKeyUp); // AnnotationCache.parent = parent; GlobalPrimitives.CircleTexture = parent.LoadTextureWithAlpha("Circle", "CircleMask"); //parent.Content.Load<Texture2D>("Circle"); GlobalPrimitives.UpArrowTexture = parent.LoadTextureWithAlpha("UpArrowV2", "UpArrowMask"); //parent.Content.Load<Texture2D>("Circle"); linksView = new LocationLinksViewModel(parent); LoadSectionAnnotations(); }
void Viking.Common.ISectionOverlayExtension.SetParent(Viking.UI.Controls.SectionViewerControl parent) { _parent = parent; StarTexture = parent.Content.Load<Texture2D>("Star"); }