void createHandle() { handle = OS.gcnew_StackPanel(); // handle = OS.gcnew_ContentControl (); if (handle == 0) error(SWT.ERROR_NO_HANDLES); int animation = OS.gcnew_DoubleAnimationUsingKeyFrames(); if (animation == 0) error(SWT.ERROR_NO_HANDLES); int timespan = OS.gcnew_TimeSpan(6000000); if (timespan == 0) error(SWT.ERROR_NO_HANDLES); int duration = OS.gcnew_Duration(timespan); if (duration == 0) error(SWT.ERROR_NO_HANDLES); int repeatBehavior = OS.RepeatBehavior_Forever(); OS.Timeline_AutoReverse(animation, true); OS.Timeline_Duration(animation, duration); OS.Timeline_RepeatBehavior(animation, repeatBehavior); int keyFrames = OS.DoubleAnimationUsingKeyFrames_KeyFrames(animation); int keyTime = OS.KeyTime_Uniform(); int keyFrame0 = OS.gcnew_DiscreteDoubleKeyFrame(0, keyTime); int keyFrame1 = OS.gcnew_DiscreteDoubleKeyFrame(0, keyTime); OS.DoubleKeyFrameCollection_Add(keyFrames, keyFrame0); OS.DoubleKeyFrameCollection_Add(keyFrames, keyFrame1); int opacityProperty = OS.UIElement_OpacityProperty(); OS.UIElement_BeginAnimation(handle, opacityProperty, animation); int brush = OS.SystemColors_ControlTextBrush(); OS.Panel_Background(handle, brush); imageHandle = OS.gcnew_Image(); if (imageHandle == 0) error(SWT.ERROR_NO_HANDLES); OS.Image_Stretch(imageHandle, OS.Stretch_None); OS.UIElement_Visibility(imageHandle, OS.Visibility_Collapsed); int children = OS.Panel_Children(handle); OS.UIElementCollection_Add(children, imageHandle); OS.GCHandle_Free(children); hide(); OS.GCHandle_Free(brush); OS.GCHandle_Free(opacityProperty); OS.GCHandle_Free(keyFrames); OS.GCHandle_Free(keyTime); OS.GCHandle_Free(keyFrame0); OS.GCHandle_Free(keyFrame1); OS.GCHandle_Free(animation); OS.GCHandle_Free(duration); OS.GCHandle_Free(timespan); OS.GCHandle_Free(repeatBehavior); }