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


C# Field.Update方法代码示例

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


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

示例1: CreateWingtipSiteColumns

        static void CreateWingtipSiteColumns()
        {
            Console.WriteLine();

              fieldProductCode = CreateSiteColumn("ProductCode", "Product Code", "Text");
              fieldProductCode.EnforceUniqueValues = true;
              fieldProductCode.Indexed = true;
              fieldProductCode.Required = true;
              fieldProductCode.Update();
              clientContext.ExecuteQuery();
              clientContext.Load(fieldProductCode);
              clientContext.ExecuteQuery();

              fieldProductDescription = clientContext.CastTo<FieldMultiLineText>(CreateSiteColumn("ProductDescription", "Product Description", "Note"));
              fieldProductDescription.NumberOfLines = 4;
              fieldProductDescription.RichText = false;
              fieldProductDescription.Update();
              clientContext.ExecuteQuery();

              fieldProductListPrice = clientContext.CastTo<FieldCurrency>(CreateSiteColumn("ProductListPrice", "Product List Price", "Currency"));
              fieldProductListPrice.MinimumValue = 0;
              fieldProductListPrice.Update();
              clientContext.ExecuteQuery();

              fieldProductColor = clientContext.CastTo<FieldMultiChoice>(CreateSiteColumn("ProductColor", "Product Color", "MultiChoice"));
              string[] choicesProductColor = { "White", "Black", "Grey", "Blue", "Red", "Green", "Yellow" };
              fieldProductColor.Choices = choicesProductColor;
              fieldProductColor.Update();
              clientContext.ExecuteQuery();

              fieldMinimumAge = clientContext.CastTo<FieldNumber>(CreateSiteColumn("MinimumAge", "Minimum Age", "Number"));
              fieldMinimumAge.MinimumValue = 1;
              fieldMinimumAge.MaximumValue = 100;
              fieldMinimumAge.Update();
              clientContext.ExecuteQuery();

              fieldMaximumAge = clientContext.CastTo<FieldNumber>(CreateSiteColumn("MaximumAge", "Maximum Age", "Number"));
              fieldMaximumAge.MinimumValue = 1;
              fieldMaximumAge.MaximumValue = 100;
              fieldMaximumAge.Update();
              clientContext.ExecuteQuery();
        }
开发者ID:CriticalPathTraining,项目名称:BBS365,代码行数:42,代码来源:Program.cs

示例2: UpdateExistingField

 /// <summary>
 /// We don't want to update all properties of an existing field. For now, only the Hidden property is being updated.
 /// </summary>
 /// <param name="configField"></param>
 /// <param name="existingField"></param>
 private void UpdateExistingField(ShField configField, Field existingField)
 {
     var fieldUpdated = false;
     if (configField.Hidden != existingField.Hidden)
     {
         existingField.Hidden = configField.Hidden;
         fieldUpdated = true;
     }
     if (configField.DisplayName != existingField.Title)
     {
         existingField.Title = configField.DisplayName;
         fieldUpdated = true;
     }
     if (configField.Group != existingField.Group)
     {
         existingField.Group = configField.Group;
         fieldUpdated = true;
     }
     if (fieldUpdated)
     {
         existingField.Update();
         ClientContext.ExecuteQuery();
     }
 }
开发者ID:ceg692001,项目名称:sherpa,代码行数:29,代码来源:FieldManager.cs

示例3: CreateWingtipSiteColumns

        static void CreateWingtipSiteColumns()
        {
            Console.WriteLine();

              fieldProductCode = CreateSiteColumn("ProductCode", "Product Code", "Text");
              fieldProductCode.EnforceUniqueValues = true;
              fieldProductCode.Indexed = true;
              fieldProductCode.Required = true;
              fieldProductCode.Update();
              clientContext.ExecuteQuery();
              clientContext.Load(fieldProductCode);
              clientContext.ExecuteQuery();

              fieldProductDescription = clientContext.CastTo<FieldMultiLineText>(CreateSiteColumn("ProductDescription", "Product Description", "Note"));
              fieldProductDescription.NumberOfLines = 4;
              fieldProductDescription.RichText = false;
              fieldProductDescription.Update();
              clientContext.ExecuteQuery();

              fieldProductListPrice = clientContext.CastTo<FieldCurrency>(CreateSiteColumn("ProductListPrice", "List Price", "Currency"));
              fieldProductListPrice.MinimumValue = 0;
              fieldProductListPrice.Update();
              clientContext.ExecuteQuery();

              fieldProductCategory = clientContext.CastTo<TaxonomyField>(CreateSiteColumn("ProductCategory", "Product Category", "TaxonomyFieldType"));
              fieldProductCategory.SspId = localTermStoreID;
              fieldProductCategory.TermSetId = termSetId;
              fieldProductCategory.AllowMultipleValues = false;
              fieldProductCategory.Update();
              clientContext.ExecuteQuery();

              fieldProductColor = clientContext.CastTo<FieldMultiChoice>(CreateSiteColumn("ProductColor", "Product Color", "MultiChoice"));
              string[] choicesProductColor = { "White", "Black", "Grey", "Blue", "Red", "Green", "Yellow" };
              fieldProductColor.Choices = choicesProductColor;
              fieldProductColor.Update();
              clientContext.ExecuteQuery();

              fieldMinimumAge = clientContext.CastTo<FieldNumber>(CreateSiteColumn("MinimumAge", "Minimum Age", "Number"));
              fieldMinimumAge.MinimumValue = 1;
              fieldMinimumAge.MaximumValue = 100;
              fieldMinimumAge.Update();
              clientContext.ExecuteQuery();

              fieldMaximumAge = clientContext.CastTo<FieldNumber>(CreateSiteColumn("MaximumAge", "Maximum Age", "Number"));
              fieldMaximumAge.MinimumValue = 1;
              fieldMaximumAge.MaximumValue = 100;
              fieldMaximumAge.Update();
              clientContext.ExecuteQuery();

              fieldProductImageUrl = clientContext.CastTo<FieldUrl>(CreateSiteColumn("ProductImageUrl", "Product Image Url", "URL"));
              fieldProductImageUrl.DisplayFormat = UrlFieldFormatType.Image;
              fieldProductImageUrl.Update();
              clientContext.ExecuteQuery();
        }
开发者ID:CriticalPathTraining,项目名称:GOA365,代码行数:54,代码来源:WingtipContentGenerator.cs

示例4: ProcessFieldProperties

        protected override void ProcessFieldProperties(Field field, FieldDefinition fieldModel)
        {
            var site = HostSite;
            var context = site.Context;

            // let base setting be setup
            base.ProcessFieldProperties(field, fieldModel);

            var typedField = field.Context.CastTo<FieldLookup>(field);
            var typedFieldModel = fieldModel.WithAssertAndCast<LookupFieldDefinition>("model", value => value.RequireNotNull());

            if (!typedField.IsPropertyAvailable("LookupList"))
            {
                if (field.Context.HasPendingRequest)
                {
                    field.Update();
                    field.Context.ExecuteQueryWithTrace();
                }

                typedField.Context.Load(typedField);
                typedField.Context.ExecuteQueryWithTrace();
            }

            typedField.AllowMultipleValues = typedFieldModel.AllowMultipleValues;

            if (typedFieldModel.AllowMultipleValues)
                typedField.TypeAsString = "LookupMulti";
            else
                typedField.TypeAsString = "Lookup";

            if (typedFieldModel.LookupWebId.HasGuidValue())
            {
                typedField.LookupWebId = typedFieldModel.LookupWebId.Value;
            }
            else if (!string.IsNullOrEmpty(typedFieldModel.LookupWebUrl))
            {
                var targetWeb = GetTargetWeb(site, typedFieldModel);

                typedField.LookupWebId = targetWeb.Id;
            }

            if (!string.IsNullOrEmpty(typedFieldModel.RelationshipDeleteBehavior))
            {
                var value = (RelationshipDeleteBehaviorType)Enum.Parse(typeof(RelationshipDeleteBehaviorType), typedFieldModel.RelationshipDeleteBehavior);
                typedField.RelationshipDeleteBehavior = value;
            }

            if (string.IsNullOrEmpty(typedField.LookupList))
            {
                if (!string.IsNullOrEmpty(typedFieldModel.LookupList))
                {
                    typedField.LookupList = typedFieldModel.LookupList;
                }
                else if (!string.IsNullOrEmpty(typedFieldModel.LookupListUrl))
                {
                    var targetWeb = GetTargetWeb(site, typedFieldModel);

                    if (!targetWeb.IsPropertyAvailable("ServerRelativeUrl"))
                    {
                        context.Load(targetWeb, w => w.ServerRelativeUrl);
                        context.ExecuteQueryWithTrace();
                    }

                    var list = targetWeb.QueryAndGetListByUrl(UrlUtility.CombineUrl(targetWeb.ServerRelativeUrl, typedFieldModel.LookupListUrl));
                    typedField.LookupList = list.Id.ToString();
                }
                else if (!string.IsNullOrEmpty(typedFieldModel.LookupListTitle))
                {
                    var targetWeb = GetTargetWeb(site, typedFieldModel);
                    var list = targetWeb.Lists.GetByTitle(typedFieldModel.LookupListTitle);

                    context.Load(list);
                    context.ExecuteQueryWithTrace();

                    typedField.LookupList = list.Id.ToString();
                }
            }

            if (!string.IsNullOrEmpty(typedFieldModel.LookupField))
            {
                typedField.LookupField = typedFieldModel.LookupField;
            }
        }
开发者ID:karayakar,项目名称:spmeta2,代码行数:83,代码来源:LookupFieldModelHandler.cs

示例5: CreateWingtipSiteColumns

        static void CreateWingtipSiteColumns()
        {
            Console.WriteLine();
              Console.WriteLine("Creating site columns");

              fieldProductCode = CreateSiteColumn("ProductCode", "Product Code", "Text");
              fieldProductCode.EnforceUniqueValues = true;
              fieldProductCode.Indexed = true;
              fieldProductCode.Required = true;
              fieldProductCode.Update();
              clientContext.ExecuteQuery();
              clientContext.Load(fieldProductCode);
              clientContext.ExecuteQuery();

              fieldProductListPrice = clientContext.CastTo<FieldCurrency>(CreateSiteColumn("ProductListPrice", "List Price", "Currency"));

              fieldProductCategory = clientContext.CastTo<FieldChoice>(CreateSiteColumn("ProductCategory", "Product Category", "Choice"));
              string[] choicesProductCategory = { "Action Figures", "Arts and Crafts", "Vehicles and Remote Control" };
              fieldProductCategory.Choices = choicesProductCategory;
              fieldProductCategory.Update();
              clientContext.ExecuteQuery();

              fieldProductColor = clientContext.CastTo<FieldChoice>(CreateSiteColumn("ProductColor", "Product Color", "Choice"));
              string[] choicesProductColor = { "White", "Black", "Grey", "Blue", "Red", "Green", "Yellow" };
              fieldProductColor.Choices = choicesProductColor;
              fieldProductColor.Update();
              clientContext.ExecuteQuery();

              fieldMinimumAge = clientContext.CastTo<FieldNumber>(CreateSiteColumn("MinimumAge", "Minimum Age", "Number"));

              fieldMaximumAge = clientContext.CastTo<FieldNumber>(CreateSiteColumn("MaximumAge", "Maximum Age", "Number"));
        }
开发者ID:CriticalPathTraining,项目名称:BBS2013,代码行数:32,代码来源:Program.cs

示例6: updateField

 private static void updateField(Field field, Microsoft.Office.Interop.Word.Application word, String filename)
 {
     switch (field.Type)
     {
         case WdFieldType.wdFieldAuthor:
         case WdFieldType.wdFieldAutoText:
         case WdFieldType.wdFieldComments:
         case WdFieldType.wdFieldCreateDate:
         case WdFieldType.wdFieldDate:
         case WdFieldType.wdFieldDocProperty:
         case WdFieldType.wdFieldDocVariable:
         case WdFieldType.wdFieldEditTime:
         case WdFieldType.wdFieldFileSize:
         case WdFieldType.wdFieldFootnoteRef:
         case WdFieldType.wdFieldGreetingLine:
         case WdFieldType.wdFieldIndex:
         case WdFieldType.wdFieldInfo:
         case WdFieldType.wdFieldKeyWord:
         case WdFieldType.wdFieldLastSavedBy:
         case WdFieldType.wdFieldNoteRef:
         case WdFieldType.wdFieldNumChars:
         case WdFieldType.wdFieldNumPages:
         case WdFieldType.wdFieldNumWords:
         case WdFieldType.wdFieldPage:
         case WdFieldType.wdFieldPageRef:
         case WdFieldType.wdFieldPrintDate:
         case WdFieldType.wdFieldRef:
         case WdFieldType.wdFieldRevisionNum:
         case WdFieldType.wdFieldSaveDate:
         case WdFieldType.wdFieldSection:
         case WdFieldType.wdFieldSectionPages:
         case WdFieldType.wdFieldSubject:
         case WdFieldType.wdFieldTime:
         case WdFieldType.wdFieldTitle:
         case WdFieldType.wdFieldTOA:
         case WdFieldType.wdFieldTOAEntry:
         case WdFieldType.wdFieldTOC:
         case WdFieldType.wdFieldTOCEntry:
         case WdFieldType.wdFieldUserAddress:
         case WdFieldType.wdFieldUserInitials:
         case WdFieldType.wdFieldUserName:
             field.Update();
             break;
         case WdFieldType.wdFieldFileName:
             // Handle the filename as a special situation, since it doesn't seem to
             // update correctly (issue #13)
             field.Select();
             field.Delete();
             Selection selection = word.Selection;
             selection.TypeText(Path.GetFileName(filename));
             Converter.releaseCOMObject(selection);
             break;
     }
 }
开发者ID:sensusaps,项目名称:RoboBraille.Web.API,代码行数:54,代码来源:WordConverter.cs

示例7: ProcessFieldProperties

        protected override void ProcessFieldProperties(Field field, FieldDefinition fieldModel)
        {
            // let base setting be setup
            base.ProcessFieldProperties(field, fieldModel);

            var typedField = field.Context.CastTo<FieldLookup>(field);
            var typedFieldModel = fieldModel.WithAssertAndCast<LookupFieldDefinition>("model", value => value.RequireNotNull());

            if (!typedField.IsPropertyAvailable("LookupList"))
            {
                if (field.Context.HasPendingRequest)
                {
                    field.Update();
                    field.Context.ExecuteQuery();
                }

                typedField.Context.Load(typedField);
                typedField.Context.ExecuteQuery();
            }

            typedField.AllowMultipleValues = typedFieldModel.AllowMultipleValues;

            if (typedFieldModel.AllowMultipleValues)
                typedField.TypeAsString = "LookupMulti";
            else
                typedField.TypeAsString = "Lookup";

            if (typedFieldModel.LookupWebId.HasValue)
                typedField.LookupWebId = typedFieldModel.LookupWebId.Value;

            if (string.IsNullOrEmpty(typedField.LookupList))
            {
                if (!string.IsNullOrEmpty(typedFieldModel.LookupList))
                {
                    typedField.LookupList = typedFieldModel.LookupList;
                }
                else if (!string.IsNullOrEmpty(typedFieldModel.LookupListUrl))
                {
                    var site = HostSite;
                    var context = site.Context;

                    var web = typedFieldModel.LookupWebId.HasValue
                        ? site.OpenWebById(typedFieldModel.LookupWebId.Value)
                        : site.RootWeb;

                    if (!web.IsPropertyAvailable("ServerRelativeUrl"))
                    {
                        context.Load(web, w => w.ServerRelativeUrl);
                        context.ExecuteQuery();
                    }

                    var list = web.QueryAndGetListByUrl(UrlUtility.CombineUrl(web.ServerRelativeUrl, typedFieldModel.LookupListUrl));

                    typedField.LookupList = list.Id.ToString();
                }
                else if (!string.IsNullOrEmpty(typedFieldModel.LookupListTitle))
                {
                    var site = HostSite;
                    var context = site.Context;

                    var web = typedFieldModel.LookupWebId.HasValue
                        ? site.OpenWebById(typedFieldModel.LookupWebId.Value)
                        : site.RootWeb;

                    var list = web.Lists.GetByTitle(typedFieldModel.LookupListTitle);

                    context.Load(list);
                    context.ExecuteQuery();

                    typedField.LookupList = list.Id.ToString();
                }
            }

            if (!string.IsNullOrEmpty(typedFieldModel.LookupField))
            {
                typedField.LookupField = typedFieldModel.LookupField;
            }
                
        }
开发者ID:Uolifry,项目名称:spmeta2,代码行数:79,代码来源:LookupFieldModelHandler.cs

示例8: Game

        static void Game()
        {
            try
            {
                Console.Clear();
                is_pause = false;

                Field f = new Field(x, y);
                f.ball.Lives = lives;
                f.ball.GetSym = ball_custom;
                f.wall[0].GetSym = wall_custom;
                f.wall[1].GetSym = wall_custom;
                f.wall[2].GetSym = wall_custom;
               // int choise = 0;
                bool is_up = false;
                Menu menu = new Menu();
                Console.WriteLine("Press any key!!!");
                ConsoleKeyInfo cki = new ConsoleKeyInfo();
                cki = Console.ReadKey(true);
                do
                {
                    Console.SetCursorPosition(0, 0);

                    if (Console.KeyAvailable == true)
                    {

                        cki = Console.ReadKey(true);
                        if (cki.Key == ConsoleKey.LeftArrow)
                        {
                            f.ball.MoveLeft();
                        }
                        else
                            if (cki.Key == ConsoleKey.RightArrow)
                            {
                                f.ball.MoveRight();
                            }
                            else

                                if (cki.Key == ConsoleKey.M)
                                {

                                    is_pause = true;
                                    Menu();

                                }

                        if (is_exit == true)
                        {
                            break;
                        }
                    }
                    // foreach(Wall w in f.wall)
                    // {
                    //if (f.ball.X + 1 == w.X && f.ball.Y > w.Y && f.ball.Y < w.Y + w.GetSym().Length)//&& f.ball.Y == w.Y)
                    if (f.ball.X + 1 == f.wall[0].X && f.ball.Y >= f.wall[0].Y && f.ball.Y <= f.wall[0].Y + f.wall[0].GetSym.Length
                        || f.ball.X + 1 == f.wall[1].X && f.ball.Y >= f.wall[1].Y && f.ball.Y <= f.wall[1].Y + f.wall[1].GetSym.Length
                        || f.ball.X + 1 == f.wall[2].X && f.ball.Y >= f.wall[2].Y && f.ball.Y <= f.wall[2].Y + f.wall[2].GetSym.Length)
                    {
                        is_up = true;
                    }
                    else
                    {
                        is_up = false;
                    }
                    // }
                    if (is_up == false)
                    {
                        f.ball.MoveDown();
                    }
                    else
                        if (is_up == true)
                        {
                            f.ball.MoveUp();
                        }

                    f.wall[0].MoveWall();
                    f.wall[1].MoveWall();
                    f.wall[2].MoveWall();

                    f.Update();
                    f.Show();
                    if (f.ball.lives == 0)
                    {
                        //Console.BackgroundColor = ConsoleColor.Red;
                        Console.Clear();
                        Console.WriteLine("Game Over \n your score: " + f.ball.score + "\n");
                        Console.WriteLine("Exit Game?");
                        menu.Add("1.Yes" , Exit);
                        menu.Add("2.No" , Menu);
                        menu.Show();
                        menu.Run();

                    }
                    System.Threading.Thread.Sleep(sllep);

                } while (f.ball.lives > 0);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
//.........这里部分代码省略.........
开发者ID:RoykoSerhiy,项目名称:visualStudio_projects,代码行数:101,代码来源:Program.cs


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