Ejemplo n.º 1
0
        protected void GenerateMethodDocumentation(MethodInfo method, string urlprefix)
        {
            // general method
            UserStream.WriteLine("=> Generating documentation for method {0}", method.Name);
            Output.WriteLine(String.Format("<h4 name=\"{0}\">{0}</h4><dl>", method.Name));
            Output.WriteLine(String.Format("<dt>URL</dt><dd>{0}/{1}</dd>", urlprefix, method.Name));

            // parameters
            Output.WriteLine("<dt>Parameters</dt><dd>");
            GenerateParameterDocumentation(method);
            Output.WriteLine("</dd>");

            // return type
            Type itemType = null;

            if (method.ReturnType.Name == "Stream")
            {
                Output.WriteLine(String.Format("<dt>Returns</dt><dd>Raw data"));
            }
            else if (IsListType(method.ReturnType, out itemType))
            {
                Output.WriteLine(String.Format("<dt>Returns</dt><dd>List of <strong>{0}</strong><br />", MapName(method, itemType.Name)));
            }
            else
            {
                Output.WriteLine(String.Format("<dt>Returns</dt><dd><strong>{0}</strong><br />", MapName(method, itemType.Name)));
            }
            if (itemType != null && !IsUndocumentableType(itemType))
            {
                GenerateReturnDocumentation(method, itemType);
            }
            Output.WriteLine("</dd>");
            Output.WriteLine("</dl>");
        }
Ejemplo n.º 2
0
 /// <summary>
 /// UserStreamに接続します
 /// </summary>
 /// <param name="IsGetAllReplies">フォロー外のリプライも取得する</param>
 public void ConnectUserStream(bool IsGetAllReplies)
 {
     try
     {
         UserStream.ConnectUserStream(IsGetAllReplies);
     }
     catch { throw; }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 创建 <see cref="TimelinePage"/>
 /// </summary>
 /// <param name="userId">用户 ID</param>
 /// <param name="currentUserId">当前登录用户 ID</param>
 /// <param name="dbContext"><see cref="KeylolDbContext"/></param>
 /// <param name="cachedData"><see cref="CachedDataProvider"/></param>
 /// <returns><see cref="TimelinePage"/></returns>
 public static async Task <TimelinePage> CreateAsync(string userId, string currentUserId,
                                                     KeylolDbContext dbContext, CachedDataProvider cachedData)
 {
     return(new TimelinePage
     {
         Cards = await TimelineCardList.CreateAsync(UserStream.Name(userId), currentUserId,
                                                    18, true, dbContext, cachedData)
     });
 }
Ejemplo n.º 4
0
 protected void GenerateEnumDocumentation(Type type)
 {
     UserStream.WriteLine("=> Generating documentation for type {0}", type.Name);
     Output.WriteLine("<h4 name=\"{0}\">{0} (enumeration)</h4>", type.Name);
     Output.WriteLine("<dl><dt>Values</dt><dd><ul>");
     foreach (var val in type.GetEnumValues())
     {
         Output.WriteLine("<li>{0}: {1}</li>", type.GetEnumName(val), (int)val);
     }
     Output.WriteLine("</ul></dt></dl>");
 }
Ejemplo n.º 5
0
        private void Initialize()
        {
            //construct and authenticate streaming/basic APIs
            m_bAPI = new BasicAPI(m_oaCredentials);
            m_sAPI = new StreamingAPI(m_oaCredentials);

            m_slStatuses        = new StatusList();
            m_ldmDirectMessages = new List <DirectMessage>();

            m_usUserStream = m_sAPI.GetUserStream();
        }
Ejemplo n.º 6
0
        public async Task SendStreamToOne([FromForm] UserStream userStream)
        {
            //var localStream = userStream.Stream.OpenReadStream();
            //var bytesinfile = new byte[userStream.Stream.Length];
            //localStream.Read(bytesinfile, 0, (int)userStream.Stream.Length);
            //HttpContext.Response..BinaryWrite(bytesinfile);


            FileStreamResult fileStreamResult = new FileStreamResult(userStream.Stream.OpenReadStream()
                                                                     , userStream.Stream.ContentType);


            await _hubContext.Clients.All.SendAsync("sendStreamToOne", fileStreamResult.FileStream);
        }
Ejemplo n.º 7
0
        public void StartListening()
        {
            var worker = new BackgroundWorker();

            worker.DoWork += (s, e) =>
                {
                    var stream = new UserStream(token);
                    stream.TweetCreatedByAnyoneButMe += (a, b) => worker.ReportProgress(0, b);
                    stream.StartStream();
                };

            worker.WorkerReportsProgress = true;
            worker.ProgressChanged += (s, e) => TweetReceived((GenericEventArgs<ITweet>)e.UserState);
            worker.RunWorkerAsync();
        }
Ejemplo n.º 8
0
    private void DisplayStreamFeature(UserStream stream)
    {
        if (stream is Recipe)
        {
            Recipe r        = (Recipe)stream;
            string urlTitle = r.Title.Replace(" ", "-");

            string aRecLink = "<a href=\"" + ResolveUrl("~/") + "recipe/" + r.Id + "/" + urlTitle + "\" >";
            string buff     = aRecLink + r.Title + "</a>";
            buff += "<ul>";
            buff += "<li style=\"padding-bottom: 14px;\"><span style=\"float: left;\"><input type=\"radio\" class=\"rate\" value=\"0.5\"/><input type=\"radio\" class=\"rate\" value=\"1.0\"/><input type=\"radio\" class=\"rate\" value=\"1.5\"/><input type=\"radio\" class=\"rate\" value=\"2.0\"/><input type=\"radio\" class=\"rate\" value=\"2.5\"/><input type=\"radio\" class=\"rate\" value=\"3.0\"/><input type=\"radio\" class=\"rate\" value=\"3.5\"/><input type=\"radio\" class=\"rate\" value=\"4.0\"/><input type=\"radio\" class=\"rate\" value=\"4.5\"/><input type=\"radio\" class=\"rate\" value=\"5.0\"/>&nbsp;&nbsp;Rating</span></li>";
            buff += "<li><span style=\"float: left;\"><input type=\"radio\" class=\"strict\" value=\"1\"/><input type=\"radio\" class=\"strict\" value=\"2\"/><input type=\"radio\" class=\"strict\" value=\"3\"/>&nbsp;&nbsp;Paleo&nbsp;Strict</span></li>";
            buff += "</ul>";
            buff += "<br />";
            buff += "<div style=\"text-align: center; padding-top: 5px;\">" + aRecLink + "<img src=\"" + ResolveUrl("~/DesktopModules/ATI_Base/services/images/recipe.aspx") + "?r=" + r.Id + "\" /><br />more ...</a></div>";
            buff += "<span>" + r.Description + "</span>";

            buff         += "<script type=\"text/javascript\">";
            buff         += "$(function () {$('input.rate').each(function() {if ($(this).val() == " + r.AvrRating + " ) {$(this).attr('checked', 'true');}}).rating({split: 2,readOnly: true});";
            buff         += "$('input.strict').each(function() {if ($(this).val() == " + r.AvrStrictness + ") {$(this).attr('checked', 'true');}}).rating({readOnly: true});});";
            buff         += "</script>";
            litStats.Text = buff;


            /*
             * <li id="atiRecipeRating"></li>
             * <li>
             *  <input type="radio" class="rate" value="0.5"/>
             *  <input type="radio" class="rate" value="1"/>
             *  <input type="radio" class="rate" value="1.5"/>
             *  <input type="radio" class="rate" value="2"/>
             *  <input type="radio" class="rate" value="2.5"/>
             *  <input type="radio" class="rate" value="3"/>
             *  <input type="radio" class="rate" value="3.5"/>
             *  <input type="radio" class="rate" value="4" />
             *  <input type="radio" class="rate" value="4.5"/>
             *  <input type="radio" class="rate" value="5"/>
             * </li>
             * <li id="atiRecipeStrict" style="float: right">&nbsp;&nbsp;Paleo&nbsp;Strict
             *   <input type="radio" class="strict" value="1"/>
             *   <input type="radio" class="strict" value="2" checked="checked"/>
             *   <input type="radio" class="strict" value="3" />
             * </li>
             */
        }
    }
Ejemplo n.º 9
0
        protected void atiDataListStream_DeleteCommand(object source, DataListCommandEventArgs e)
        {
            long id = (long)atiDataListStream.DataKeys[e.Item.ItemIndex];

            if (id > 0 && this.DataSource != null)
            {
                UserStream ustream = this.UseThirdPartyId ? this.DataSource.Cast <Workout>().First(us => us.ThirdPartyId == id) : this.DataSource.First(us => us.Id == id);
                if (this.Stream_DeleteEvent != null)
                {
                    this.Stream_DeleteEvent(this, new StreamDataEventArgs()
                    {
                        UserStream = ustream
                    });
                }
                this.DataSource.Remove(ustream);
            }
            // TODO: fire item deleted event.
            atiDataListStream.EditItemIndex = -1;
            this.DataBind();
        }
Ejemplo n.º 10
0
 protected void GenerateReturnDocumentation(MethodInfo method, Type type)
 {
     UserStream.WriteLine("==> Generating documentation for type {0}", type.Name);
     Output.WriteLine("<ul>");
     foreach (var property in type.GetProperties())
     {
         Type otype;
         bool isList = IsListType(property.PropertyType, out otype);
         if (property.PropertyType.Name.StartsWith("Web") || (isList && otype.Name.StartsWith("Web")))
         {
             Output.WriteLine(String.Format("<li><strong>{0}</strong> ({1}):", property.Name, GenerateTypeNameLink(method, property.PropertyType)));
             GenerateReturnDocumentation(method, otype);
             Output.WriteLine(String.Format("</li>"));
         }
         else
         {
             Output.WriteLine(String.Format("<li><strong>{0}</strong> ({1})</li>", property.Name, GenerateTypeNameLink(method, property.PropertyType)));
         }
     }
     Output.WriteLine("</ul>");
 }
Ejemplo n.º 11
0
        protected void atiDataListStream_UpdateCommand(object source, DataListCommandEventArgs e)
        {
            long id = (long)atiDataListStream.DataKeys[e.Item.ItemIndex];

            if (id > 0 && this.DataSource != null)
            {
                string     categoryName = ((TextBox)e.Item.FindControl("textCategoryName")).Text;
                string     description  = ((TextBox)e.Item.FindControl("textDescription")).Text;
                UserStream ustream      = this.DataSource.First(us => us.Id == id);
                ustream.Title = categoryName;
                // TODO: update
                if (this.Stream_UpdateEvent != null)
                {
                    this.Stream_UpdateEvent(this, new StreamDataEventArgs()
                    {
                        UserStream = ustream
                    });
                }
            }
            atiDataListStream.EditItemIndex = -1;
            this.DataBind();
        }
Ejemplo n.º 12
0
        public async Task InitializeAsync()
        {
            TwitterClient.Initialize();
            this.UserInfomation = await TwitterClient.GetAccountInformationAsync(ScreenName);

            userStreamClient   = new UserStream(TwitterClient.ConsumerData, TwitterClient.AccessToken, UserInfomation);
            followStreamClient = new FollowStream(TwitterClient.ConsumerData, TwitterClient.AccessToken, UserInfomation);

            userStreamClient.Initialize();

            followStreamClient.Initialize();
            receivingTimelineCounter = 0;

            OnHttpGetError          += (e) => { };
            OnHttpPostError         += (e) => { };
            OnTweetBegin            += (e) => { };
            OnTweetFailed           += (e) => { };
            OnTweetCompleted        += (e) => { };
            ChangeUserStreamEvent   += (e) => { };
            ChangeFollowStreamEvent += (e) => { };
            OnUserStreamHttpError   += (e) => { };
            OnFollowStreamHttpError += (e) => { };


            twitterClient.OnHttpGetError += (e) =>
            {
                OnHttpGetError(e);
            };
            twitterClient.OnHttpPostError += (e) =>
            {
                OnHttpPostError(e);
            };
            twitterClient.OnTweetBegin += (e) =>
            {
                OnTweetBegin(e);
            };
            twitterClient.OnTweetFailed += (e) =>
            {
                OnTweetFailed(e);
            };
            twitterClient.OnTweetCompleted += (e) =>
            {
                OnTweetCompleted(e);
            };
            userStreamClient.ChangeStreamEvent += (e) =>
            {
                ChangeUserStreamEvent(e);
            };
            followStreamClient.ChangeStreamEvent += (e) =>
            {
                ChangeFollowStreamEvent(e);
            };

            userStreamClient.OnStreamError += (e) =>
            {
                OnUserStreamHttpError(e);
            };
            followStreamClient.OnStreamError += (e) =>
            {
                OnFollowStreamHttpError(e);
            };
        }
Ejemplo n.º 13
0
        protected override void OnStart(string[] args)
        {
            _mqChannel.BasicQos(0, 5, false);
            var consumer = new EventingBasicConsumer(_mqChannel);

            consumer.Received += async(sender, eventArgs) =>
            {
                try
                {
                    using (var streamReader = new StreamReader(new MemoryStream(eventArgs.Body)))
                        using (var dbContext = new KeylolDbContext())
                        {
                            var serializer = new JsonSerializer();
                            var requestDto =
                                serializer.Deserialize <PushHubRequestDto>(new JsonTextReader(streamReader));

                            string            entryId;
                            FeedEntryType     entryType;
                            List <string>     pointsToPush;
                            List <UserToPush> usersToPush = new List <UserToPush>();
                            var count = 0;
                            switch (requestDto.Type)
                            {
                            case ContentPushType.Article:
                            {
                                var article = await dbContext.Articles.Where(a => a.Id == requestDto.ContentId)
                                              .Select(a => new
                                    {
                                        a.Id,
                                        a.AuthorId,
                                        a.AttachedPoints,
                                        a.TargetPointId
                                    }).SingleAsync();

                                usersToPush.Add(new UserToPush
                                    {
                                        UserId = article.AuthorId,
                                        SubscriberTimelineReason = "author"
                                    });
                                entryId      = article.Id;
                                entryType    = FeedEntryType.ArticleId;
                                pointsToPush = Helpers.SafeDeserialize <List <string> >(article.AttachedPoints) ??
                                               new List <string>();
                                pointsToPush.Add(article.TargetPointId);
                                break;
                            }

                            case ContentPushType.Activity:
                            {
                                var activity = await dbContext.Activities.Where(a => a.Id == requestDto.ContentId)
                                               .Select(a => new
                                    {
                                        a.Id,
                                        a.AuthorId,
                                        a.AttachedPoints,
                                        a.TargetPointId
                                    }).SingleAsync();

                                usersToPush.Add(new UserToPush
                                    {
                                        UserId = activity.AuthorId,
                                        SubscriberTimelineReason = "author"
                                    });
                                entryId      = activity.Id;
                                entryType    = FeedEntryType.ActivityId;
                                pointsToPush = Helpers.SafeDeserialize <List <string> >(activity.AttachedPoints) ??
                                               new List <string>();
                                pointsToPush.Add(activity.TargetPointId);
                                if (await AddOrUpdateFeedAsync(LatestActivityStream.Name, entryId, entryType, null,
                                                               dbContext))
                                {
                                    count++;
                                }
                                break;
                            }

                            case ContentPushType.Like:
                            {
                                var like = await dbContext.Likes.FindAsync(requestDto.ContentId);

                                entryId      = like.TargetId;
                                pointsToPush = new List <string>();
                                usersToPush.Add(new UserToPush
                                    {
                                        UserId                   = like.OperatorId,
                                        UserTimelineReason       = "like",
                                        SubscriberTimelineReason = $"like:{like.OperatorId}"
                                    });
                                switch (like.TargetType)
                                {
                                case LikeTargetType.Article:
                                    entryType = FeedEntryType.ArticleId;
                                    break;

                                case LikeTargetType.Activity:
                                    entryType = FeedEntryType.ActivityId;
                                    break;

                                default:
                                    _mqChannel.BasicAck(eventArgs.DeliveryTag, false);
                                    return;
                                }
                                break;
                            }

                            default:
                                throw new ArgumentOutOfRangeException();
                            }

                            foreach (var user in usersToPush)
                            {
                                if (await AddOrUpdateFeedAsync(UserStream.Name(user.UserId),
                                                               entryId, entryType, user.UserTimelineReason, dbContext))
                                {
                                    count++;
                                }

                                foreach (var subscriberId in await dbContext.Subscriptions
                                         .Where(s => s.TargetId == user.UserId &&
                                                s.TargetType == SubscriptionTargetType.User)
                                         .Select(s => s.SubscriberId).ToListAsync())
                                {
                                    if (await AddOrUpdateFeedAsync(SubscriptionStream.Name(subscriberId),
                                                                   entryId, entryType, user.SubscriberTimelineReason, dbContext))
                                    {
                                        count++;
                                    }
                                }
                            }


                            foreach (var pointId in pointsToPush)
                            {
                                var point = await dbContext.Points.Where(p => p.Id == pointId)
                                            .Select(p => new { p.Id }).SingleOrDefaultAsync();

                                if (point == null)
                                {
                                    continue;
                                }
                                if (await AddOrUpdateFeedAsync(PointStream.Name(point.Id),
                                                               entryId, entryType, null, dbContext))
                                {
                                    count++;
                                }

                                foreach (var subscriberId in await dbContext.Subscriptions
                                         .Where(s => s.TargetId == point.Id &&
                                                s.TargetType == SubscriptionTargetType.Point)
                                         .Select(s => s.SubscriberId).ToListAsync())
                                {
                                    if (await AddOrUpdateFeedAsync(SubscriptionStream.Name(subscriberId),
                                                                   entryId, entryType, $"point:{point.Id}", dbContext))
                                    {
                                        count++;
                                    }
                                }
                            }

                            _mqChannel.BasicAck(eventArgs.DeliveryTag, false);
                            _logger.Info($"{count} feeds pushed. Content: ({requestDto.Type}) {requestDto.ContentId}");
                        }
                }
                catch (Exception e)
                {
                    _mqChannel.BasicNack(eventArgs.DeliveryTag, false, false);
                    _logger.Fatal("RabbitMQ unhandled callback exception.", e);
                }
            };
            _mqChannel.BasicConsume(MqClientProvider.PushHubRequestQueue, false, consumer);
        }
Ejemplo n.º 14
0
        public void Generate()
        {
            // header
            Output.WriteLine(
                "<p>This page contains the API documentation for this MPExtended service, as automatically generated on {0} for version {1} (build {2}). " +
                "Please do not edit, as your changes will be overwritten.</p>",
                DateTime.Now.ToString("dd MMM yyy HH:mm", System.Globalization.CultureInfo.InvariantCulture),
                VersionUtil.GetVersion(Assembly),
                VersionUtil.GetBuildVersion(Assembly));

            UserStream.WriteLine("Generating documentation for assembly {0}", Assembly.GetName().Name);

            // get all items
            IEnumerable <DocGenItem> typesToDocument = new List <DocGenItem>();

            if (JsonAPI != null)
            {
                typesToDocument = JsonAPI.GetMethods().Select(x => new DocGenItem()
                {
                    URLPrefix = "/json",
                    Reflected = x,
                    Name      = x.Name,
                    Order     = GenerateSortOrder(x.Name)
                });
            }
            if (StreamAPI != null)
            {
                typesToDocument = typesToDocument.Union(StreamAPI.GetMethods().Select(x => new DocGenItem()
                {
                    URLPrefix = "/stream",
                    Reflected = x,
                    Name      = x.Name,
                    Order     = GenerateSortOrder(x.Name)
                }));
            }
            if (Enumerations != null)
            {
                typesToDocument = typesToDocument.Union(Enumerations.Select(x => new DocGenItem()
                {
                    URLPrefix = "",
                    Reflected = x,
                    Name      = x.Name,
                    Order     = GenerateSortOrder(x.Name),
                }));
            }

            // sort all types
            typesToDocument = typesToDocument
                              .OrderBy(x => x.Order)
                              .ThenBy(x => x.Name);

            // print navigation
            int lastOrder = -1;

            UserStream.WriteLine("=> Generating documentation header");
            Output.WriteLine("<h3>Navigation</h3>");
            foreach (var item in typesToDocument)
            {
                if (lastOrder != item.Order)
                {
                    if (lastOrder != -1)
                    {
                        Output.WriteLine("</ul>");
                    }
                    Output.WriteLine("<h4>{0}</h4><ul>", GetHeadings()[item.Order]);
                    lastOrder = item.Order;
                }
                Output.WriteLine("<li><a href=\"#{0}\">{0}</a></li>", item.Name);
            }
            Output.WriteLine("</ul>");

            // generate all documentation
            lastOrder = -1;
            foreach (var item in typesToDocument)
            {
                if (lastOrder != item.Order)
                {
                    Output.WriteLine(String.Format("<h3>{0}</h3>", GetHeadings()[item.Order]));
                    lastOrder = item.Order;
                }

                if (item.Reflected is MethodInfo)
                {
                    GenerateMethodDocumentation(item.Reflected as MethodInfo, item.URLPrefix);
                }
                else if (item.Reflected is Type)
                {
                    GenerateEnumDocumentation(item.Reflected as Type);
                }
            }
            UserStream.WriteLine("=> Done");

            Output.Flush();
            Output.Close();
        }
Ejemplo n.º 15
0
 /// <summary>
 /// 获取时间轴卡片列表
 /// </summary>
 /// <param name="userId">用户 ID</param>
 /// <param name="before">起始位置</param>
 /// <param name="take">获取数量</param>
 /// <param name="dbContext"><see cref="KeylolDbContext"/></param>
 /// <param name="cachedData"><see cref="CachedDataProvider"/></param>
 /// <returns><see cref="TimelineCardList"/></returns>
 public static async Task <TimelineCardList> GetCards(string userId, int before, int take,
                                                      [Injected] KeylolDbContext dbContext, [Injected] CachedDataProvider cachedData)
 {
     return(await TimelineCardList.CreateAsync(UserStream.Name(userId), StateTreeHelper.GetCurrentUserId(),
                                               take, true, dbContext, cachedData, before));
 }
Ejemplo n.º 16
0
        public string getStreamData(UserStream us)
        {
            aqufitEntities entities = new aqufitEntities();
            UserComment[] comments = entities.UserComment.Include("UserSetting").Include("UserStream").Where( uc => uc.UserStream.Id == us.Id ).ToArray();

            string json = _jserializer.Serialize(_IStreamManager.UserStreamArrayToStreamDataArray(new UserStream[] { us }, comments));
            return json;
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Helper method
        /// </summary>
        /// <param name="us"></param>
        /// <param name="settings"></param>
        /// <param name="comment"></param>
        private void sendStreamEmailAsync(UserStream us, UserSettings settings, UserComment comment)
        {
            string emailBody = settings.UserName + " commented.\n\n";
            emailBody += "\"" + Affine.Utils.Web.WebUtils.FromWebSafeString( comment.Text ) + "\"\n\n";
            emailBody += "To see the comment thread, follow the link below:\n";

            string ts = Convert.ToString(DateTime.Now.Ticks);
            if (us is Recipe)
            {
                emailBody += "http://" + HttpContext.Current.Request.Url.Host.Replace("www.","") + System.Web.VirtualPathUtility.ToAbsolute("~/Search.aspx") + "?r="+us.Id + "&ts="+ts;
            }
            else
            {
                emailBody += "http://" + HttpContext.Current.Request.Url.Host.Replace("www.", "") + "/" + us.UserSetting.UserName + "?s=" + us.Id + "&ts=" + ts;
            }
            string subject = settings.UserName + " commented on your post...";

            Affine.Utils.GmailUtil gmail = new Utils.GmailUtil();
            // Send an email to the owner of the post
            if (us.UserSetting.Id != settings.Id)
            {
                gmail.Send(us.UserSetting.UserEmail, subject, emailBody);
            }

            aqufitEntities entities = new aqufitEntities();
            IQueryable<UserComment> comments = entities.UserComment.Include("UserSetting").Where(uc => uc.UserStream.Id == us.Id);
            string[] emails = comments.Select(uc => uc.UserSetting.UserEmail).Distinct().ToArray();
            foreach (string email in emails)
            {
                if (email != us.UserSetting.UserEmail && email != settings.UserEmail)
                {
                    gmail.Send(email, settings.UserName + " commented.", emailBody);
                }
            }
        }
Ejemplo n.º 18
0
    private void DisplayStreamFeature(UserStream stream)
    {
        if (stream is Recipe)
        {
            Recipe r = (Recipe)stream;
            string urlTitle = r.Title.Replace(" ", "-");

            string aRecLink = "<a href=\"" + ResolveUrl("~/") + "recipe/" + r.Id + "/" + urlTitle  + "\" >";
            string buff = aRecLink  + r.Title + "</a>";
            buff += "<ul>";
            buff += "<li style=\"padding-bottom: 14px;\"><span style=\"float: left;\"><input type=\"radio\" class=\"rate\" value=\"0.5\"/><input type=\"radio\" class=\"rate\" value=\"1.0\"/><input type=\"radio\" class=\"rate\" value=\"1.5\"/><input type=\"radio\" class=\"rate\" value=\"2.0\"/><input type=\"radio\" class=\"rate\" value=\"2.5\"/><input type=\"radio\" class=\"rate\" value=\"3.0\"/><input type=\"radio\" class=\"rate\" value=\"3.5\"/><input type=\"radio\" class=\"rate\" value=\"4.0\"/><input type=\"radio\" class=\"rate\" value=\"4.5\"/><input type=\"radio\" class=\"rate\" value=\"5.0\"/>&nbsp;&nbsp;Rating</span></li>";
            buff += "<li><span style=\"float: left;\"><input type=\"radio\" class=\"strict\" value=\"1\"/><input type=\"radio\" class=\"strict\" value=\"2\"/><input type=\"radio\" class=\"strict\" value=\"3\"/>&nbsp;&nbsp;Paleo&nbsp;Strict</span></li>";
            buff += "</ul>";
            buff += "<br />";
            buff += "<div style=\"text-align: center; padding-top: 5px;\">" + aRecLink + "<img src=\"" + ResolveUrl("~/DesktopModules/ATI_Base/services/images/recipe.aspx") + "?r=" + r.Id + "\" /><br />more ...</a></div>";
            buff += "<span>" +  r.Description +"</span>";

            buff += "<script type=\"text/javascript\">";
            buff += "$(function () {$('input.rate').each(function() {if ($(this).val() == " + r.AvrRating + " ) {$(this).attr('checked', 'true');}}).rating({split: 2,readOnly: true});";
            buff += "$('input.strict').each(function() {if ($(this).val() == " + r.AvrStrictness + ") {$(this).attr('checked', 'true');}}).rating({readOnly: true});});";
            buff += "</script>";
            litStats.Text = buff;

            /*
             * <li id="atiRecipeRating"></li>
            <li>
                <input type="radio" class="rate" value="0.5"/>
                <input type="radio" class="rate" value="1"/>
                <input type="radio" class="rate" value="1.5"/>
                <input type="radio" class="rate" value="2"/>
                <input type="radio" class="rate" value="2.5"/>
                <input type="radio" class="rate" value="3"/>
                <input type="radio" class="rate" value="3.5"/>
                <input type="radio" class="rate" value="4" />
                <input type="radio" class="rate" value="4.5"/>
                <input type="radio" class="rate" value="5"/>
            </li>
            <li id="atiRecipeStrict" style="float: right">&nbsp;&nbsp;Paleo&nbsp;Strict
                 <input type="radio" class="strict" value="1"/>
                 <input type="radio" class="strict" value="2" checked="checked"/>
                 <input type="radio" class="strict" value="3" />
            </li>
             */

        }
    }
Ejemplo n.º 19
0
 /// <summary>
 /// UserStreamを切断します
 /// </summary>
 public void DisconnectUserStream()
 {
     UserStream.DisconnectUserStream();
 }