当前位置: 首页>>代码示例>>C#>>正文


C# Dynamic.ExpandoObject类代码示例

本文整理汇总了C#中System.Dynamic.ExpandoObject的典型用法代码示例。如果您正苦于以下问题:C# System.Dynamic.ExpandoObject类的具体用法?C# System.Dynamic.ExpandoObject怎么用?C# System.Dynamic.ExpandoObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


System.Dynamic.ExpandoObject类属于命名空间,在下文中一共展示了System.Dynamic.ExpandoObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ParseQueryString

        public static dynamic ParseQueryString(this string queryString)
        {
            dynamic parsedQueryString = new System.Dynamic.ExpandoObject();

            var nameV = new Dictionary<string, string>();
            if (string.IsNullOrEmpty(queryString)) return parsedQueryString;

            var pairs = queryString.Split('&');
            foreach (var pair in pairs)
            {
                var parts = pair.Split(new []{'='}, 2);

                var name = System.Uri.UnescapeDataString(parts[0]);
                var value = parts.Length == 1 ? string.Empty : System.Uri.UnescapeDataString(parts[1]);

                nameV.Add(name, value);
            }
            //DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(Dictionary<int, List<int>>));

            //using (MemoryStream ms = new MemoryStream())
            //{
            //    serializer.WriteObject(ms, nameV);
            //}
            var temp = JsonConvert.SerializeObject(nameV, new KeyValuePairConverter());

            return temp;
        }
开发者ID:projecteon,项目名称:OAuth2,代码行数:27,代码来源:StringExtensions.cs

示例2: LogOn

        public object LogOn(LoginModel model)
        {
            dynamic result = new System.Dynamic.ExpandoObject();

            result.success = AuthorityService.Logon(model.UserName, model.Password, model.RememberMe);
            return result;
        }
开发者ID:BGCX262,项目名称:zxd-svn-to-git,代码行数:7,代码来源:AdminController.cs

示例3: createpost

        public ActionResult createpost()
        {
            dynamic data = new System.Dynamic.ExpandoObject();

            LogHelper.Info(Masterpage.CurrUser.alias, "804012:客户," + Masterpage.CurrUser.client_code + ",创建在线答疑");
            return PartialView("createpost", data);
        }
开发者ID:gofixiao,项目名称:dlerp,代码行数:7,代码来源:diagnosticController.cs

示例4: Edit

 public ActionResult Edit(int id)
 {
     //var company = uow.Repository<TBL_COMPANIES>().GetById(id);
     dynamic model = new System.Dynamic.ExpandoObject();
     model.companyId = id;
     return PartialView("Edit", model);
 }
开发者ID:jigshGitHub,项目名称:SandlerTrainingDevelopment,代码行数:7,代码来源:CompaniesController.cs

示例5: InitializeComponent

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Dynamic.ExpandoObject expandoObject1 = new System.Dynamic.ExpandoObject();
            this.browserControl1 = new BinaryAnalysis.UI.Controls.BrowserControl();
            this.SuspendLayout();
            // 
            // browserControl1
            // 
            this.browserControl1.BaseModel = expandoObject1;
            this.browserControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.browserControl1.Location = new System.Drawing.Point(0, 0);
            this.browserControl1.Name = "browserControl1";
            this.browserControl1.Size = new System.Drawing.Size(686, 552);
            this.browserControl1.TabIndex = 0;
            // 
            // BrowserWindow
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(686, 552);
            this.Controls.Add(this.browserControl1);
            this.Name = "BrowserWindow";
            this.Text = "BrowserWindow";
            this.ResumeLayout(false);

        }
开发者ID:ikutsin,项目名称:BinaryAnalysis.Core,代码行数:30,代码来源:BrowserWindow.Designer.cs

示例6: GoogleMap

        // GET: /Map/GoogleMap
        public ActionResult GoogleMap()
        {
            dynamic uav_event_user = new System.Dynamic.ExpandoObject();
            uav_event_user.UAVs = db.UAVs.ToList();
            uav_event_user.Eventlog = db.EventLogs.ToList();
            uav_event_user.Operator = db.Users.ToList();
            uav_event_user.missions = db.Missions.ToList();

            string name = (string)Session["current_user"];

            if(name != null)
            {
                var curUser = (from u in db.Users
                               where u.username.Equals(name)
                              select new
                              {
                                  username = u.username,
                                  user_id = u.user_id,
                              }).FirstOrDefault();

                if (curUser != null)
                {
                    var assignedUavs = (from u in db.UAVs
                                       where u.User_user_id == curUser.user_id
                                        select u.Id).ToList();


                    ViewBag.currentUser = curUser;
                    ViewBag.assignedUavs = assignedUavs;
                }
            }

            return View(uav_event_user);
        }
开发者ID:dragosguta,项目名称:NEST-App,代码行数:35,代码来源:MapController.cs

示例7: CreateAnonymousObjectFromDictionary

 private object CreateAnonymousObjectFromDictionary(Dictionary<string,object> properties)
 {
     var obj = new System.Dynamic.ExpandoObject();
     var props = (ICollection<KeyValuePair<string, object>>)obj;
     foreach (var x in properties) props.Add(x);
     return obj;
 }
开发者ID:osmedile,项目名称:TypeCobol,代码行数:7,代码来源:RazorEngine.cs

示例8: canreturntab

 public ActionResult canreturntab(string order, string no)
 {
     dynamic data = new System.Dynamic.ExpandoObject();
     var had = stockinService.ReturnDetailList(no, order);
     var orderdetail = stockinService.ReturnDetailListByOrder(order).ToList();
     if (had != null && had.Count > 0)
     {
         foreach (var item in orderdetail)
         {
             var h = had.FirstOrDefault(p => p.purchaseDetailSn == item.purchaseDetailSn);
             if (h != null)
             {
                 item.returnAmount = h.returnAmount;
                 item.depotId = h.depotId;
                 item.depotName = h.depotName;
                 item.returnSn = h.returnSn;
                 item.returnNo = h.returnNo;
                 item.remark = h.remark;
             }
         }
     }
     var depots = stockinService.QueryDepot(1).Select(x => new SelectListItem { Text = x.depotName, Value = x.depotId.ToString() }).ToList();
     data.depots = depots;
     data.no = no;
     data.order = order;
     data.list = orderdetail;
     return PartialView(data);
 }
开发者ID:gofixiao,项目名称:dlerp,代码行数:28,代码来源:stockinController.cs

示例9: Index

        // GET: /DetailView/
        public ActionResult Index()
        {
            dynamic uavDetailList = new System.Dynamic.ExpandoObject();
            uavDetailList.UAVs = db.UAVs.ToList();
            uavDetailList.FlightStates = db.FlightStates.ToList();
            uavDetailList.missions = db.Missions.ToList();
            uavDetailList.Configurations = db.Configurations.ToList();
            uavDetailList.Eventlog = db.EventLogs.ToList();

            string name = (string)Session["current_user"];

            if(name != null)
            {
                var curUser = (from u in db.Users
                               where u.username.Equals(name)
                              select new
                              {
                                  username = u.username,
                                  user_id = u.user_id,
                              }).FirstOrDefault();
                    ViewBag.currentUser = curUser;
            }

            return View(uavDetailList);
        }
开发者ID:dragosguta,项目名称:NEST-App,代码行数:26,代码来源:DetailViewController.cs

示例10: biogasfullscreen

        public ActionResult biogasfullscreen()
        {
            dynamic data = new System.Dynamic.ExpandoObject();
            string title = WebRequest.GetString("t", true);

            string w = WebRequest.GetString("w", true);
            string h = WebRequest.GetString("h", true);
            string n = WebRequest.GetString("n", true);
            string m = WebRequest.GetString("m", true);
            string acl = WebRequest.GetString("acl", true);
            string acr = WebRequest.GetString("acr", true);
            string line = WebRequest.GetString("line", true);
            #region 图表
            var one = materialService.GetOneMaterialSpecification(m);
            var chart = costanalysisService.GetFlexChart("CC10");
            chart.charttype = line;
            chart.title = (one != null ? one.MaterialSpecificationName : "") + title;
            chart.height = int.Parse(h);
            chart.width = int.Parse(w);
            chart.leftprecision = int.Parse(acl);
            chart.rightprecision = int.Parse(acr);
            chart.customercode = Masterpage.CurrUser.client_code;
            chart.url = Utils.GetFlexAddress();
            #endregion
            data.chart = JsonHelper.ToJson(chart);
            LogHelper.Info(Masterpage.CurrUser.alias, "401032:客户," + Masterpage.CurrUser.client_code + ",查看全屏图表,耗材为:" + m);
            return View("chartfullscreen", data);
        }
开发者ID:gofixiao,项目名称:dlerp,代码行数:28,代码来源:costanalysisController.cs

示例11: canreturnrlist

        public ActionResult canreturnrlist(int? page, int? pagesize, int supplier, string no, string query)
        {
            dynamic data = new System.Dynamic.ExpandoObject();
            var had = stockoutService.GetReturnHadOut(no);
            var all = stockoutService.GetCanReturn(supplier,query);
            #region 合并
            if (all != null && had != null)
            {
                foreach (var item in all)
                {
                    var h = had.FirstOrDefault(p => p.text == item.text);
                    if (h == null) had.Add(item);
                }
            }
            #endregion

            int _page = page.HasValue ? page.Value : 1;
            int _pagesize = pagesize.HasValue ? pagesize.Value : 12;
            var vs = had.ToPagedList(_page, _pagesize);
            data.no = no;
            data.query = query;
            data.supplier = supplier;
            data.list = vs;
            data.pageSize = _pagesize;
            data.pageIndex = _page;
            data.totalCount = vs.TotalCount;
            return PartialView(data);
        }
开发者ID:gofixiao,项目名称:dlerp,代码行数:28,代码来源:stockoutController.cs

示例12: Login

        public ActionResult Login(string url, string v1, string v2, string remember_me)
        {
            dynamic data = new System.Dynamic.ExpandoObject();
            data.url = url;
            data.v1 = v1;
            data.v2 = v2;
            data.message = SessionHelper.GetSession("AutoNeedLogin");//异地登录时,会有提示信息
            Session["WebSessionId"] = Session.SessionID;
            var sid = SessionHelper.SessionId;
            SessionHelper.SetSession("SessionHelperSessionId", sid);
            string uid = "";
            bool remember = false;
            var rmb = CookieHelper.GetCookieValue("remember_me");
            if (rmb != null && rmb == "on")
            {
                uid = CookieHelper.GetCookieValue("remember_userid");
                remember = true;
            }
            data.remember = remember;
            data.uid = uid;
            #region 加密狗
            //Dog dog = new Dog(100);
            //// Read the string variable from the dog
            //dog.DogAddr = 0;			// The address read
            //dog.DogBytes = 10;			// The number of bytes read

            //dog.ReadDog();
            //bool hdog = (dog.Retcode == 0);
              bool hdog = true;
            #endregion
             data.dog = hdog;
            return View(data);
        }
开发者ID:gofixiao,项目名称:dlerp,代码行数:33,代码来源:AccountController.cs

示例13: bioefficiencysop

 public ActionResult bioefficiencysop(int? page, int? pagesize)
 {
     string unit = WebRequest.GetString("unit", true);
     string start = WebRequest.GetString("start", true);
     string end = WebRequest.GetString("end", true);
     dynamic data = new System.Dynamic.ExpandoObject();
     var list = managementService.GetCustomerBioefficiencySop(Masterpage.CurrUser.client_code, unit, start, end);
     int _page = page.HasValue ? page.Value : 1;
     int _pagesize = pagesize.HasValue ? pagesize.Value : 14;
     var vs = list.ToPagedList(_page, _pagesize);
     data.list = vs;
     data.unit = unit;
     data.start = start;
     data.end = end;
     data.pageSize = _pagesize;
     data.pageIndex = _page;
     data.totalCount = vs.TotalCount;
     data.ddlunit = managementService.GetStandardProcessUnitDDL(Masterpage.CurrUser.client_code);
     string otherparam = "";
     if (unit != "") otherparam += "&unit=" + unit;
     if (start != "") otherparam += "&start=" + start;
     if (end != "") otherparam += "&end=" + end;
     data.otherParam = otherparam;
     LogHelper.Info(Masterpage.CurrUser.alias, "607011:客户," + Masterpage.CurrUser.client_code + ",生物增效SOP列表,第" + _page + "页");
     return View(data);
 }
开发者ID:gofixiao,项目名称:dlerp,代码行数:26,代码来源:managementController.cs

示例14: GetAjaxRet

 public static dynamic GetAjaxRet(int result_code, string message)
 {
     dynamic ret = new System.Dynamic.ExpandoObject();
     ret.result = result_code;
     ret.message = message;
     return ret;
 }
开发者ID:dannisjuntai,项目名称:ttcs,代码行数:7,代码来源:Helper.cs

示例15: CreateExpandoObject

 public static dynamic CreateExpandoObject()
 {
     dynamic bag = new System.Dynamic.ExpandoObject();
     bag.Name = "Eddy";
     bag.Display = (Action<string>) ((text) => Console.WriteLine(text));
     return bag;
 }
开发者ID:adrienbuffet,项目名称:3NETCourse,代码行数:7,代码来源:ExpandoObject.cs


注:本文中的System.Dynamic.ExpandoObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。