本文整理汇总了C#中Microblog类的典型用法代码示例。如果您正苦于以下问题:C# Microblog类的具体用法?C# Microblog怎么用?C# Microblog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Microblog类属于命名空间,在下文中一共展示了Microblog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bindUserInfo
private static void bindUserInfo( IBlock block, MvcContext ctx, Microblog blog, Boolean showUserFace )
{
IBlock ufBlock = block.GetBlock( "userFace" );
if (showUserFace) {
ufBlock.Set( "blog.UserName", blog.User.Name );
ufBlock.Set( "blog.UserFace", blog.User.PicSmall );
if (ctx.GetItemString( "_showType" ) == "microblog") {
ufBlock.Set( "blog.UserLink", alink.ToUserMicroblog( blog.User ) );
ufBlock.Set( "userNameInfo", string.Format( "<a href=\"{0}\">{1}</a>", alink.ToUserMicroblog( blog.User ), blog.User.Name ) );
}
else {
ufBlock.Set( "blog.UserLink", Link.ToMember( blog.User ) );
ufBlock.Set( "userNameInfo", string.Format( "<a href=\"{0}\">{1}</a>", Link.ToMember( blog.User ), blog.User.Name ) );
}
String deleteCmd = getDeleteCmd( ctx, blog );
ufBlock.Set( "blog.DeleteCmd", deleteCmd );
ufBlock.Next();
if (ctx.GetItemString( "_showType" ) == "microblog") {
block.Set( "userNameInfo", string.Format( "<a href=\"{0}\">{1}</a>", alink.ToUserMicroblog( blog.User ), blog.User.Name ) );
}
else {
block.Set( "userNameInfo", string.Format( "<a href=\"{0}\">{1}</a>", Link.ToMember( blog.User ), blog.User.Name ) );
}
}
else {
block.Set( "userNameInfo", "" );
}
}
示例2: DeleteSys
//------------------------------------------------------------------------------------------
public virtual void DeleteSys( Microblog blog )
{
if (blog == null) throw new ArgumentNullException( "blog" );
blog.SaveStatus = SaveStatus.SysDelete;
blog.delete();
}
示例3: CancelFavorite
public void CancelFavorite( int userId, Microblog blog )
{
MicroblogFavorite f = MicroblogFavorite.find( "UserId=" + userId + " and MicroblogId=" + blog.Id ).first();
if (f == null) return;
f.delete();
}
示例4: hasFavorite
private bool hasFavorite( Microblog blog, List<MicroblogFavorite> mfs )
{
foreach (MicroblogFavorite mf in mfs) {
if (mf.Microblog.Id == blog.Id) return true;
}
return false;
}
示例5: SaveFavorite
public void SaveFavorite( int userId, Microblog blog )
{
MicroblogFavorite f = MicroblogFavorite.find( "UserId=" + userId + " and MicroblogId=" + blog.Id ).first();
if (f != null) return;
MicroblogFavorite mf = new MicroblogFavorite();
mf.UserId = userId;
mf.Microblog = blog;
mf.insert();
}
示例6: bindPicInfo
private static void bindPicInfo( IBlock block, Microblog blog )
{
IBlock picBlock = block.GetBlock( "pic" );
if (strUtil.HasText( blog.Pic )) {
picBlock.Set( "blog.PicSmall", blog.PicSmall );
picBlock.Set( "blog.PicMedium", blog.PicMedium );
picBlock.Set( "blog.PicOriginal", blog.PicOriginal );
picBlock.Next();
}
}
示例7: Add
public virtual void Add( User creator, String msg, String dataType, int dataId, String ip )
{
Microblog x = new Microblog();
x.User = creator;
x.Content = msg;
x.Ip = ip;
x.DataType = dataType;
x.DataId = dataId;
this.Insert( x, 0 );
}
示例8: AddSimple
/// <summary>
/// 纯粹插入数据库,不检查表情、at用户、不处理tag;不处理转发
/// </summary>
/// <param name="creator"></param>
/// <param name="msg"></param>
/// <param name="dataType"></param>
/// <param name="dataId"></param>
/// <param name="ip"></param>
public virtual void AddSimple(User creator, string msg, string dataType, long dataId, string ip)
{
Microblog x = new Microblog();
x.User = creator;
x.Content = msg;
x.Ip = ip;
x.DataType = dataType;
x.DataId = dataId;
x.insert();
}
示例9: bindVideoInfo
private static void bindVideoInfo( IBlock block, Microblog blog )
{
IBlock vBlock = block.GetBlock( "video" );
if (strUtil.HasText( blog.FlashUrl )) {
String vpic = strUtil.HasText( blog.PicUrl ) ? blog.PicUrl : strUtil.Join( sys.Path.Img, "/big/novideopic.png" );
vBlock.Set( "blog.FlashPic", vpic );
vBlock.Set( "blog.Flash", wojilu.Web.Utils.WebHelper.GetFlash( blog.FlashUrl, 450, 340 ) );
vBlock.Set( "blog.FlashPageUrl", blog.PageUrl );
vBlock.Next();
}
}
示例10: getBlog
private Microblog getBlog( User creator, String content, int i )
{
Microblog x = new Microblog();
x.Creator = creator;
x.Content = content;
logger.Info( x.Content );
if (i % 2 == 1 && i > 0) {
// 发布一篇图片微博
x.Pic = Img.CopyToUploadPath( "/__installer/pic/pic" + i + ".jpg" );
}
return x;
}
示例11: bindUserInfo
private static void bindUserInfo( IBlock block, Microblog blog, Boolean showUserFace )
{
IBlock ufBlock = block.GetBlock( "userFace" );
if (showUserFace) {
ufBlock.Set( "blog.UserName", blog.User.Name );
ufBlock.Set( "blog.UserFace", blog.User.PicSmall );
ufBlock.Set( "blog.UserLink", alink.ToUserMicroblog( blog.User ) );
ufBlock.Next();
block.Set( "userNameInfo", string.Format( "<a href=\"{0}\">{1}</a>: ", alink.ToUserMicroblog( blog.User ), blog.User.Name ) );
}
else {
block.Set( "userNameInfo", "" );
}
}
示例12: Create
public void Create()
{
if (Component.IsClose( typeof( MicroblogApp ) )) {
content( "对不起,微博功能暂停运行" );
return;
}
String blogContent = ctx.Post( "Content" );
if (strUtil.IsNullOrEmpty( blogContent )) {
content( lang( "exContent" ) );
return;
}
String picUrl = ctx.Post( "PicUrl" );
User user = ctx.viewer.obj as User;
Microblog blog = new Microblog();
blog.Content = blogContent;
blog.Ip = ctx.Ip;
blog.User = user;
blog.Pic = picUrl;
setVideoInfo( blog );
microblogService.Insert( blog );
String srcType = ctx.Post( "srcType" );
if ("shareBox".Equals( srcType )) {
returnCloseBox();
}
else if ("mbHome".Equals( srcType )) {
returnOneBlogHtml( blog );
}
else {
echoRedirect( "ok", to( new My.MicroblogController().Home ) );
}
}
示例13: saveComment
private void saveComment( Microblog tblog, String content )
{
MicroblogComment c = new MicroblogComment();
c.Root = tblog;
c.Content = content;
c.User = ctx.viewer.obj as User;
c.Ip = ctx.Ip;
commentService.InsertComment( c, to( new MicroblogController().Show, tblog.Id ) );
}
示例14: addFeedInfo
private void addFeedInfo( Microblog log )
{
Feed feed = new Feed();
feed.Creator = log.User;
feed.DataType = typeof( Microblog ).FullName;
feed.DataId = log.Id;
// ת������Ϣ
String pbody = "";
if (log.ParentId > 0) {
Microblog parent = GetById( log.ParentId );
if (parent == null) {
pbody = " [��ת���ѱ�ԭ����ɾ��]";
}
else {
pbody = ": [ת]" + parent.Content;
}
}
feed.TitleTemplate = "{*actor*} :" + strUtil.SubString( log.Content + pbody, 230 );
if (strUtil.HasText( log.Pic )) {
Dictionary<String, String> data = new Dictionary<string, string>();
data.Add( "pic", "<img src=\"" + log.PicSmall + "\" />" );
feed.BodyTemplate = "{*pic*}";
feed.BodyData = JsonString.ConvertDictionary( data );
}
feedService.publishUserAction( feed );
}
示例15: addNotification
private void addNotification( List<User> users, Microblog blog )
{
// ��@�û���֪ͨ
foreach (User u in users) {
//String msg = string.Format( "�����ᵽ����:<a href=\"{0}\">{1}</a>", lnk, strUtil.ParseHtml( blog.Content, 30 ) );
//nfService.send( u.Id, msg );
MicroblogAt mat = new MicroblogAt();
mat.Microblog = blog;
mat.User = u;
mat.insert();
u.MicroblogAt++;
u.update( "MicroblogAt" );
u.MicroblogAtUnread++;
u.update( "MicroblogAtUnread" );
}
}