예제 #1
0
        public void Run(IHostServer server, WebContext context, string callbackEndPoint, CancellationToken cancel)
        {
            if (null != Override)
            {
                if (Override(this, server, context))
                {
                    return;
                }
            }

            var error = GetError?.Invoke(this, server, context) ?? Error;

            if (null != error)
            {
                throw error;
            }

            var status  = GetStatus?.Invoke(this, server, context) ?? Status;
            var mime    = GetMime?.Invoke(this, server, context) ?? Mime;
            var content = GetContent?.Invoke(this, server, context) ?? Content;
            var timeout = GetTimeout?.Invoke(this, server, context) ?? Timeout;

            if (0 < timeout)
            {
                Thread.Sleep(timeout);
            }

            context.Finish(content, mime, status);
        }
 public void OnGetContent(IRibbonControl control, ref string content)
 {
     content = null;
     GetContent?.Invoke(control, ref content);
 }