public NoScrollTreeViewItem() { if (NoScrollTreeViewItem.requestBringIntoViewEventHandler_0 == null) { NoScrollTreeViewItem.requestBringIntoViewEventHandler_0 = new RequestBringIntoViewEventHandler(NoScrollTreeViewItem.smethod_0); } base.RequestBringIntoView += NoScrollTreeViewItem.requestBringIntoViewEventHandler_0; }
public NoScrollTreeViewItem() { if (NoScrollTreeViewItem._requestBringIntoViewEventHandler == null) { NoScrollTreeViewItem._requestBringIntoViewEventHandler = new RequestBringIntoViewEventHandler(NoScrollTreeViewItem.BringIntoView); } base.RequestBringIntoView += NoScrollTreeViewItem._requestBringIntoViewEventHandler; }
internal static new void InvokeHandler(Delegate handler, IntPtr sender, IntPtr args) { RequestBringIntoViewEventHandler handler_ = (RequestBringIntoViewEventHandler)handler; if (handler_ != null) { handler_(Extend.GetProxy(sender, false), new RequestBringIntoViewEventArgs(args, false)); } }
/// <summary> /// The mechanism used to call the type-specific handler on the /// target. /// </summary> /// <param name="genericHandler"> /// The generic handler to call in a type-specific way. /// </param> /// <param name="genericTarget"> /// The target to call the handler on. /// </param> /// <ExternalAPI/> protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) { RequestBringIntoViewEventHandler handler = (RequestBringIntoViewEventHandler)genericHandler; handler(genericTarget, this); }
/// <summary> /// Clear the internal variables and events which are related to the annotation. /// The method will be called by IAnnotationComponent.RemoveAttachedAnnotation /// </summary> private void ClearAnnotation() { _attachedAnnotation.Annotation.CargoChanged -= new AnnotationResourceChangedEventHandler(OnAnnotationUpdated); _attachedAnnotation.Annotation.AuthorChanged -= new AnnotationAuthorChangedEventHandler(OnAuthorUpdated); _anchor.RemoveAttachedAnnotation(_attachedAnnotation); _sncAnnotation = null; _attachedAnnotation = null; RequestBringIntoView -= new RequestBringIntoViewEventHandler(OnRequestBringIntoView); }
/// <summary> /// The method sets an instance of the IAttachedAnnotation to the StickyNoteControl. /// It will be called by IAnnotationComponent.AddAttachedAnnotation. /// </summary> /// <param name="attachedAnnotation">The instance of the IAttachedAnnotation</param> private void SetAnnotation(IAttachedAnnotation attachedAnnotation) { SNCAnnotation sncAnnotation = new SNCAnnotation(attachedAnnotation.Annotation); // Retrieve the data type. Then set the StickyNote to correct type. // If we have empty data, we won't change the current StickyNote type. bool hasInkData = sncAnnotation.HasInkData; bool hasTextData = sncAnnotation.HasTextData; if (hasInkData && hasTextData) { throw new ArgumentException(SR.Get(SRID.InvalidStickyNoteAnnotation), "attachedAnnotation"); } else if (hasInkData) { _stickyNoteType = StickyNoteType.Ink; } else if (hasTextData) { _stickyNoteType = StickyNoteType.Text; } // If we already created a Content control, make sure it matches our new type or // gets recreated to match. if (Content != null) { EnsureStickyNoteType(); } //create cargo if it is a new Annotation so it is not considered as new next time if (sncAnnotation.IsNewAnnotation) { AnnotationResource cargo = new AnnotationResource(SNBConstants.MetaResourceName); attachedAnnotation.Annotation.Cargos.Add(cargo); } // Set the internal variables _attachedAnnotation = attachedAnnotation; _attachedAnnotation.Annotation.CargoChanged += new AnnotationResourceChangedEventHandler(OnAnnotationUpdated); _attachedAnnotation.Annotation.AuthorChanged += new AnnotationAuthorChangedEventHandler(OnAuthorUpdated); _sncAnnotation = sncAnnotation; _anchor.AddAttachedAnnotation(attachedAnnotation); // Update all value UpdateSNCWithAnnotation(SNCAnnotation.AllValues); // The internal data is just [....]'ed to the store. So, reset the dirty to false. IsDirty = false; //now check if the SN must be seen if ((_attachedAnnotation.AttachmentLevel & AttachmentLevel.StartPortion) == 0) { //we do not need to show the StickyNote SetValue(UIElement.VisibilityProperty, Visibility.Collapsed); } else { //if it is seen we need to take care about bringing into view when needed RequestBringIntoView += new RequestBringIntoViewEventHandler(OnRequestBringIntoView); } }
public NoScrollTreeViewItem() { RequestBringIntoViewEventHandler value = new RequestBringIntoViewEventHandler(this.method_0); base.RequestBringIntoView += value; }