本文整理汇总了C#中System.Property类的典型用法代码示例。如果您正苦于以下问题:C# Property类的具体用法?C# Property怎么用?C# Property使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Property类属于System命名空间,在下文中一共展示了Property类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Spec
public Spec(Property[] props)
{
foreach (Property prop in props)
{
spec.Add(prop);
}
}
开发者ID:zedr0n,项目名称:Screeps,代码行数:7,代码来源:Creep.cs
示例2: GetArgumentStringFor
public string GetArgumentStringFor(Property property)
{
return RawArgumentString
.Replace("#entity.Name#", property.Entity.Name)
.Replace("#property.Name#", property.Name)
.Replace("#property.Type#", property.Type);
}
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:7,代码来源:CustomAttribute.cs
示例3: establish_context
public override void establish_context()
{
property = ReflectionHelper.GetAccessor(GetPropertyExpression());
target = new PropertyEntity();
sut = new Property<PropertyEntity, string>(property, "expected");
}
开发者ID:roelofb,项目名称:fluent-nhibernate,代码行数:7,代码来源:PropertySpecs.cs
示例4: ApplyPropertyTemplate
protected virtual void ApplyPropertyTemplate(Property prop)
{
bool isReadOnly = false;
bool isList = false;
if (prop is ValueTypeProperty)
{
var vtp = (ValueTypeProperty)prop;
isList = vtp.IsList;
isReadOnly = vtp.IsCalculated;
}
else if (prop is CompoundObjectProperty)
{
isList = ((CompoundObjectProperty)prop).IsList;
}
else if (prop is ObjectReferenceProperty)
{
isList = ((ObjectReferenceProperty)prop).IsList();
}
else if (prop is CalculatedObjectReferenceProperty)
{
isReadOnly = true;
}
if (isList)
{
Properties.SimplePropertyListTemplate.Call(Host, ctx, prop);
}
else
{
Properties.SimplePropertyTemplate.Call(Host, ctx, prop, isReadOnly);
}
}
开发者ID:daszat,项目名称:zetbox,代码行数:33,代码来源:Template.cs
示例5: VisitProperty
public override bool VisitProperty(Property decl)
{
if(!AlreadyVisited(decl) && decl.ExplicitInterfaceImpl == null)
CheckDuplicate(decl);
return false;
}
开发者ID:jijamw,项目名称:CppSharp,代码行数:7,代码来源:CheckDuplicatedNamesPass.cs
示例6: Can_search_with_filters
public void Can_search_with_filters()
{
Property property = new Property { Id = Guid.NewGuid(), Name = "Property Name", BedroomCount = 3 };
Catalog catalog = new Catalog() { Id = Guid.NewGuid(), Type = "Waterfront", PropertyId = property.Id };
using(var store = NewDocumentStore())
using(var _session = store.OpenSession())
{
_session.Store(property);
_session.Store(catalog);
_session.SaveChanges();
var catalogs = _session.Advanced.DocumentQuery<Catalog>().WhereEquals("Type", "Waterfront").Select(c => c.PropertyId);
var properties = _session.Advanced.DocumentQuery<Property>();
properties.OpenSubclause();
var first = true;
foreach (var guid in catalogs)
{
if (first == false)
properties.OrElse();
properties.WhereEquals("__document_id", guid);
first = false;
}
properties.CloseSubclause();
var refinedProperties = properties.AndAlso().WhereGreaterThanOrEqual("BedroomCount", "2").Select(p => p.Id);
Assert.NotEqual(0, refinedProperties.Count());
}
}
开发者ID:j2jensen,项目名称:ravendb,代码行数:30,代码来源:Samina.cs
示例7: AttachEditorComponents
public static void AttachEditorComponents(Entity entity, string name, Property<Entity.Handle> target)
{
entity.Add(name, target);
if (entity.EditorSelected != null)
{
Transform transform = entity.Get<Transform>("Transform");
LineDrawer connectionLines = new LineDrawer { Serialize = false };
connectionLines.Add(new Binding<bool>(connectionLines.Enabled, entity.EditorSelected));
connectionLines.Add(new NotifyBinding(delegate()
{
connectionLines.Lines.Clear();
Entity targetEntity = target.Value.Target;
if (targetEntity != null)
{
Transform targetTransform = targetEntity.Get<Transform>("Transform");
if (targetTransform != null)
{
connectionLines.Lines.Add
(
new LineDrawer.Line
{
A = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(transform.Position, connectionLineColor),
B = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(targetTransform.Position, connectionLineColor)
}
);
}
}
}, transform.Position, target, entity.EditorSelected));
entity.Add(connectionLines);
}
}
开发者ID:dsmo7206,项目名称:Lemma,代码行数:34,代码来源:EntityConnectable.cs
示例8: TestSelectionViewModel
private TestSelectionViewModel()
{
_sourceControlBrowser = Property.New(this, p => p.SourceControlTestBrowser, OnPropertyChanged);
_fileSystemBrowser = Property.New(this, p => p.FileSystemTestBrowser, OnPropertyChanged);
_manualEntry = Property.New(this, p => p.ManualEntry, OnPropertyChanged);
_selectedTestCase = Property.New(this, p => p.SelectedTestCase, OnPropertyChanged);
}
开发者ID:testpulse,项目名称:TFSTestCaseAutomator,代码行数:7,代码来源:TestSelectionViewModel.cs
示例9: ModelMslEntityTypeMappingScalarProperty
public ModelMslEntityTypeMappingScalarProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Property prop, string parentName)
: base(_host)
{
this.ctx = ctx;
this.prop = prop;
this.parentName = parentName;
}
开发者ID:daszat,项目名称:zetbox,代码行数:7,代码来源:ModelMslEntityTypeMapping.ScalarProperty.cs
示例10: Configure
protected virtual PropertyControlInfo Configure(Property property)
{
var info = PropertyControlInfo.CreateFor(property);
if (Name != null) info.SetPropertyControlValue(property.Name, ControlInfoPropertyNames.DisplayName, Name);
if (Description != null) info.SetPropertyControlValue(property.Name, ControlInfoPropertyNames.Description, Description);
return info;
}
开发者ID:Sigillatus,项目名称:DinkPDN,代码行数:7,代码来源:ConfigurableAttribute.cs
示例11: OnValueChanged
private void OnValueChanged(Property property, object newValue) {
var field = GetType().GetField(property.Name);
if(newValue != null && !newValue.GetType().IsSubtypeOrEqualTo(field.FieldType))
return;
field.SetValue(this, newValue);
}
开发者ID:fachammer,项目名称:DataPrototypes,代码行数:7,代码来源:DataPrototype.cs
示例12: SimplePropertyListTemplate
public SimplePropertyListTemplate(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Property prop)
: base(_host)
{
this.ctx = ctx;
this.prop = prop;
}
开发者ID:daszat,项目名称:zetbox,代码行数:7,代码来源:SimplePropertyListTemplate.Designer.cs
示例13: Cursor
public Cursor(Entity ent, String name)
: base(ent, name)
{
m_Position = Entity.AddProperty<Vector3>("Position", Vector3.Zero);
Broadphases.Input inp = XNAGame.Instance.GetBroadphase<Broadphases.Input>("Input");
inp.MouseMoved += new Broadphases.MouseEventHandler(inp_MouseMoved);
}
开发者ID:Quantumplation,项目名称:Kannon,代码行数:7,代码来源:Cursor.cs
示例14: CollectProperties
private void CollectProperties(object instance, PropertyDescriptor descriptor, List<Property> propertyCollection, bool automaticlyExpandObjects, string filter)
{
if (descriptor.Attributes[typeof(FlatAttribute)] == null)
{
Property property = new Property(instance, descriptor);
if (descriptor.IsBrowsable)
{
//Add a property with Name: AutomaticlyExpandObjects
Type propertyType = descriptor.PropertyType;
if (automaticlyExpandObjects && propertyType.IsClass && !propertyType.IsArray && propertyType != typeof(string))
{
propertyCollection.Add(new ExpandableProperty(instance, descriptor, automaticlyExpandObjects, filter));
}
else if (descriptor.Converter.GetType() == typeof(ExpandableObjectConverter))
{
propertyCollection.Add(new ExpandableProperty(instance, descriptor, automaticlyExpandObjects, filter));
}
else
propertyCollection.Add(property);
}
}
else
{
instance = descriptor.GetValue(instance);
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(instance);
foreach (PropertyDescriptor propertyDescriptor in properties)
{
CollectProperties(instance, propertyDescriptor, propertyCollection, automaticlyExpandObjects, filter);
}
}
}
开发者ID:spolnik,项目名称:DocumentEditor,代码行数:31,代码来源:PropertyCollection.cs
示例15: Create
/// <summary>
/// Create a new option.
/// </summary>
/// <param name="opco">The three or four letter code for the operating company</param>
/// <param name="name">The human-readable name for this option</param>
/// <param name="slug">A unique slug for this option; optional, will be generated from the name if not provided</param>
/// <param name="external">An third-party external identifier for this option (optional)</param>
/// <param name="language">The two-letter ISO language for the option's name; defaults to the opco's language</param>
/// <param name="relatedTo">The category or taxonomy using this option (optional)</param>
/// <param name="relatedBy">The property by which this option is related to the relatedTo value</param>
/// <returns>The newly created Option</returns>
/// <exception cref="Terra.ServerException">
/// <list type="bullet">
/// <item>
/// <description>If any of the parameters submitted are invalid, returns a status of Not Acceptable.</description>
/// </item>
/// <item>
/// <description>If the slug already exists, returns a status of Conflict.</description>
/// </item>
/// <item>
/// <description>If the operating company, relatedTo, or relatedBy does not exist, returns a status of Not Found.</description>
/// </item>
/// </list>
/// </exception>
public Option Create(string opco, string name, string slug = null, string external = null, string language = null,
Node relatedTo = null, Property relatedBy = null)
{
var request = _client.Request("option", Method.POST).
AddParameter("opco", opco).
AddParameter("name", name).
AddParameter("slug", slug).
AddParameter("external", external).
AddParameter("lang", language);
if (relatedBy != null)
{
if (relatedTo is Taxonomy)
{
request.AddParameter("taxonomy", ((Taxonomy)relatedTo).Slug);
}
else if (relatedTo is Category)
{
request.AddParameter("category", ((Category)relatedTo).Slug);
}
request.AddParameter("property", relatedBy.Slug);
}
return request.MakeRequest<Option>();
}
开发者ID:brilliantarc,项目名称:Terra.cs,代码行数:50,代码来源:Options.cs
示例16: obtenerPropiedades
/// <summary>
/// Método encargado de obtener las propiedades necesarias para realizar
/// la conexión con el tipo de Servidor necesario.
/// </summary>
/// <param name="envio">Se configura para enviar si es TRUE, para recibir si es FALSE</param>
/// <param name="server">Servidor del cual se quiere obtener la configuración</param>
/// <returns></returns>
public Property obtenerPropiedades(bool envio, ServerDTO server)
{
Property propiedad = new Property();
try
{
IServerProperty propiedadObtenida;
switch (server.Name)
{
case "GMAIL":
propiedadObtenida = new Gmail();
if (envio) propiedad = propiedadObtenida.getPropiedadEnviar(server);
else propiedad = propiedadObtenida.getPropiedadRecibir(server);
break;
case "OUTLOOK":
///
break;
case "YAHOO":
///
break;
}
}
catch (Exception ex) { }
return propiedad;
}
开发者ID:ivanebel,项目名称:ClienteCorreo,代码行数:34,代码来源:ServerConfig.cs
示例17: CopyFrom_ExceptionTest
public void CopyFrom_ExceptionTest()
{
var target = new Property<string>("TEST", "Test string");
var replacement = new Property<int>("TEST", 100);
target.CopyFrom(replacement);
}
开发者ID:kingzog,项目名称:4vlib,代码行数:7,代码来源:PropertyTests.cs
示例18: GetValue
public object GetValue(Property originalProperty)
{
var overridableProperty = GetOverridableProperty(originalProperty);
var mergeElement = GetMergeElement(elementPath);
if (mergeElement != null)
{
var entry = mergeElement.OverriddenProperties.
Cast<EnvironmentOverriddenPropertyElement>().
Where(x => ConfigurationMergePropertyMatchesProperty(x, overridableProperty)).
FirstOrDefault();
if (entry != null)
{
return overridableProperty.DeltaConfigurationStorageConverter.ConvertTo(originalProperty, CultureInfo.InvariantCulture, entry.OverriddenValue, originalProperty.PropertyType);
}
}
if (lastMergeElements != null)
{
var entry = lastMergeElements.
Where(x => ConfigurationMergePropertyMatchesProperty(x, overridableProperty)).
FirstOrDefault();
if (entry != null)
{
return overridableProperty.DeltaConfigurationStorageConverter.ConvertTo(originalProperty, CultureInfo.InvariantCulture, entry.OverriddenValue, originalProperty.PropertyType);
}
}
return originalProperty.Value;
}
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:30,代码来源:EnvironmentOverriddenElementPayload.cs
示例19: GetCRMUserProperties
private List<Property> GetCRMUserProperties()
{
List<Property> ContainerProperties = new List<Property>();
Property userfqn = new Property
{
Name = "userfqn",
MetaData = new MetaData("UserFQN", "UserFQN"),
SoType = SourceCode.SmartObjects.Services.ServiceSDK.Types.SoType.Text,
Type = "string"
};
ContainerProperties.Add(userfqn);
Property userid = new Property
{
Name = "userid",
MetaData = new MetaData("User Id", "User Id"),
SoType = SourceCode.SmartObjects.Services.ServiceSDK.Types.SoType.Text,
Type = "string"
};
ContainerProperties.Add(userid);
ContainerProperties.AddRange(CRMFunctionsStandard.GetStandardReturnProperties());
return ContainerProperties;
}
开发者ID:jonnoking,项目名称:K2-Dynamics-CRM-Extensions,代码行数:26,代码来源:CRMUser.cs
示例20: AddProperty
public static void AddProperty(Property property)
{
using (var hdc = new HotelDataEntryDataContext())
{
hdc.Properties.InsertOnSubmit(new Property
{
PropertyCode = property.PropertyCode,
PropertyName = property.PropertyName,
CurrencyId = property.CurrencyId,
UpdateDateTime = DateTime.Now,
Status = property.Status
});
try
{
hdc.SubmitChanges();
}
catch (SqlException ex)
{
if (ex.Number == 2601 || ex.Number == 2627)
{
throw;
}
}
}
}
开发者ID:thanyaammyy,项目名称:data-entry,代码行数:26,代码来源:PropertyHelper.cs
注:本文中的System.Property类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论