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


C# Field.Select方法代码示例

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


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

示例1: FillInField

        private void FillInField(Field field, Application wordApp)
        {
            var fieldText = field.Code.Text;
            if (!fieldText.StartsWith(" MERGEFIELD")) return;
            var match = Regex.Match(fieldText, @"(?<=MERGEFIELD).[^\\]*", RegexOptions.IgnoreCase);
            if (!match.Success) return;
            var fieldName = match.Value.Trim();

            foreach (var parameters in _label.ParameterArray)
            {
                if (fieldName.ToLower() != parameters.ToLower()) continue;
                field.Select();
                wordApp.Selection.TypeText(_label.ParameterValue(parameters));
            }
        }
开发者ID:jobando89,项目名称:SharpLabelPrinter,代码行数:15,代码来源:Printer.cs

示例2: NewObject

        public static Field NewObject(IRequest context, Field typeName, Field[] args = null)
        {
            if (Field.IsNullField(typeName))
                throw new ArgumentNullException("typeName");

            if (!(typeName.Type is StringType))
                throw new ArgumentException("The type name argument must be of string type.");

            var argExp = new SqlExpression[args == null ? 0 : args.Length];

            if (args != null) {
                argExp = args.Select(SqlExpression.Constant).Cast<SqlExpression>().ToArray();
            }

            var type = context.Access().ResolveUserType(typeName.Value.ToString());
            if (type == null)
                throw new InvalidOperationException(String.Format("The type '{0}' was not defined.", typeName));

            if (!(type is UserType))
                throw new InvalidOperationException(String.Format("The type '{0}' is not a user-defined type", typeName));

            var userType = (UserType) type;

            var obj = userType.NewObject(context, argExp);

            return Field.Object(userType, obj);
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:27,代码来源:SystemFunctions.cs

示例3: 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


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