C#??????У?Attribute???????
???????????? ???????[ 2016/3/1 11:20:09 ] ??????????????????? .NET
???????????????????????????js????ajax???????????????????html??
$(".jq-draggable-outcontainer").draggable({
helper: "clone"??
scroll: true??
drag: function (event?? ui) {
// debugger;
}
});
$("#content").droppable({
drop: function (event?? ui) {
// debugger;
if (ui.draggable[0].className.indexOf("jq-draggable-outcontainer") > 0) {
var text = ui.draggable[0].innerText.trim();
$(this).append('<div class="window jq-draggable-incontainer" onclick="GetPropertiesByType('1'??this)" style="position:absolute;left:' +(event.clientX-20) + 'px;top:' + (event.clientY-20) + 'px" id="window' + iIndex + '"><strong>' + text + '</strong></div>');
$("#content2").html("");
cur_selector = $("#window"+iIndex);
$.Ewin.AjaxPost("/Home/GetModelByType"?? { strType: "Factory" }?? function (data?? status) {
var element = $.parseJSON(data.Json);
var arrProp = element.element.property;
//0.????html
var strHtml = "<div style='float:right;padding-top:0px;width:300px;height:auto;'><table cellpadding='5' border='1'>";
//1.?html????????
strHtml += "</table></div>";
$("#content2").append(strHtml);
}?? function () {
}?? null);
iIndex++;
}
}
});
?????????C#??????
public JsonResult GetModelByType(string strType)
{
//strType??????????Factory????FactoryDetail
var assembly = Assembly.Load("Ewin.Client.Web");
//???????????????
var oType = assembly.GetType("Ewin.Client.Web.Controllers." + strType);
//??????????????
var lstProperties = oType.GetProperties();
foreach (var oProperty in lstProperties)
{
//????????????????????
IList<CustomAttributeData> lstAttr = oProperty.GetCustomAttributesData();
foreach (var oAttr in lstAttr)
{
//?????????????????
Console.WriteLine("???????????" + oAttr.AttributeType.FullName);
Console.WriteLine("???????????£?");
//?????????????в???
var lstAttrArgu = oAttr.NamedArguments;
foreach (var oAttrAru in lstAttrArgu)
{
//???????????????????
Console.WriteLine(oAttrAru.MemberName + "=" + oAttrAru.TypedValue.Value);
}
//Console.WriteLine(oAttr.AttributeType+"——"+oAttr.NamedArguments);
}
}
return Json(new { }?? JsonRequestBehavior.AllowGet);
}
????GetModelByType???????????????????????????????js?????????????js???????????檔????????????????????????????С?????????
??????2??????????????????÷???
????????÷?.Net framework?????????MVC????Filter?????????÷???
public class SuperLogStat : ActionFilterAttribute
{
//???????
private EnumModuleName moduleEnum = EnumModuleName.ModuleOther;
//????????
private string functionName = string.Empty;
//???Id
private string userId = string.Empty;
public string Version
{
get { return ConfigurationManager.AppSettings["UploatStatVersion"]; }
}
public EnumModuleName ModuleEnum
{
get { return this.moduleEnum; }
set { this.moduleEnum = value; }
}
public string FunctionName
{
get { return this.functionName; }
set { this.functionName = value; }
}
//??????????????????virtual???????????return View()????У????????????
//
// ??:
// ????в??????????? MVC ?????á?
//
// ????:
// filterContext:
// ???????????
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
try
{
string userName = filterContext.HttpContext.User.Identity.Name;
this.userId = userName.Replace("china\"?? "");
}
catch (Exception)
{
this.userId = string.Empty;
}
}
//
// ??:
// ????в?????????? MVC ?????á?
//
// ????:
// filterContext:
// ???????????
public override void OnResultExecuting(ResultExecutingContext filterContext)
{
UserLogUtils.LogUserStatic(this.userId?? this.Version??
EnumUtils.getEnumDescByValue((int)this.moduleEnum?? typeof(EnumModuleName))??
this.functionName);
}
}
??Controller???淽??????????????
1
2
3
4
5
6
//????
[SuperLogStat(ModuleEnum = EnumModuleName.ModuleHome?? FunctionName = "?????")]
public ActionResult MyApplyToAuditing()
{
return View();
}
???????ActionFilterAttribute????????÷???????????????????????????????????????????????
??????3??????????????÷???
????????????????÷????.Net??????????????????new????????????MEF?????????????????????
????????????????????????
????[Export("Impc_TB_Test"?? typeof(Ifc_TB_Test))]
????public class Impc_TB_Test : Ifc_TB_Test
????{
????......
????}
??????????????κ?????
????public interface Ifc_TB_Test
????{
????......
????}
??????????????????????[Import]???????????????????????new???Impc_TB_Test??????
????[Import("Impc_TB_Test")]
????Ifc_TB_Test service { get; set; }
?????????service????????????????????????Impc_TB_Test????????á??????????
????????????÷?????????ù????????????????????????÷???????????????????????????~~
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???????C#?е?StringC# Socket???????????????????C#?????????????????????????C#???????C#????????????Log4net??????δ????C#?????????????C#?????????????????C#???????????????C#????????????????C#7 ?е?Tuple??????C#??TypeScript - GeneratorC# ?????????細(xì)??????????C#?е???н???C#??MySQL?????????μ??Ч?????д??C#????C++??dll???C#??VS2010????е??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????