日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

发现自己的代码写的越来越玄幻了

發布時間:2024/4/14 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 发现自己的代码写的越来越玄幻了 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

//_________________________________________________//

//??????Description :?? 發現自己的代碼寫的越來越玄幻了???? ????? ??? ? //

//????? CODER????? :??? Ghost?????????????????????????????????????????????? ? ?//

//?????? Time????????? :??? 2011-6-10??????????????????????????????????????? ? //

//_________________________________________________//

//? 更新在最后?? Add by Ghost

也許我該這樣寫

?int? Max(int a,int b)

{

????? int x;

???? if(a>b)

  {

??????????? x=a;

???? }

??? else

??? {

?????????? x=b;

???? }

???? return x;

}

其實我是這樣寫的

int? Max(int a,int b)

{

?????? return a>b?a:b;

}

也許我該這樣寫

GroupInfoControl groupcontrol? = null;

Guid id = group.Id;

if(id .Equals(Guid.Empty))

{

???? groupcontrol = new GroupInfoControl(group,?true,false);

}

else

{

??? groupcontrol = new GroupInfoControl(group,?false,false);

}

其實我是這樣寫的

?GroupInfoControl groupcontrol = new GroupInfoControl(group, !group.Id.Equals(Guid.Empty), false);

其實我是這樣寫的

private void GroupBtnDel_Click(object sender, RoutedEventArgs e)
?{
??????????? if (MessageBox.Show("確認要刪除分組: " + GetSelectGroup().Name + " ?", "", MessageBox?Button.OKCancel).Equals(MessageBoxResult.OK))??

????????????????????client.DeleteGroupAsync(UserID, GetSelectGroup().Id.ToString());
}

其實我是這樣寫的

??????? void groupEditWindow_Closed(object sender, EventArgs e)
??????? {

??????????? ?? if (((GroupEditChildWindow)sender).DialogResult ?? true)?? Refresh();
??????? }

其實我是這樣寫的

???????? private RMTabItem GetOpenTabItem(Guid hrID)
??????? {
??????????? RMTabItem item = null;

??????????? foreach (var p in this.TabControlMain.Items)
??????????? {
??????????????? if (p.GetType().Equals(typeof(RMTabItem)))
??????????????? {
??????????????????if (((FriendDetailControl)((RMTabItem)p).Content).FriendInfo.Id.Equals(hrID))

?????????????????? {
??????????????????????? item = p as RMTabItem;
??????????????????????? break;
??????????????????? }
??????????????? }
??????????? }

??????????? return item;
??????? }

其實我是這樣寫的

??????? public HRInfo GetHRbyID(string userid, string hrID)
??????? {
??????????? ?return LoadUser(userid).IsOK ? new HRInfo(uBL.GetHRByKey(new Guid(hrID))) : null;
??????? }?

其實我是這樣寫的

??????? private List<GhostTreeViewItem> GetAllRoot()
??????? {
??????????? return (from p in DataList where p.Parentid ==null select p).ToList();
??????? }

也許我該這樣寫

?????????? string result;

??????????? if (str == null)
??????????? {
??????????????? result = "";
??????????? }
??????????? else
??????????? {
??????????????? if (str.Length > length)
??????????????? {
??????????????????? result = str.Substring(0, length);
??????????????????? result = result + "..";
??????????????? }
??????????????? else
??????????????? {
??????????????????? result = str;
??????????????? }
??????????? }

??????????? return result;

其實我是這樣寫的

?????????return str == null ? "" : (str.Length > length ? str.Substring(0, length) + ".." : str);

?????未完待續。。。。。?

轉載于:https://www.cnblogs.com/GhostZCH/archive/2011/08/02/2125604.html

總結

以上是生活随笔為你收集整理的发现自己的代码写的越来越玄幻了的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。