Exemplo n.º 1
0
        private void ShareReferralHandler(ShareOption option)
        {
            if (Account == null)
            {
                return;
            }

            if (option == ShareOption.Email)
            {
                var task = new EmailComposeTask();
                task.Subject = "Get Dropbox";
                task.Body    = string.Format("I would like you to join Dropbox, here is the referral link {0}",
                                             Account.referral_link);
                task.Show();
            }

            if (option == ShareOption.Social)
            {
                var task = new ShareLinkTask
                {
                    LinkUri = new Uri(Account.referral_link),
                    Message = "Join the awesome cloud storage service.",
                    Title   = "Dropbox register"
                };
                task.Show();
            }
        }
Exemplo n.º 2
0
        void ShareHandler(ShareOption option)
        {
            string body = string.Format("I am sharing this link with you {0}", ShareLink);

            if (option == ShareOption.Social)
            {
                var task = new ShareLinkTask
                {
                    LinkUri = new Uri(ShareLink),
                    Title   = MetaData.Name,
                    Message = "I'm sharing this with you"
                };

                task.Show();
            }
            else if (option == ShareOption.Text)
            {
                var task = new SmsComposeTask {
                    Body = body
                };
                task.Show();
            }
            else
            {
                var task = new EmailComposeTask {
                    Body = body
                };
                task.Show();
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// This is the complete init method for this class.
 /// It should be used by the children classes in the constructor in order to correctly fill the properties of the object.
 /// </summary>
 /// <param name="id"></param>
 /// <param name="creatorName"></param>
 /// <param name="ownerGroupName"></param>
 /// <param name="title"></param>
 /// <param name="description"></param>
 /// <param name="code"></param>
 /// <param name="created"></param>
 /// <param name="modified"></param>
 /// <param name="visibility"></param>
 /// <param name="properties"></param>
 /// <param name="tags"></param>
 protected void Init(long id, string creatorName, string ownerGroupName, string title, string description, string code,
                     DateTime created, DateTime modified, ShareOption visibility, List <SnippetProperty> properties, List <Tag> tags)
 {
     ID             = id;
     CreatorName    = creatorName;
     OwnerGroupName = ownerGroupName;
     Title          = title;
     Description    = description;
     Code           = code;
     Created        = created;
     Modified       = modified;
     Visibility     = visibility;
     Properties     = properties;
     Tags           = tags;
 }
        private void sharewz_Click(object sender, EventArgs e)
        {
            var shareData = new ShareData();

            shareData.Content = string.Format("《{0}》,UP主:{1},原文:{2}。", StaticData.acitem.title, StaticData.acitem.name, "http://www.acfun.tv" + StaticData.acitem.href);
            var option = new ShareOption();

            option.ShareCompleted += args =>
            {
                if (args.StatusCode == Status.Successed)
                {
                    new ToastPrompt().Show("分享成功");
                }
                else
                {
                    new ToastPrompt().Show(args.Error.Message);
                }
            };
            UmengSocial.Share(App.UmengKey, shareData, null, this, option);
        }
Exemplo n.º 5
0
        public override bool Parse(XElement xml)
        {
            if (xml == null)
            {
                return(false);
            }

            long        id             = 0;
            string      creatorName    = string.Empty;
            string      ownerGroupName = string.Empty;
            string      title          = string.Empty;
            string      description    = string.Empty;
            string      code           = string.Empty;
            DateTime    created        = DateTime.MinValue;
            DateTime    modified       = DateTime.MinValue;
            ShareOption visib          = ShareOption.Private;

            xml.ParseNode("ID", ref id, false);
            xml.ParseNode("CreatorName", ref creatorName, false);
            xml.ParseNode("OwnerGroupName", ref ownerGroupName, false);
            xml.ParseNode("Title", ref title, false);
            xml.ParseNode("Description", ref description, false);
            xml.ParseNode("Code", ref code, false);
            xml.ParseNode("Created", ref created, false);
            xml.ParseNode("Modified", ref modified, false);
            xml.ParseNode("Visibility", ref visib, false);

            Init(id, creatorName, ownerGroupName, title, description, code, created, modified, visib, null, null);

            XElement props = xml.GetNode("Properties", false);

            ParseProperties(props);

            XElement tags = xml.GetNode("Tags", false);

            ParseTags(tags);

            return(true);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 分享按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void btnShare_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                BitmapImage bitmapImage = new BitmapImage();
                WriteableBitmap bitmap = await Screen();

                using (MemoryStream memoryStream = new MemoryStream())
                {
                    bitmap.SaveJpeg(memoryStream, bitmap.PixelWidth, bitmap.PixelHeight, 0, 100);
                    bitmapImage.SetSource(memoryStream);
                }

                ShareData shareData = new ShareData();
                string content = "";
                if (string.IsNullOrWhiteSpace(txtPlayName.Text))
                {
                    content = "我正在使用FMRadioPro收听广播,分享一个好APP,支持CodeMonkey @十一_x 写APP赚钱娶媳妇。 ";
                }
                else
                {
                    content = string.Format("我正在使用FMRadioPro收听{0},分享一个好APP,支持CodeMonkey @十一_x 写APP赚钱娶媳妇。", txtPlayName.Text);
                }
                shareData.Content = content;

                shareData.Picture = bitmapImage;

                ShareOption option = new ShareOption();
                option.ShareCompleted = args =>
                {
                    if (args.StatusCode == UmengSocialSDK.UmEventArgs.Status.Successed)
                    {
                        //分享成功
                        // MessageBox.Show("分享成功");
                    }
                    else
                    {
                        //分享失败
                        //MessageBox.Show("分享失败");
                    }
                };

                UmengSocial.Share(AppConfig.AppKey, shareData, null, this, option);
            }
            catch (Exception ex)
            {
                UmengSDK.UmengAnalytics.TrackException(ex);
            }
        }
Exemplo n.º 7
0
        private void ShareReferralHandler(ShareOption option)
        {
            if (Account == null)
            {
                return;
            }

            if (option == ShareOption.Email)
            {
                var task = new EmailComposeTask();
                task.Subject = "Get Dropbox";
                task.Body = string.Format("I would like you to join Dropbox, here is the referral link {0}",
                                          Account.referral_link);
                task.Show();
            }

            if (option == ShareOption.Social)
            {
                var task = new ShareLinkTask
                    {
                        LinkUri = new Uri(Account.referral_link),
                        Message = "Join the awesome cloud storage service.",
                        Title = "Dropbox register"
                    };
                task.Show();
            }
        }
Exemplo n.º 8
0
        void ShareCommand(ShareOption option)
        {
            var vm = (MetaDataViewModel)DataContext;

            vm.Share.Execute(option);
        }
Exemplo n.º 9
0
 void ShareCommand(ShareOption option)
 {
     var vm = (MetaDataViewModel)DataContext;
     vm.Share.Execute(option);
 }
Exemplo n.º 10
0
 /// <summary>
 /// This is the complete init method for this class.
 /// It should be used by the children classes in the constructor in order to correctly fill the properties of the object.
 /// </summary>
 /// <param name="id"></param>
 /// <param name="ownerID"></param>
 /// <param name="creatorID"></param>
 /// <param name="name"></param>
 /// <param name="description"></param>
 /// <param name="code"></param>
 /// <param name="created"></param>
 /// <param name="modified"></param>
 /// <param name="visibility"></param>
 /// <param name="rating"></param>
 /// <param name="avgRating"></param>
 /// <param name="numVote"></param>
 /// <param name="selected"></param>
 /// <param name="pricePerView"></param>
 /// <param name="linkToSource"></param>
 /// <param name="extAuthor"></param>
 /// <param name="targetGroupID"></param>
 /// <param name="creatorName"></param>
 /// <param name="ownerGroupName"></param>
 /// <param name="creatorImageNum"></param>
 /// <param name="creatorPoints"></param>
 /// <param name="isTemporary"></param>
 /// <param name="relevance"></param>
 /// <param name="numOfVisits"></param>
 /// <param name="visitsRanking"></param>
 /// <param name="copyActions"></param>
 /// <param name="copyEmbedActions"></param>
 protected void Init(long id, int ownerID, int creatorID, string name, string description, string code,
     DateTime created, DateTime modified, ShareOption visibility, int rating, float avgRating,
     int numVote, bool selected, decimal pricePerView, string linkToSource, string extAuthor, int targetGroupID, string creatorName, 
     string ownerGroupName, int creatorImageNum, int creatorPoints, bool isTemporary, byte relevance, int numOfVisits,
     long visitsRanking, int copyActions, int copyEmbedActions)
 {
     ID = id;
     OwnerGroupID = ownerID;
     CreatorID = creatorID;
     Name = name;
     Description = description;
     Code = code;
     Created = created;
     Modified = modified;
     Visibility = visibility;
     //ItemMeta = itemMeta;
     Rating = rating;
     AvgRating = avgRating;
     NumVote = numVote;
     Selected = selected;
     PricePerView = pricePerView;
     LinkToSource = linkToSource;
     ExtAuthor = extAuthor;
     TargetGroupID = targetGroupID;
     CreatorName = creatorName;
     OwnerGroupName = ownerGroupName;
     CreatorImageNum = creatorImageNum;
     CreatorPoints = creatorPoints;
     IsTemporary = isTemporary;
     Relevance = relevance;
     NumOfVisits = numOfVisits;
     VisitsRanking = visitsRanking;
     NumOfCopyActions = copyActions;
     NumOfCopyEmbedActions = copyEmbedActions;
 }
Exemplo n.º 11
0
        void ShareHandler(ShareOption option)
        {
            string body = string.Format("I am sharing this link with you {0}", ShareLink);

            if (option == ShareOption.Social)
            {
                var task = new ShareLinkTask
                               {
                                   LinkUri = new Uri(ShareLink),
                                   Title = MetaData.Name,
                                   Message = "I'm sharing this with you"
                               };

                task.Show();
            }
            else if (option == ShareOption.Text)
            {
                var task = new SmsComposeTask { Body = body };
                task.Show();
            }
            else
            {
                var task = new EmailComposeTask { Body = body };
                task.Show();
            }
        }
Exemplo n.º 12
0
 /// <summary>
 /// This is the complete init method for this class.
 /// It should be used by the children classes in the constructor in order to correctly fill the properties of the object.
 /// </summary>
 /// <param name="id"></param>
 /// <param name="creatorName"></param>
 /// <param name="ownerGroupName"></param>
 /// <param name="title"></param>
 /// <param name="description"></param>
 /// <param name="code"></param>
 /// <param name="created"></param>
 /// <param name="modified"></param>
 /// <param name="visibility"></param>
 /// <param name="properties"></param>
 /// <param name="tags"></param>
 protected void Init(long id, string creatorName, string ownerGroupName, string title, string description, string code,
     DateTime created, DateTime modified, ShareOption visibility, List<SnippetProperty> properties, List<Tag> tags)
 {
     ID = id;
     CreatorName = creatorName;
     OwnerGroupName = ownerGroupName;
     Title = title;
     Description = description;
     Code = code;
     Created = created;
     Modified = modified;
     Visibility = visibility;
     Properties = properties;
     Tags = tags;
 }