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


C# UTF8String类代码示例

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


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

示例1: SplitNameAndNamespace

		public static void SplitNameAndNamespace(UTF8String utf8Name, string fullName, out UTF8String ns, out UTF8String name) {
			if (fullName == null)
				fullName = string.Empty;

			if (!UTF8String.IsNull(utf8Name)) {
				if (fullName == utf8Name.String) {
					ns = UTF8String.Empty;
					name = utf8Name;
					return;
				}

				if (fullName.EndsWith("." + utf8Name.String)) {
					ns = fullName.Substring(0, fullName.Length - utf8Name.String.Length - 1);
					name = utf8Name;
					return;
				}
			}

			int i = fullName.LastIndexOf('.');
			if (i < 0) {
				ns = UTF8String.Empty;
				name = fullName;
			}
			else {
				ns = fullName.Substring(0, i);
				name = fullName.Substring(i + 1);
			}
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:28,代码来源:Utils.cs

示例2: Create

		public static EventDefOptions Create(UTF8String name, ITypeDefOrRef eventType) {
			return new EventDefOptions {
				Attributes = 0,
				Name = name,
				EventType = eventType,
			};
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:7,代码来源:EventDefOptions.cs

示例3: InitializeName

 void InitializeName(UTF8String utf8Name, string fullName)
 {
     UTF8String ns, name;
     Utils.SplitNameAndNamespace(utf8Name, fullName, out ns, out name);
     this.Namespace = ns;
     this.Name = name;
 }
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:7,代码来源:CorTypeRef.cs

示例4: CreateFromXml

		/// <summary>
		/// Creates a <see cref="SecurityAttribute"/> from an XML string.
		/// </summary>
		/// <param name="module">Owner module</param>
		/// <param name="xml">XML</param>
		/// <returns>A new <see cref="SecurityAttribute"/> instance</returns>
		public static SecurityAttribute CreateFromXml(ModuleDef module, string xml) {
			var attrType = module.CorLibTypes.GetTypeRef("System.Security.Permissions", "PermissionSetAttribute");
			var utf8Xml = new UTF8String(xml);
			var namedArg = new CANamedArgument(false, module.CorLibTypes.String, "XML", new CAArgument(module.CorLibTypes.String, utf8Xml));
			var list = ThreadSafeListCreator.Create<CANamedArgument>(namedArg);
			return new SecurityAttribute(attrType, list);
		}
开发者ID:xingkongtianyu,项目名称:Protect.NET,代码行数:13,代码来源:SecurityAttribute.cs

示例5: Write

		public static void Write(this BinaryWriter writer, IWriterError helper, UTF8String s) {
			if (UTF8String.IsNull(s)) {
				helper.Error("UTF8String is null");
				s = UTF8String.Empty;
			}

			writer.WriteCompressedUInt32(helper, (uint)s.DataLength);
			writer.Write(s.Data);
		}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:9,代码来源:WriterUtils.cs

示例6: Create

		public static MethodDefOptions Create(UTF8String name, MethodSig methodSig) {
			return new MethodDefOptions {
				ImplAttributes = MethodImplAttributes.IL | MethodImplAttributes.Managed,
				Attributes = MethodAttributes.Public | MethodAttributes.ReuseSlot | MethodAttributes.HideBySig | (methodSig.HasThis ? 0 : MethodAttributes.Static),
				Name = name,
				MethodSig = methodSig,
				ImplMap = null,
			};
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:MethodDefOptions.cs

示例7: Create

		public static PropertyDefOptions Create(ModuleDef module, UTF8String name, bool isInstance) {
			return new PropertyDefOptions {
				Attributes = 0,
				Name = name,
				PropertySig = isInstance ?
								PropertySig.CreateInstance(module.CorLibTypes.Int32) :
								PropertySig.CreateStatic(module.CorLibTypes.Int32),
				Constant = null,
			};
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:10,代码来源:PropertyDefOptions.cs

示例8: Create

		public static TypeDefOptions Create(UTF8String ns, UTF8String name, ITypeDefOrRef baseType, bool isNestedType) {
			return new TypeDefOptions {
				Attributes = (isNestedType ? TypeAttributes.NestedPublic : TypeAttributes.Public) | TypeAttributes.AutoLayout | TypeAttributes.Class | TypeAttributes.AnsiClass,
				Namespace = ns ?? UTF8String.Empty,
				Name = name ?? UTF8String.Empty,
				PackingSize = null,
				ClassSize = null,
				BaseType = baseType,
			};
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:10,代码来源:TypeDefOptions.cs

示例9: MemberRefOptions

 public MemberRefOptions(MemberRef mr)
 {
     this.Class = mr.Class;
     this.Name = mr.Name;
     this.Signature = mr.Signature;
     this.CustomAttributes.AddRange(mr.CustomAttributes);
 }
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:7,代码来源:MemberRefOptions.cs

示例10: GenericParamOptions

		public GenericParamOptions(GenericParam gp) {
			this.Number = gp.Number;
			this.Flags = gp.Flags;
			this.Name = gp.Name;
			this.Kind = gp.Kind;
			this.GenericParamConstraints.AddRange(gp.GenericParamConstraints);
			this.CustomAttributes.AddRange(gp.CustomAttributes);
		}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:8,代码来源:GenericParamOptions.cs

示例11: GenericParamOptions

		public GenericParamOptions(GenericParam gp) {
			Number = gp.Number;
			Flags = gp.Flags;
			Name = gp.Name;
			Kind = gp.Kind;
			GenericParamConstraints.AddRange(gp.GenericParamConstraints);
			CustomAttributes.AddRange(gp.CustomAttributes);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:GenericParamOptions.cs

示例12: ParamDefOptions

		public ParamDefOptions(ParamDef pd) {
			Name = pd.Name;
			Sequence = pd.Sequence;
			Attributes = pd.Attributes;
			Constant = pd.Constant;
			MarshalType = pd.MarshalType;
			CustomAttributes.AddRange(pd.CustomAttributes);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:ParamDefOptions.cs

示例13: PropertyDefOptions

		public PropertyDefOptions(PropertyDef prop) {
			this.Attributes = prop.Attributes;
			this.Name = prop.Name;
			this.PropertySig = prop.PropertySig;
			this.Constant = prop.Constant;
			this.GetMethods.AddRange(prop.GetMethods);
			this.SetMethods.AddRange(prop.SetMethods);
			this.OtherMethods.AddRange(prop.OtherMethods);
			this.CustomAttributes.AddRange(prop.CustomAttributes);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:10,代码来源:PropertyDefOptions.cs

示例14: EventDefOptions

		public EventDefOptions(EventDef evt) {
			Attributes = evt.Attributes;
			Name = evt.Name;
			EventType = evt.EventType;
			AddMethod = evt.AddMethod;
			InvokeMethod = evt.InvokeMethod;
			RemoveMethod = evt.RemoveMethod;
			OtherMethods.AddRange(evt.OtherMethods);
			CustomAttributes.AddRange(evt.CustomAttributes);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:10,代码来源:EventDefOptions.cs

示例15: PropertyDefOptions

		public PropertyDefOptions(PropertyDef prop) {
			Attributes = prop.Attributes;
			Name = prop.Name;
			PropertySig = prop.PropertySig;
			Constant = prop.Constant;
			GetMethods.AddRange(prop.GetMethods);
			SetMethods.AddRange(prop.SetMethods);
			OtherMethods.AddRange(prop.OtherMethods);
			CustomAttributes.AddRange(prop.CustomAttributes);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:10,代码来源:PropertyDefOptions.cs


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