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


C# Field类代码示例

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


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

示例1: FieldWrapper

        public FieldWrapper(Field field)
        {
            Sitecore.Diagnostics.Assert.ArgumentNotNull(field, "field");

            _modified = false;
            _field = field;
        }
开发者ID:herskinduk,项目名称:fortis,代码行数:7,代码来源:FieldWrapper.cs

示例2: CustomizeCompomentForKeywordField

        private void CustomizeCompomentForKeywordField(Component component)
        {
            component.Schema.RootElementName = "hasKeyword";
            Field headingField = new Field() { Name = "heading", Values = new List<string> { "some heading" } };

            FieldSet metadataFields = new FieldSet();
            metadataFields.Add(headingField.Name, headingField);


            Field keywordField = new Field()
            {
                Name = "keyword",
                KeywordValues = new List<Keyword>() 
                {
                    new Keyword()
                    {
                        MetadataFields = metadataFields,
                        Id = Randomizer.AnyUri(1024),
                        Title = Randomizer.AnyString(33),
                        Description = Randomizer.AnyString(33)
                    }                        
                }
            };
            component.Fields.Add(keywordField.Name, keywordField);
        }
开发者ID:contacttomukesh,项目名称:DD4T.Core,代码行数:25,代码来源:TridionComponentPresentationProvider.cs

示例3: CustomFieldTypeValidation

        protected override void CustomFieldTypeValidation(AssertPair<FieldDefinition, Field> assert, Field spObject, FieldDefinition definition)
        {
            var typedObject = spObject.Context.CastTo<FieldLookup>(spObject);
            var typedDefinition = definition.WithAssertAndCast<LookupFieldDefinition>("model", value => value.RequireNotNull());

            // https://github.com/SubPointSolutions/spmeta2/issues/310
            // AllowMultipleValues - TRUE - LookupMulti
            // AllowMultipleValues - FALSE - Lookup
            assert.ShouldBeEqual((p, s, d) =>
            {
                var srcProp = s.GetExpressionValue(m => m.FieldType);
                var dstProp = d.GetExpressionValue(m => d.TypeAsString);

                var isValid = typedDefinition.AllowMultipleValues
                    ? typedObject.TypeAsString == "LookupMulti"
                    : typedObject.TypeAsString == "Lookup";

                return new PropertyValidationResult
                {
                    Tag = p.Tag,
                    Src = srcProp,
                    Dst = dstProp,
                    IsValid = isValid
                };
            });
        }
开发者ID:karayakar,项目名称:spmeta2,代码行数:26,代码来源:LookupFieldDefinitionValidator.cs

示例4: GetFallbackItem

 /// <summary>
 /// Gets the nearest set ancestor that has the field with a value
 /// </summary>
 /// <param name="field">The field.</param>
 /// <returns></returns>
 private Item GetFallbackItem(Field field)
 {
     using (new SecurityDisabler())
     {
         return field.Item.Axes.GetAncestors().Where(ancestor => DoesItemHaveFieldWithValue(ancestor, field.ID, true)).LastOrDefault();
     }
 }
开发者ID:hhog-tkamin,项目名称:sitecore-field-fallback,代码行数:12,代码来源:AncestorFallbackProcessor.cs

示例5: VisitFieldDecl

        public override bool VisitFieldDecl(Field field)
        {
            if (!VisitDeclaration(field))
                return false;

            var type = field.Type;

            Declaration decl;
            type.TryGetDeclaration(out decl);
            string msg = "internal";
            if (decl == null || (decl.GenerationKind != GenerationKind.Internal && !HasInvalidType(type, out msg)))
                return false;

            field.GenerationKind = GenerationKind.Internal;

            var @class = (Class)field.Namespace;

            var cppTypePrinter = new CppTypePrinter();
            var typeName = type.Visit(cppTypePrinter);

            Log.Debug("Field '{0}::{1}' was ignored due to {2} type '{3}'",
                @class.Name, field.Name, msg, typeName);

            return true;
        }
开发者ID:daxiazh,项目名称:CppSharp,代码行数:25,代码来源:CheckIgnoredDecls.cs

示例6: Draw

		private void Draw(Field field, FileInfo file)
		{
			var xMax = 10;
			var yMax = field.RowCount;

			var image = new Bitmap(xMax * BlockSize, yMax * BlockSize);

			for (var y = 0; y < yMax; y++)
			{
				var row = field[y];

				for (var x = 0; x < xMax; x++)
				{
					if ((Row.Flag[x] & row) != 0)
					{
						DrawPixel(image, x, y, Color.Red);
					}
					else
					{
						DrawPixel(image, x, y, Color.White);
					}
				}
			}
			image.Save(file.FullName, ImageFormat.Png);
		}
开发者ID:Corniel,项目名称:AIGames.BlockBattle.Kubisme,代码行数:25,代码来源:FieldVisualizer.cs

示例7: Read

        public Fields Read(AbstractConnection connection, string process, string prefix, string name, string schema, bool isMaster = false) {
            var fields = new Fields();

            using (var cn = connection.GetConnection()) {
                cn.Open();
                var sql = PrepareSql();
                connection.Logger.EntityDebug(name, sql);

                var results = cn.Query(sql, new { name, schema });

                foreach (var result in results) {
                    var columnName = result.COLUMN_NAME;
                    var type = GetSystemType(result.DATA_TYPE);
                    var length = result.CHARACTER_MAXIMUM_LENGTH == "0" || result.CHARACTER_MAXIMUM_LENGTH == "-1" ? "64" : result.CHARACTER_MAXIMUM_LENGTH;
                    var fieldType = (bool)result.IS_PRIMARY_KEY ? (isMaster ? FieldType.MasterKey : FieldType.PrimaryKey) : FieldType.NonKey;
                    var field = new Field(type, length, fieldType, true, string.Empty) {
                        Name = columnName,
                        Entity = name,
                        Process = process,
                        Index = Convert.ToInt16(result.ORDINAL_POSITION - 1),
                        Schema = schema,
                        Input = true,
                        Precision = result.NUMERIC_PRECISION,
                        Scale = result.NUMERIC_SCALE,
                        Alias = prefix + columnName
                    };
                    fields.Add(field);
                }
            }

            return fields;
        }
开发者ID:modulexcite,项目名称:Transformalize,代码行数:32,代码来源:SqlServerEntityAutoFieldReader.cs

示例8: GetContentByUrl

        /// <summary>
        /// Gets the raw string (xml) from the broker db by URL
        /// </summary>
        /// <param name="Url">URL of the page</param>
        /// <returns>String with page xml or empty string if no page was found</returns>
        public string GetContentByUrl(string Url)
        {
            Page page = new Page();
            page.Title = Randomizer.AnyString(15);
            page.Id = Randomizer.AnyUri(64);
            page.Filename = Randomizer.AnySafeString(8) + ".html";

            PageTemplate pt = new PageTemplate();
            pt.Title = Randomizer.AnyString(20);
            Field ptfieldView = new Field();
            ptfieldView.Name = "view";
            ptfieldView.Values.Add("Standard");
            pt.MetadataFields = new FieldSet();
            pt.MetadataFields.Add(ptfieldView.Name, ptfieldView);

            page.PageTemplate = pt;

            page.ComponentPresentations = new List<ComponentPresentation>();

            string cpString = ComponentPresentationProvider.GetContent("");
            page.ComponentPresentations.Add(SerializerService.Deserialize<ComponentPresentation>(cpString));

            FieldSet metadataFields = new FieldSet();
            page.MetadataFields = metadataFields;

            return SerializerService.Serialize<Page>(page);
        }
开发者ID:contacttomukesh,项目名称:DD4T.Core,代码行数:32,代码来源:TridionPageProvider.cs

示例9: GetField

        private object GetField(Field field)
        {
            if (_fields.ContainsKey(field))
                return _fields[field];

            return null;
        }
开发者ID:codesoda,项目名称:FluentFlot,代码行数:7,代码来源:LineOptions.cs

示例10: BadBlockPlacementTest

 public void BadBlockPlacementTest( int x, int y )
 {
     Field field = new Field( 2, 10 );
     IBlock block = new Block();
     block.Grid [ 2 ] [ 2 ] = Color.Tomato;
     field.SetBlock( block, new Point( x, y ) );
 }
开发者ID:rutgerk1,项目名称:TddTetris,代码行数:7,代码来源:FieldTest.cs

示例11: GetFilterView

 public PartialViewResult GetFilterView(Field targetField, string filterString)
 {
     FilterBag fb = FilterBag.createFromURLQuery(Request.QueryString.ToString());
     ViewBag.FilterString = fb.JsonEncode();
     ViewBag.inputID = Guid.NewGuid();
     return PartialView("_FilterEditPartial", targetField);
 }
开发者ID:cray1,项目名称:jobsalt,代码行数:7,代码来源:FilterUtilityController.cs

示例12: BadBigBlockPlacementTest

 public void BadBigBlockPlacementTest( int x, int y )
 {
     Field field = new Field( 5, 10 );
     IBlock block = new Block();
     createBigBlock( block );
     field.SetBlock( block, new Point( x, y ) );
 }
开发者ID:rutgerk1,项目名称:TddTetris,代码行数:7,代码来源:FieldTest.cs

示例13: Post

 public HttpResponseMessage Post(HttpRequestMessage request, CreateFieldCommand command)
 {
     var repository = new FieldRepository();
     var field = new Field(command.Name, command.Description, command.DataType, command.FieldType);
     repository.AddField(field);
     return request.CreateResponse(HttpStatusCode.Created, new FieldViewModel(field));
 }
开发者ID:hemantksingh,项目名称:Solicitors.FieldApi,代码行数:7,代码来源:FieldsController.cs

示例14: Batch

 public Batch(int id, double amountOfFruit, string team, double sellAbleAmount, Field field)
 {
     Id = id;
     AmountOfFruit = amountOfFruit;
     SellAbleAmount = sellAbleAmount;
     Field = field;
 }
开发者ID:DMOE15C,项目名称:Orchard-Project-Global-,代码行数:7,代码来源:Batch.cs

示例15: TestLevel3Description

 public void TestLevel3Description()
 {
     var field = new Field(3, 4, 1, 1, 'S');
     Assert.That(field.GetSequence(), Is.EqualTo(new[] {1, 5, 9, 10, 6, 2, 3, 7, 11, 12, 8, 4}));
     field = new Field(5, 2, 5, 2, 'N');
     Assert.That(field.GetSequence(), Is.EqualTo(new[] {10, 8, 6, 4, 2, 1, 3, 5, 7, 9}));
 }
开发者ID:preuers,项目名称:sp-codeKata,代码行数:7,代码来源:LevelTests.cs


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