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


C# IDictionary.Merge方法代码示例

本文整理汇总了C#中IDictionary.Merge方法的典型用法代码示例。如果您正苦于以下问题:C# IDictionary.Merge方法的具体用法?C# IDictionary.Merge怎么用?C# IDictionary.Merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDictionary的用法示例。


在下文中一共展示了IDictionary.Merge方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckBox

        public static MvcHtmlString CheckBox(
            this HtmlHelper htmlHelper,
            string name,
            bool isChecked,
            Property property,
            IDictionary<string, object> htmlAttributes)
        {
            var validationAttributes = PropertyUnobtrusiveValidationAttributesGenerator
                .GetValidationAttributes(property, htmlHelper.ViewContext);

            htmlAttributes = htmlAttributes.Merge(validationAttributes);

            return htmlHelper.CheckBox(name, isChecked, htmlAttributes);
        }
开发者ID:rgonek,项目名称:Ilaro.Admin,代码行数:14,代码来源:HtmlHelperCheckBoxExtensions.cs

示例2: Password

        public static MvcHtmlString Password(
            this HtmlHelper htmlHelper,
            string name,
            object value,
            Property property,
            IDictionary<string, object> htmlAttributes)
        {
            var validationAttributes = PropertyUnobtrusiveValidationAttributesGenerator
                .GetValidationAttributes(property, htmlHelper.ViewContext);

            htmlAttributes = htmlAttributes.Merge(validationAttributes);

            return htmlHelper.Password(name, value, htmlAttributes);
        }
开发者ID:tassyo1,项目名称:Ilaro.Admin,代码行数:14,代码来源:HtmlHelperPasswordExtensions.cs

示例3: DropDownList

        public static MvcHtmlString DropDownList(
            this HtmlHelper htmlHelper,
            string name,
            IEnumerable<SelectListItem> selectList,
            Property property,
            IDictionary<string, object> htmlAttributes)
        {
            var validationAttributes = PropertyUnobtrusiveValidationAttributesGenerator
                .GetValidationAttributes(property, htmlHelper.ViewContext);

            htmlAttributes = htmlAttributes.Merge(validationAttributes);

            return htmlHelper.DropDownList(name, selectList, htmlAttributes);
        }
开发者ID:rgonek,项目名称:Ilaro.Admin,代码行数:14,代码来源:HtmlHelperDropDownListExtensions.cs

示例4: TextArea

        public static MvcHtmlString TextArea(
            this HtmlHelper htmlHelper,
            string name,
            string value,
            Property property,
            IDictionary<string, object> htmlAttributes)
        {
            // create own metadata based on PropertyViewModel
            var metadata = new ModelMetadata(
                ModelMetadataProviders.Current,
                property.Entity.Type,
                null,
                property.TypeInfo.Type,
                property.Name);
            var validationAttributes =
                htmlHelper.GetUnobtrusiveValidationAttributes(name, metadata);

            htmlAttributes = htmlAttributes.Merge(validationAttributes);

            return htmlHelper.TextArea(name, value, htmlAttributes);
        }
开发者ID:anupvarghese,项目名称:Ilaro.Admin,代码行数:21,代码来源:HtmlHelpersTextAreaExtensions.cs

示例5: DropDownList

        public static MvcHtmlString DropDownList(
            this HtmlHelper htmlHelper,
            string name,
            IEnumerable<SelectListItem> selectList,
            Property property,
            IDictionary<string, object> htmlAttributes)
        {
            // create own metadata based on PropertyViewModel
            var metadata = new ModelMetadata(
                ModelMetadataProviders.Current,
                property.Entity.Type,
                null,
                property.TypeInfo.Type,
                property.Name);
            var validationAttributes =
                htmlHelper.GetUnobtrusiveValidationAttributes(name, metadata);

            htmlAttributes = htmlAttributes.Merge(validationAttributes);

            return htmlHelper.DropDownList(name, selectList, htmlAttributes);
        }
开发者ID:anupvarghese,项目名称:Ilaro.Admin,代码行数:21,代码来源:HtmlHelperDropDownListExtensions.cs

示例6: GetDataFields

        private IDictionary<string, string> GetDataFields(NancyContext context)
        {
            var dictionaries = new IDictionary<string, string>[]
                {
                    ConvertDynamicDictionary(context.Request.Form),
                    ConvertDynamicDictionary(context.Request.Query),
                    ConvertDynamicDictionary(context.Parameters)
                };

            return dictionaries.Merge();
        }
开发者ID:frankgeerlings,项目名称:Nancy,代码行数:11,代码来源:DefaultBinder.cs

示例7: LoadInclude

    private bool LoadInclude(XmlNode node, IDictionary<string, string> defines)
    {
      if (node == null || Children == null)
      {
        return false;
      }

      try
      {
        XmlDocument doc = new XmlDocument();

        doc.Load(GUIGraphicsContext.GetThemedSkinFile("\\" + node.InnerText));

        if (doc.DocumentElement == null)
        {
          return false;
        }

        // Load #defines specified in the included skin xml document and add them to the existing (parent document) set of #defines.
        // The dictionary merge replaces the value of duplicates.
        IDictionary<string, string> includeDefines = LoadDefines(doc);
        defines = defines.Merge(includeDefines);

        if (doc.DocumentElement.Name != "window")
        {
          return false;
        }

        var xmlNodeList = doc.DocumentElement.SelectNodes("/window/controls/control");
        if (xmlNodeList != null)
          foreach (XmlNode controlNode in xmlNodeList)
          {
            LoadControl(controlNode, defines);
          }

        return true;
      }
      catch (FileNotFoundException e)
      {
        Log.Error("SKIN: Missing {0}", e.FileName);
        return false;
      }
      catch (Exception e)
      {
        Log.Error("GUIWIndow.LoadInclude: {0}", e.Message);
      }

      return false;
    }
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:49,代码来源:GUIWindow.cs

示例8: Serialize

        protected override void Serialize(IDictionary<string, object> json)
        {
            if (Transport.Read.Url == null)
            {
                // If Url is not set assume the current url (used in server binding)
                Transport.Read.Url = "";
            }

            var transport = Transport.ToJson();

            if (transport.Keys.Any())
            {
                json["transport"] = transport;
            }

            if (PageSize > 0)
            {
                json["pageSize"] = PageSize;
                json["page"] = Page;
                json["total"] = Total;
            }

            if (ServerPaging)
            {
                json["serverPaging"] = ServerPaging;
            }

            if (ServerSorting)
            {
                json["serverSorting"] = ServerSorting;
            }

            if (ServerFiltering)
            {
                json["serverFiltering"] = ServerFiltering;
            }

            if (ServerGrouping)
            {
                json["serverGrouping"] = ServerGrouping;
            }

            if (ServerAggregates)
            {
                json["serverAggregates"] = ServerAggregates;
            }

            if (Type != null)
            {
                json["type"] = "aspnetmvc-" + Type.ToString().ToLower();
            }

            if (OrderBy.Any())
            {
                json["sort"] = OrderBy.ToJson();
            }

            if (Groups.Any())
            {
                json["group"] = Groups.ToJson();
            }

            if (Aggregates.Any())
            {
                json["aggregate"] = Aggregates.SelectMany(agg => agg.Aggregates.ToJson());
            }

            if (Filters.Any() || ServerFiltering)
            {
                json["filter"] = Filters.OfType<FilterDescriptorBase>().ToJson();
            }

            if (Events.Keys.Any())
            {
                json.Merge(Events);
            }

            json["schema"] = Schema.ToJson();

            if (Batch)
            {
                json["batch"] = Batch;
            }

            if (IsClientOperationMode && RawData != null)
            {
                json["data"] = new Dictionary<string, object>()
                {
                    { Schema.Data,  SerializeDataSource(RawData) },
                    { Schema.Total, Total }
                };
            }
            else if (Type == DataSourceType.Ajax && !IsClientOperationMode && Data != null)
            {
                json["data"] = new Dictionary<string, object>()
                {
                    { Schema.Data,  SerializeDataSource(Data) },
                    { Schema.Total, Total }
                };
            }
//.........这里部分代码省略.........
开发者ID:danielkaradachki,项目名称:HomeWork,代码行数:101,代码来源:DataSource.cs

示例9: Serialize


//.........这里部分代码省略.........
                }
            }

            if (!string.IsNullOrEmpty(OfflineStorageKey))
            {
                json["offlineStorage"] = OfflineStorageKey;
            }

            if (OfflineStorage.Any())
            {
                json["offlineStorage"] = OfflineStorage;
            }

            if (PageSize > 0)
            {
                json["pageSize"] = PageSize;
                json["page"] = Page;
                json["total"] = Total;
            }

            if (ServerPaging)
            {
                json["serverPaging"] = ServerPaging;
            }

            if (ServerSorting)
            {
                json["serverSorting"] = ServerSorting;
            }

            if (ServerFiltering)
            {
                json["serverFiltering"] = ServerFiltering;
            }

            if (ServerGrouping)
            {
                json["serverGrouping"] = ServerGrouping;
            }

            if (ServerAggregates)
            {
                json["serverAggregates"] = ServerAggregates;
            }

            if (OrderBy.Any())
            {
                json["sort"] = OrderBy.ToJson();
            }

            if (Groups.Any())
            {
                json["group"] = Groups.ToJson();
            }

            if (Aggregates.Any())
            {
                json["aggregate"] = Aggregates.SelectMany(agg => agg.Aggregates.ToJson());
            }

            if (Filters.Any() || ServerFiltering)
            {
                json["filter"] = Filters.OfType<FilterDescriptorBase>().ToJson();
            }

            if (Events.Keys.Any())
            {
                json.Merge(Events);
            }

            var schema = Schema.ToJson();
            if (schema.Keys.Any())
            {
                json["schema"] = schema;
            }

            if (Batch)
            {
                json["batch"] = Batch;
            }

            if (AutoSync)
            {
                json["autoSync"] = AutoSync;
            }

            if (IsClientOperationMode && Type == DataSourceType.Custom && CustomType != "aspnetmvc-ajax")
            {
                RawData = Data;
            }

            if (IsClientOperationMode && RawData != null)
            {
                SerializeData(json, RawData);
            }
            else if (IsClientBinding && !IsClientOperationMode && Data != null)
            {
                SerializeData(json, Data);
            }
        }
开发者ID:jstevenson81,项目名称:wodgeaux,代码行数:101,代码来源:DataSource.cs


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