Пример #1
0
        void PerformRequest( )
        {
            // do we need an impersonation token?
            if (IncludeImpersonationToken)
            {
                MobileAppApi.TryGetImpersonationToken(
                    delegate(string impersonationToken)
                {
                    // put the platform we're running
                    string fullUrl = Rock.Mobile.Util.Strings.Parsers.AddParamToURL(DisplayUrl, PrivateGeneralConfig.MobilePlatform);

                    // URL encode the value
                    NSString encodedUrlString = fullUrl.UrlEncode( );

                    // if we got a token, append it
                    NSUrl encodedUrl = null;
                    if (string.IsNullOrEmpty(impersonationToken) == false)
                    {
                        encodedUrl = new NSUrl(encodedUrlString + "&" + impersonationToken);
                    }
                    else
                    {
                        encodedUrl = new NSUrl(encodedUrlString);
                    }

                    LaunchWebview(encodedUrl);
                });
            }
            else
            {
                NSString encodedUrlString = DisplayUrl.UrlEncode( );
                NSUrl    encodedUrl       = new NSUrl(encodedUrlString);
                LaunchWebview(encodedUrl);
            }
        }
Пример #2
0
 public override void ToStream(Stream output)
 {
     output.Write(TLUtils.SignatureToBytes(Signature));
     Flags.ToStream(output);
     Id.ToStream(output);
     Url.ToStream(output);
     DisplayUrl.ToStream(output);
     ToStream(output, Type, Flags, (int)WebPageFlags.Type);
     ToStream(output, SiteName, Flags, (int)WebPageFlags.SiteName);
     ToStream(output, Title, Flags, (int)WebPageFlags.Title);
     ToStream(output, Description, Flags, (int)WebPageFlags.Description);
     ToStream(output, Photo, Flags, (int)WebPageFlags.Photo);
     ToStream(output, EmbedUrl, Flags, (int)WebPageFlags.Embed);
     ToStream(output, EmbedType, Flags, (int)WebPageFlags.Embed);
     ToStream(output, EmbedWidth, Flags, (int)WebPageFlags.EmbedSize);
     ToStream(output, EmbedHeight, Flags, (int)WebPageFlags.EmbedSize);
     ToStream(output, Duration, Flags, (int)WebPageFlags.Duration);
     ToStream(output, Author, Flags, (int)WebPageFlags.Author);
 }
Пример #3
0
 public override byte[] ToBytes()
 {
     return(TLUtils.Combine(
                TLUtils.SignatureToBytes(Signature),
                Flags.ToBytes(),
                Id.ToBytes(),
                Url.ToBytes(),
                DisplayUrl.ToBytes(),
                ToBytes(Type, Flags, (int)WebPageFlags.Type),
                ToBytes(SiteName, Flags, (int)WebPageFlags.SiteName),
                ToBytes(Title, Flags, (int)WebPageFlags.Title),
                ToBytes(Description, Flags, (int)WebPageFlags.Description),
                ToBytes(Photo, Flags, (int)WebPageFlags.Photo),
                ToBytes(EmbedUrl, Flags, (int)WebPageFlags.Embed),
                ToBytes(EmbedType, Flags, (int)WebPageFlags.Embed),
                ToBytes(EmbedWidth, Flags, (int)WebPageFlags.EmbedSize),
                ToBytes(EmbedHeight, Flags, (int)WebPageFlags.EmbedSize),
                ToBytes(Duration, Flags, (int)WebPageFlags.Duration),
                ToBytes(Author, Flags, (int)WebPageFlags.Author)));
 }