Example #1
0
        protected void CreateOutOfOfficeNotification()
        {
            this.shouldShowOofDialog = ((base.UserContext.MailboxSession.Mailbox.TryGetProperty(MailboxSchema.MailboxOofState) as bool?) ?? false);
            if (!this.shouldShowOofDialog || base.UserContext.IsWebPartRequest)
            {
                return;
            }
            UserOofSettings userOofSettings = null;

            try
            {
                userOofSettings = UserOofSettings.GetUserOofSettings(base.UserContext.MailboxSession);
            }
            catch (QuotaExceededException ex)
            {
                ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "BasicMessageView.CreateOutOfOfficeNotification: Failed. Exception: {0}", ex.Message);
                return;
            }
            switch (userOofSettings.OofState)
            {
            case OofState.Enabled:
                this.shouldShowOofDialog = base.UserContext.MessageViewFirstRender;
                break;

            case OofState.Scheduled:
            {
                this.shouldShowOofDialog = false;
                if (RenderingFlags.HideOutOfOfficeInfoBar(base.UserContext))
                {
                    return;
                }
                DateTime utcNow = DateTime.UtcNow;
                DateTime t      = DateTime.MinValue;
                DateTime t2     = DateTime.MinValue;
                if (userOofSettings.Duration != null)
                {
                    t  = userOofSettings.Duration.StartTime;
                    t2 = userOofSettings.Duration.EndTime;
                }
                if (utcNow > t && t2 > utcNow)
                {
                    ExDateTime exDateTime = new ExDateTime(base.UserContext.TimeZone, userOofSettings.Duration.EndTime);
                    SanitizingStringBuilder <OwaHtml> sanitizingStringBuilder = new SanitizingStringBuilder <OwaHtml>();
                    sanitizingStringBuilder.AppendFormat(LocalizedStrings.GetHtmlEncoded(-1261886615), new object[]
                        {
                            exDateTime.ToLongDateString() + " " + exDateTime.ToString(base.UserContext.UserOptions.TimeFormat)
                        });
                    sanitizingStringBuilder.Append(" <a href=# onclick=\"onClkHdOof()\">");
                    sanitizingStringBuilder.Append(LocalizedStrings.GetNonEncoded(1303059585));
                    sanitizingStringBuilder.Append("</a>");
                    base.Infobar.AddMessageHtml(sanitizingStringBuilder.ToSanitizedString <SanitizedHtmlString>(), InfobarMessageType.Informational);
                }
                return;
            }

            default:
                this.shouldShowOofDialog = false;
                return;
            }
        }
        //public static bool HighQuality = true;

        public static void SetDefaultRenderingOptions(RenderingFlags flags = RenderingFlags.HighQuality)
        {
            //GL.Translate (0, 0, 0);

            GL.Disable(EnableCap.DepthTest);
            GL.Disable(EnableCap.CullFace);
            //GL.Disable(EnableCap.LineStipple);

            GL.Disable(EnableCap.Texture2D);
            GL.Disable(EnableCap.Texture1D);
            GL.Disable(EnableCap.TextureRectangle);

            // Blending
            GL.Enable(EnableCap.AlphaTest);
            GL.Enable(EnableCap.Blend);
            GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);

            // high quality

            if (flags.HasFlag(RenderingFlags.MultiSample))
            {
                GL.Enable(EnableCap.Multisample);
            }
            else
            {
                GL.Disable(EnableCap.Multisample);
            }

            if (flags.HasFlag(RenderingFlags.Smooth))
            {
                GL.ShadeModel(ShadingModel.Smooth);

                GL.Enable(EnableCap.PointSmooth);
                GL.Hint(HintTarget.PointSmoothHint, HintMode.Nicest);

                GL.Enable(EnableCap.LineSmooth);
                GL.Hint(HintTarget.LineSmoothHint, HintMode.Nicest);

                GL.Enable(EnableCap.PolygonSmooth);
                GL.Hint(HintTarget.PolygonSmoothHint, HintMode.Nicest);
            }
            else
            {
                GL.Disable(EnableCap.PointSmooth);
                //GL.Hint(HintTarget.PointSmoothHint, HintMode.Nicest);

                GL.Disable(EnableCap.LineSmooth);
                //GL.Hint(HintTarget.LineSmoothHint, HintMode.Nicest);

                GL.Disable(EnableCap.PolygonSmooth);
                //GL.Hint(HintTarget.PolygonSmoothHint, HintMode.Nicest);
            }
        }
Example #3
0
 // Ensure to always call it with a parameter
 // e.g. new PaintWrapper(null)
 public PaintWrapper(RenderingFlags flags = RenderingFlags.HighQuality)
 {
     GL.PushMatrix();
     GL.LoadIdentity();
     OpenTkExtensions.SetDefaultRenderingOptions(flags);
 }