• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PropertyType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SelectDropDown

 public static void SelectDropDown(string element, string value, PropertyType elementtype)
 {
     if (elementtype == PropertyType.Id)
         new SelectElement(PropertiesCollection.driver.FindElement(By.Id(element))).SelectByText(value);
     if (elementtype == PropertyType.Name)
         new SelectElement(PropertiesCollection.driver.FindElement(By.Name(element))).SelectByText(value);
 }
开发者ID:chuckfrazier,项目名称:DataPlatform,代码行数:7,代码来源:SetMethods.cs


示例2: AddNewPropertyToForm

 public AddNewPropertyToForm(Guid formId, Guid propertyId, PropertyType type, string name)
 {
     FormId = formId;
     PropertyId = propertyId;
     Type = type;
     Name = name;
 }
开发者ID:AlexeyRaga,项目名称:Ziggurat,代码行数:7,代码来源:Definition.generated.cs


示例3: Execute

        /// <summary>
        /// Performs the package action during package installation
        /// </summary>
        /// <param name="packageName">
        /// The package name.
        /// </param>
        /// <param name="xmlData">
        /// The xml data.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/> indicating success of failure.
        /// </returns>
        public bool Execute(string packageName, XmlNode xmlData)
        {
            var dtd = _services.DataTypeService.GetDataTypeDefinitionById(-88);

            // Create the MerchelloCustomer MemberType
            var mt = new MemberType(-1)
            {
                Alias = MemberTypeName,
                Name = MemberTypeName,
                AllowedAsRoot = true
            };

            var fn = new PropertyType(dtd) { Alias = "firstName", Name = "First name" };
            var ln = new PropertyType(dtd) { Alias = "lastName", Name = "Last name" };

            mt.AddPropertyType(fn);
            mt.AddPropertyType(ln);

            mt.SetMemberCanEditProperty("firstName", true);
            mt.SetMemberCanEditProperty("lastName", true);
            mt.SetMemberCanViewProperty("firstName", true);
            mt.SetMemberCanViewProperty("lastName", true);

            _services.MemberTypeService.Save(mt);

            // Add the MemberGroup
            var mg = new MemberGroup() { Name = MemberGroupName };

            _services.MemberGroupService.Save(mg);

            return true;
        }
开发者ID:ProNotion,项目名称:Merchello,代码行数:44,代码来源:AddMembershipTypeAndGroup.cs


示例4: BizTalkContextProperty

 public BizTalkContextProperty(string ns, string name, object value, PropertyType propertyType)
 {
     this.Namespace = ns;
     this.Name = name;
     this.Value = value;
     this.PropertyType = propertyType;
 }
开发者ID:niik,项目名称:DtaSpy,代码行数:7,代码来源:BizTalkContextProperty.cs


示例5: GetImportValue

        public string GetImportValue(PropertyType propType, string content)
        {
            LogHelper.Debug<ContentDataTypeMapper>("Mapping a datatype: {0} {1}", () => propType.DataTypeDefinitionId, () => content);

            var prevalues =
                ApplicationContext.Current.Services.DataTypeService.GetPreValuesCollectionByDataTypeId(propType.DataTypeDefinitionId)
                                  .PreValuesAsDictionary;

            if (prevalues != null && prevalues.Count > 0)
            {
                var importValue = "";

                var values = content.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                foreach(var alias in values)
                {
                    string preValue = prevalues.Where(kvp => kvp.Key == alias)
                                        .Select(kvp => kvp.Value.Id.ToString())
                                        .SingleOrDefault();

                    if (!String.IsNullOrWhiteSpace(preValue))
                    {
                        importValue = string.Format("{0}{1},", importValue, preValue);
                    }
                    else
                    {
                        importValue = string.Format("{0}{1},", alias, preValue);
                    }
                }
                LogHelper.Debug<ContentDataTypeMapper>("Setting value {0} to {1}", () => content, () => importValue.Trim(","));
                return importValue.Trim(",");
            }
            return content;
        }
开发者ID:jannikanker,项目名称:uSync,代码行数:34,代码来源:ContentDataTypeMapper.cs


示例6: UtilProperty

 public UtilProperty(string desc, int data, Func<UtilProperty, bool> OnUpdate = null)
 {
     this.Description = desc;
     this.Data = OriginalData = data;
     this.Type = PropertyType.Integer;
     this.OnUpdate = OnUpdate;
 }
开发者ID:BGCX261,项目名称:ziggy-pro-editor-svn-to-git,代码行数:7,代码来源:UtilProperty.cs


示例7: AddHomeOnlyBannerTextArea

        private void AddHomeOnlyBannerTextArea()
        {
            var migrationName = MethodBase.GetCurrentMethod().Name;

            try
            {
                var path = HostingEnvironment.MapPath(MigrationMarkersPath + migrationName + ".txt");
                if (File.Exists(path))
                    return;

                var contentTypeService = UmbracoContext.Current.Application.Services.ContentTypeService;
                var communityContentType = contentTypeService.GetContentType("Community");
                var propertyTypeAlias = "homeOnlyBanner";
                if (communityContentType.PropertyTypeExists(propertyTypeAlias) == false)
                {
                    var textarea = new DataTypeDefinition("Umbraco.TextboxMultiple");
                    var textareaPropertyType = new PropertyType(textarea, propertyTypeAlias) { Name = "Banner (only shown on home)" };
                    communityContentType.AddPropertyType(textareaPropertyType, "Banners");
                    communityContentType.MovePropertyType("mainNotification", "Banners");
                    contentTypeService.Save(communityContentType);
                }

                string[] lines = { "" };
                File.WriteAllLines(path, lines);
            }
            catch (Exception ex)
            {
                LogHelper.Error<MigrationsHandler>(string.Format("Migration: '{0}' failed", migrationName), ex);
            }
        }
开发者ID:leekelleher,项目名称:OurUmbraco,代码行数:30,代码来源:MigrationsHandler.cs


示例8: WhenINeedCompanyToHaveProperty

 public void WhenINeedCompanyToHaveProperty(string companyName, PropertyType type, string propertyName)
 {
     context.For<Company>(companyName)
            .Exists(propertyName, company => company.CompanyProperty);
     context.For<CompanyProperty>(propertyName)
            .IsTrue(property => property.Type == type);
 }
开发者ID:repinvv,项目名称:TestingContext,代码行数:7,代码来源:CompanyPropertyWhen.cs


示例9: PropertyInfo

 public PropertyInfo(PropertyData propertyData, PropertyType type, bool canAuto, bool extended)
 {
     this.canAuto = canAuto;
     this.extended = extended;
     this.propertyData = propertyData;
     this.type = type;
 }
开发者ID:mono,项目名称:lunareclipse,代码行数:7,代码来源:PropertyInfo.cs


示例10: Replace

 public static void Replace(PropertyInstance propertyInstance, PropertyType newType)
 {
     TerrainInstance t = propertyInstance.terrainInstance;
     Destroy( t.property.gameObject );
     t.property = null;
     Create( t, newType );
 }
开发者ID:Kingsquee,项目名称:Warengine,代码行数:7,代码来源:PropertyInstance.cs


示例11: FindByPropertyType

        public static Property FindByPropertyType(Entity entity, PropertyType propertyType)
        {
            if (entity == null) throw new ArgumentNullException("entity");

            foreach (var property in entity.AllProperties)
            {
                if (property.GetAttributeValue("propertyType", Constants.NamespaceUri, PropertyType.None) == propertyType)
                {
                    return property;
                }
            }

            PropertyTypeCompatibility compatibility = (PropertyTypeCompatibility) propertyType;
            foreach (var property in entity.AllProperties)
            {
                var value = property.GetAttributeValue("propertyType", Constants.NamespaceUri, PropertyTypeCompatibility.None);
                if (value == compatibility ||
                    (value == PropertyTypeCompatibility.User && propertyType == PropertyType.UserClaimUser) ||
                    (value == PropertyTypeCompatibility.User && propertyType == PropertyType.UserLoginUser))
                {
                    return property;
                }
            }

            return null;
        }
开发者ID:modulexcite,项目名称:CodeFluent-Entities,代码行数:26,代码来源:ProjectUtilities.cs


示例12: createProperty

        public Property createProperty(String name, PropertyType type, String country, String street, int number, bool savePropertyToFile)
        {
            Address address;
            Property property;

            if (number >= 0)
            {
                address = new Address(country, street, number);
            }
            else
            {
                address = new Address(country, street);
            }

            property = new Property(name, type, address);

            try
            {
                if (savePropertyToFile)
                {
                    propertyRepository.save(property);
                }

                return property;
            }
            catch (ValidationException)
            {
                log.Info("Property validation exception");
            }

            return null;
        }
开发者ID:LaurentiuUngur,项目名称:MAP_First_Project_C-,代码行数:32,代码来源:PropertyController.cs


示例13: SearchProperties

        public List<PropertyInfo> SearchProperties(PropertyType propertyType, string address, int? minPrice, int? maxPrice)
        {
            using (var connection = GetOpenConnection())
            {
                var sql = @"select * from PropertyInfo
                               where 1 = 1";
                if (propertyType == PropertyType.Rent || propertyType == PropertyType.Sale)
                {
                    sql += @" and PropertyType = @propertyType";
                }
                if (!String.IsNullOrWhiteSpace(address))
                {
                    sql += @" and Address like CONCAT('%', @address, '%')";
                }
                if (minPrice.HasValue && maxPrice.HasValue)
                {
                    sql += @" and Price between @minPrice and @maxPrice";
                }
                sql += @" select * from Photo";

                List<PropertyInfo> propertyInfos;
                using (var multi = connection.QueryMultiple(sql, new { propertyType=propertyType, address = address, minPrice = minPrice, maxPrice = maxPrice }))
                {
                    propertyInfos = multi.Read<PropertyInfo>().ToList();
                    var photos = multi.Read<Photo>();
                    propertyInfos.ForEach((p) =>
                    {
                        p.Photos = photos.Where(photo => photo.PropertyId == p.Id).ToList();
                    });
                };
                return propertyInfos;
            }
        }
开发者ID:RayKwon,项目名称:simple_realestate,代码行数:33,代码来源:PropertyDao.cs


示例14: XmlBamlPropertyElement

		public XmlBamlPropertyElement(XmlBamlElement parent, PropertyType propertyType, PropertyDeclaration propertyDeclaration)
			: base(parent)
		{
			_propertyType = propertyType;
			this.propertyDeclaration = propertyDeclaration;
			this.TypeDeclaration = propertyDeclaration.DeclaringType;
		}
开发者ID:rmattuschka,项目名称:ILSpy,代码行数:7,代码来源:XmlBamlPropertyElement.cs


示例15: PropertyRead

        private static bool PropertyRead(ConfigResource resource, PropertyType propertyType, Queue<string> keyQueue, string key, string val)
        {
            bool success = false;
            if (config != null)
            {
                switch (propertyType)
                {
                    case PropertyType.Property:
                        success = true;
                        ApplyProperty(keyQueue, key, val);
                        break;
                    case PropertyType.If:
                        if (config.Properties.ContainsKey(val))
                        {
                            success = !Convert.ToBoolean(config.Properties[val]);
                        }
                        break;
                    case PropertyType.Import:
                        ConfigResource res = resource.GetLocalConfigResource(string.Format(@"{0}.properties", val));
                        success = res.Exists;
                        break;
                }
            }

            return success;
        }
开发者ID:nguyenhuuhuy,项目名称:mygeneration,代码行数:26,代码来源:ScintillaPropertiesHelper.cs


示例16: EnterText

 public static void EnterText(string element, string value, PropertyType elementtype)
 {
     if (elementtype == PropertyType.Id)
         PropertiesCollection.driver.FindElement(By.Id(element)).SendKeys(value);
     if (elementtype == PropertyType.Name)
         PropertiesCollection.driver.FindElement(By.Name(element)).SendKeys(value);
 }
开发者ID:chuckfrazier,项目名称:DataPlatform,代码行数:7,代码来源:SetMethods.cs


示例17: RuleParameterAttribute

 public RuleParameterAttribute(string key, PropertyType type, string description, string defaultValue)
 {
     Key = key;
     Description = description;
     Type = type;
     DefaultValue = defaultValue;
 }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:7,代码来源:RuleParameterAttribute.cs


示例18: SetType

 public void SetType(string typeName)
 {
   switch (typeName)
   {
     case "string":
     case "text":
     case "sequence":
       this.Type = PropertyType.text;
       break;
     case "integer":
     case "float":
     case "decimal":
       this.Type = PropertyType.number;
       break;
     case "date":
       this.Type = PropertyType.date;
       break;
     case "item":
       this.Type = PropertyType.item;
       break;
     case "list":
     case "filter list":
       this.Type = PropertyType.list;
       break;
     default:
       this.Type = PropertyType.unknown;
       break;
   }
 }
开发者ID:cornelius90,项目名称:InnovatorAdmin,代码行数:29,代码来源:Property.cs


示例19: PropertyData

 public PropertyData(Guid formId, Guid propertyId, string name, PropertyType type)
 {
     FormId     = formId;
     PropertyId = propertyId;
     Name       = name;
     Type       = type;
 }
开发者ID:AlexeyRaga,项目名称:Ziggurat,代码行数:7,代码来源:PropertyData.cs


示例20: Property

 public Property(int id, Guid version, PropertyType propertyType, object value)
 {
     Id = id;
     _propertyType = propertyType;
     _version = version;
     Value = value;
 }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:7,代码来源:Property.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PropertyValue类代码示例发布时间:2022-05-24
下一篇:
C# PropertySet类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap