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


C# Property类代码示例

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


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

示例1: GetData

        public void GetData(ref DBQueryUC dBQueryUC)
        {
            //Input Parameter
            List<Property> listProPerty_Input = new List<Property>();

            for (int i = 0; i < dataGridView2.Rows.Count - 1; i++)
            {
                Property property = new Property();
                property.PropertyName = dataGridView2.Rows[i].Cells[0].Value.ToString();
                listProPerty_Input.Add(property);
            }
            dBQueryUC.InputParameter = new InputParameter();
            dBQueryUC.InputParameter.Properties = listProPerty_Input;

            //Output Parameter
            List<Property> listProPerty_Output = new List<Property>();
            for (int i = 0; i < dataGridView3.Rows.Count - 1; i++)
            {
                Property property = new Property();
                property.PropertyName = dataGridView3.Rows[i].Cells[0].Value.ToString();
                listProPerty_Output.Add(property);
            }
            dBQueryUC.OutputParameter = new OutputParameter();
            dBQueryUC.OutputParameter.Properties = listProPerty_Output;

            dBQueryUC.SqlQuery = richTextBox1.Text;
        }
开发者ID:huutruongqnvn,项目名称:vnecoo01,代码行数:27,代码来源:ConfugurationQuery.cs

示例2: Board

        public Board()
        {
            propertysquares[0] = new Property { name = "go",
                price = 0,
                hotelprice = 0,
                colour = "nonproperty",
                canbesold = false,
                canhavehouses = false,
                houseprice = 0,
                ischance = false,
                iscommunityChest = false,
                hashotel = false,
                issold = false,
                numberofhouses = 0,
                rentprice = -200 };

            propertysquares[2] = new Property
            {
                name = "mayfair",
                price = 400,
                hotelprice = 250,
                colour = "Dark Blue",
                canbesold = true,
                canhavehouses = true,
                houseprice = 0,
                ischance = false,
                iscommunityChest = false,
                hashotel = false,
                issold = false,
                numberofhouses = 0,
                rentprice = 50
            };
        }
开发者ID:06needhamt,项目名称:Stuffimake,代码行数:33,代码来源:Board.cs

示例3: Arrange

        protected override void Arrange()
        {
            base.Arrange();

            authenticationMode = EmailTraceListener.Property("AuthenticationMode");
            authenticationMode.Value = EmailAuthenticationMode.UserNameAndPassword;
        }
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:7,代码来源:given_email_trace_listener.cs

示例4: getUser

    public int getUser(Property objUser)
    {
        SqlConnection sqlCon = new SqlConnection(conStr);
        SqlCommand sqlCmd = new SqlCommand("sp_verfiyEmail", sqlCon);
        sqlCmd.CommandType = CommandType.StoredProcedure;

        SqlParameter eMailID = sqlCmd.Parameters.Add("@EmailID", SqlDbType.VarChar, 50);
        eMailID.Value = objUser.EmailID;

        SqlParameter passWordRem = sqlCmd.Parameters.Add("@PwdRem", SqlDbType.VarChar, 50);
        passWordRem.Value = objUser.PwdRem;

        SqlParameter flag = sqlCmd.Parameters.Add("@Flag", SqlDbType.Int);
        flag.Direction = ParameterDirection.Output;
        flag.Value = 0;

        try
        {
            sqlCon.Open();
            sqlCmd.ExecuteNonQuery();
            if ((int)flag.Value == 1)
                eMailFlag = 1;
            else
                eMailFlag = 0;
        }
        catch (Exception ex)
        { }
        finally
        {
            sqlCon.Close();
        }

        return eMailFlag;
    }
开发者ID:aptivasoft,项目名称:Adio,代码行数:34,代码来源:CheckEmailDAL.cs

示例5: Export

        public void Export(Property property, XElement propertyTag, Dictionary<int, ObjectTypes> dependantNodes)
        {
            if (property.Value != null && !string.IsNullOrWhiteSpace(property.Value.ToString()))
            {
                var items = new DampModel(property.Value.ToString());
                var guidList = new List<Guid>();

                if (items.Any)
                {
                    foreach (var item in items)
                    {
                        var media = Services.MediaService.GetById(item.Id);
                        if (media != null)
                        {
                            guidList.Add(Services.MediaService.GetById(item.Id).Key);

                            if (!dependantNodes.ContainsKey(item.Id))
                            {
                                dependantNodes.Add(item.Id, ObjectTypes.Media);
                            }
                        }
                    }
                }

                propertyTag.Value = string.Join(",", guidList);
            }
        }
开发者ID:EnjoyDigital,项目名称:Conveyor,代码行数:27,代码来源:DampDataTypeConverter.cs

示例6: ClearanceException

 public ClearanceException(Property property, AccessLevel playerAccess, AccessLevel neededAccess, string accessType)
     : base(property, string.Format(
     "You must be at least {0} to {1} this property.",
     Mobile.GetAccessLevelName(neededAccess),
     accessType))
 {
 }
开发者ID:FreeReign,项目名称:forkuo,代码行数:7,代码来源:Properties.cs

示例7: AddProperty

 public void AddProperty(Property property)
 {
     if (Properties.ContainsKey(property.Name))
         Properties[property.Name] = property;
     else
         Properties.Add(property.Name, property);
 }
开发者ID:SkightTeam,项目名称:eLiteWeb,代码行数:7,代码来源:BuildProject.cs

示例8: PostfixOptionsViewModel

        public PostfixOptionsViewModel([NotNull] Lifetime lifetime,
                                   [NotNull] OptionsSettingsSmartContext settings,
                                   [NotNull] PostfixTemplatesManager templatesManager)
        {
            mySettingsStore = settings;
              myTemplatesManager = templatesManager;
              Templates = new ObservableCollection<PostfixTemplateViewModel>();

              ShowPostfixTemplates = new Property<bool>(lifetime, "ShowPostfixTemplates");
              ShowStaticMembers = new Property<bool>(lifetime, "ShowStaticMembers");
              ShowEnumHelpers = new Property<bool>(lifetime, "ShowEnumHelpers");
              ShowLengthCountItems = new Property<bool>(lifetime, "ShowLengthCountItems");
              UseBracesForStatements = new Property<bool>(lifetime, "UseBracesForStatements");
              InvokeParameterInfo = new Property<bool>(lifetime, "InvokeParameterInfo");
              SearchVarOccurrences = new Property<bool>(lifetime, "SearchVarOccurrences");

              Reset = new DelegateCommand(ResetExecute);

              settings.SetBinding(lifetime, PostfixSettingsAccessor.ShowPostfixItems, ShowPostfixTemplates);
              settings.SetBinding(lifetime, PostfixSettingsAccessor.ShowStaticMethods, ShowStaticMembers);
              settings.SetBinding(lifetime, PostfixSettingsAccessor.ShowEnumHelpers, ShowEnumHelpers);
              settings.SetBinding(lifetime, PostfixSettingsAccessor.BracesForStatements, UseBracesForStatements);
              settings.SetBinding(lifetime, PostfixSettingsAccessor.InvokeParameterInfo, InvokeParameterInfo);
              settings.SetBinding(lifetime, PostfixSettingsAccessor.ShowLengthCountItems, ShowLengthCountItems);
              settings.SetBinding(lifetime, PostfixSettingsAccessor.SearchVarOccurrences, SearchVarOccurrences);

              FillTemplates();
        }
开发者ID:Nangal,项目名称:resharper-postfix,代码行数:28,代码来源:PostfixOptionsViewModel.cs

示例9: AddPropertyToGameObject

 public void AddPropertyToGameObject()
 {
     GameObject newGameObject = new GameObject("new game object");
     Property newProperty = new Property(PropertyType.String, "new property", "a new value");
     Assert.IsTrue(newGameObject.AddProperty(newProperty));
     Assert.IsTrue(newGameObject.DoesPropertyExist(newProperty.Name));
 }
开发者ID:kraidleyaran,项目名称:GameObjectLib,代码行数:7,代码来源:GameObjectTest.cs

示例10: GetPropertyFromGameObject

 public void GetPropertyFromGameObject()
 {
     GameObject newGameObject = new GameObject("new game object");
     Property newProperty = new Property(PropertyType.String, "new property", "a new value");
     newGameObject.AddProperty(newProperty);
     Assert.IsTrue(newProperty.Value == newGameObject.GetProperty(newProperty.Name).Value);
 }
开发者ID:kraidleyaran,项目名称:GameObjectLib,代码行数:7,代码来源:GameObjectTest.cs

示例11: GenerateFeature

        /// <summary>Generates a feature.</summary>
        /// <exception cref="InvalidOperationException">Thrown when the requested operation is invalid.</exception>
        /// <param name="type">The type.</param>
        /// <param name="name">The name.</param>
        /// <returns>The feature.</returns>
        public static Property GenerateFeature(Type type, string name)
        {
            Property p;
            if (type == typeof(string))
                p = new StringProperty();
            else if (type == typeof(DateTime))
                p = new DateTimeProperty();
            else if (type.GetInterfaces().Contains(typeof(IEnumerable)))
                throw new InvalidOperationException(
                    string.Format("Property {0} needs to be labeled as an EnumerableFeature", name));
            else
                p = new Property();


            p.Discrete = type.BaseType == typeof(Enum) ||
                         type == typeof(bool) ||
                         type == typeof(string) ||
                         type == typeof(char) ||
                         type == typeof(DateTime);

            p.Type = type;
            p.Name = name;

            return p;
        }
开发者ID:m-abubakar,项目名称:numl,代码行数:30,代码来源:TypeHelpers.cs

示例12: Delete

 public async static Task<EntityResponse<Property>> Delete(Property propertyType)
 {
     using (var db = Database.Connect())
     {
         return await db.Entities.DeleteAsync<Property>(propertyType);
     }
 }
开发者ID:joelalejandro,项目名称:Adagi,代码行数:7,代码来源:Properties.cs

示例13: ImplementProperty_GenerateLineBreaks

        public void ImplementProperty_GenerateLineBreaks()
        {
            WithSourceFiles(Files.ChildClass, Files.Mixin);

            var typeSymbol = Substitute.For<ITypeSymbol>();
            var mixin = Substitute.For<MixinReference>();
            mixin.Name.Returns("_mixin");

            var property = new Property("Name", typeSymbol, true, true);

            var implementPropertyStrategy = new ImplementPropertyForwarding(
                mixin, Semantic, new Settings(avoidLineBreaksInProperties:false));

            var memberDeclaration = implementPropertyStrategy.ImplementMember(property, 0);

            // Assert:
            // let the formatting engine format the output source and ensure
            // that the text has only 6 lines:
            // <empty line>
            // public Name
            // { 
            //    get
            //    {
            //        ...
            //    }
            //    <empty line>
            //    ...
            // }

            var workspace = new AdhocWorkspace();
            memberDeclaration = (MemberDeclarationSyntax)Formatter.Format(memberDeclaration, workspace);
            var sourceText = SourceText.From(memberDeclaration.ToFullString());
            Assert.AreEqual(13, sourceText.Lines.Count);
        }
开发者ID:pgenfer,项目名称:mixinSharp,代码行数:34,代码来源:ImplementPropertyForwardingTest.cs

示例14: Biggylist_Updates_Single_Item_In_Json_Store

    public void Biggylist_Updates_Single_Item_In_Json_Store() {
      var propertyList = new BiggyList<Property>(_propertyStore);
      int initialCount = propertyList.Count;

      var newProperty = new Property { Id = 1, Name = "John's Luxury Apartments", Address = "2639 I St NW, Washington, D.C. 20037" };
      propertyList.Add(newProperty);

      int addedItemId = newProperty.Id;

      // Just to be sure, reload from backing store and check what was added:
      propertyList = new BiggyList<Property>(_propertyStore);
      var addedProperty = propertyList.FirstOrDefault(p => p.Id == addedItemId);
      bool isAddedProperly = addedProperty.Name.Contains("John's Luxury");

      // Now Update:
      string newName = "John's Low-Rent Apartments";
      addedProperty.Name = newName;
      propertyList.Update(addedProperty);

      // Go fetch again:
      propertyList = new BiggyList<Property>(_propertyStore);
      addedProperty = propertyList.FirstOrDefault(p => p.Id == addedItemId);
      bool isUpdatedProperly = addedProperty.Name == newName;

      Assert.IsTrue(isAddedProperly && isUpdatedProperly);
    }
开发者ID:ToughBill,项目名称:biggy,代码行数:26,代码来源:BiggyListWithJsonStore.cs

示例15: ContentDocument

        public ContentDocument(IDataTypeService service, IContent content)
            : this()
        {
            Id = content.Id;
            ContentTypeId = content.ContentTypeId;
            ContentType = content.ContentType.Name;
            Name = content.Name;
            ParentId = content.ParentId;
            Level = content.Level;
            Path = content.Path;

            foreach (var propInfo in content.PropertyTypes.OrderBy(n => n.SortOrder))
            {

                var p = new Property
                {
                    Name = propInfo.Name,
                    Alias = propInfo.Alias,
                    Description = propInfo.Description,
                    Required = propInfo.Mandatory,
                    Validation = propInfo.ValidationRegExp,
                    DataType = service.GetDataTypeDefinitionById(propInfo.DataTypeDefinitionId).Name,
                    Value = (content.Properties.SingleOrDefault(n => n.Alias == propInfo.Alias).Value ?? string.Empty).ToString()
                };
                Properties.Add(p);
            }
        }
开发者ID:MindfireTechnology,项目名称:UmbracoDynamicDoc,代码行数:27,代码来源:ContentDocument.cs


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