本文整理汇总了C#中PropertyType类的典型用法代码示例。如果您正苦于以下问题:C# PropertyType类的具体用法?C# PropertyType怎么用?C# PropertyType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyType类属于命名空间,在下文中一共展示了PropertyType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: AddNewPropertyToForm
public AddNewPropertyToForm(Guid formId, Guid propertyId, PropertyType type, string name)
{
FormId = formId;
PropertyId = propertyId;
Type = type;
Name = name;
}
示例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;
}
示例4: BizTalkContextProperty
public BizTalkContextProperty(string ns, string name, object value, PropertyType propertyType)
{
this.Namespace = ns;
this.Name = name;
this.Value = value;
this.PropertyType = propertyType;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例9: PropertyInfo
public PropertyInfo(PropertyData propertyData, PropertyType type, bool canAuto, bool extended)
{
this.canAuto = canAuto;
this.extended = extended;
this.propertyData = propertyData;
this.type = type;
}
示例10: Replace
public static void Replace(PropertyInstance propertyInstance, PropertyType newType)
{
TerrainInstance t = propertyInstance.terrainInstance;
Destroy( t.property.gameObject );
t.property = null;
Create( t, newType );
}
示例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;
}
示例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;
}
示例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;
}
}
示例14: XmlBamlPropertyElement
public XmlBamlPropertyElement(XmlBamlElement parent, PropertyType propertyType, PropertyDeclaration propertyDeclaration)
: base(parent)
{
_propertyType = propertyType;
this.propertyDeclaration = propertyDeclaration;
this.TypeDeclaration = propertyDeclaration.DeclaringType;
}
示例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;
}