protected virtual void ConnectWrapped() { WrappedObject.AddNotification("id", NotifyIdHandler); if (WrappedObject is Cdn.Annotatable) { WrappedObject.AddNotification("annotation", NotifyAnnotationHandler); } WrappedObject.VariableAdded += HandleVariableAdded; WrappedObject.VariableRemoved += HandleVariableRemoved; WrappedObject.Copied += HandleCopied; WrappedObject.TemplateApplied += HandleTemplateApplied; WrappedObject.TemplateUnapplied += HandleTemplateUnapplied; if (WrappedObject.SupportsLocation()) { AddLocationNotifification(); Moved += delegate(object sender, EventArgs e) { int x; int y; WrappedObject.GetLocation(out x, out y); if ((int)Allocation.X != x || (int)Allocation.Y != y) { RemoveLocationNotification(); WrappedObject.SetLocation((int)Allocation.X, (int)Allocation.Y); AddLocationNotifification(); } }; } }
private void OnLocationChanged(object source, GLib.NotifyArgs args) { int x; int y; WrappedObject.GetLocation(out x, out y); Allocation.X = x; Allocation.Y = y; }