Class ExtendedAttributeDefinition

Class ExtendedAttributeDefinition

Namespace: Aspose.Tasks
Assembly: Aspose.Tasks.dll (25.2.0)

แสดงถึงการกำหนดคุณสมบัติขยายที่เชื่อมโยงกับโครงการ

[ClassInterface(ClassInterfaceType.AutoDual)]
public class ExtendedAttributeDefinition

การสืบทอด

objectExtendedAttributeDefinition

สมาชิกที่สืบทอด

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

คุณสมบัติ

Alias

รับหรือกำหนดนามแฝงของฟิลด์ที่กำหนดเอง

public string Alias { get; set; }

ค่าของคุณสมบัติ

string

AppendNewValues

รับหรือกำหนดค่าที่บ่งชี้ว่าค่าที่เพิ่มใหม่ไปยังโครงการจะถูกเพิ่มโดยอัตโนมัติไปยังรายการ

public bool AppendNewValues { get; set; }

ค่าของคุณสมบัติ

bool

หมายเหตุ

ปัจจุบันรองรับสำหรับรูปแบบ MSP 2003/2007 Xml และ MSP 2003 mpp

AutoRollDown

รับหรือกำหนดค่าที่บ่งชี้ว่าการกลิ้งอัตโนมัติไปยังการมอบหมายเปิดใช้งานอยู่หรือไม่

public bool AutoRollDown { get; set; }

ค่าของคุณสมบัติ

bool

CalculationType

รับหรือกำหนดประเภทของการคำนวณค่าของคุณสมบัติที่กำหนดเอง

public CalculationType CalculationType { get; set; }

ค่าของคุณสมบัติ

CalculationType

CfType

รับประเภทของฟิลด์ที่กำหนดเอง

public CustomFieldType CfType { get; }

ค่าของคุณสมบัติ

CustomFieldType

Default

รับหรือกำหนดค่าปริยายในรายการ

public string Default { get; set; }

ค่าของคุณสมบัติ

string

หมายเหตุ

ปัจจุบันรองรับสำหรับรูปแบบ MSP 2003/2007 Xml และ MSP 2003 mpp

DefaultGuid

รับหรือกำหนด Guid ของรายการตารางค้นหาปริยาย

public string DefaultGuid { get; set; }

ค่าของคุณสมบัติ

string

ElementType

รับหรือกำหนดว่าคุณสมบัติขยายเชื่อมโยงกับงาน ทรัพยากร หรือการมอบหมาย

public ElementType ElementType { get; set; }

ค่าของคุณสมบัติ

ElementType

FieldId

รับหรือกำหนดที่ตรงกับรหัสโครงการของฟิลด์ที่กำหนดเอง ใช้การแทนค่าของสตริงจากคลาส Aspose.Tasks.ExtendedAttributeTask เพื่อระบุคุณสมบัติ Aspose.Tasks.ExtendedAttributeDefinition.FieldId

public string FieldId { get; set; }

ค่าของคุณสมบัติ

string

ตัวอย่าง

customFieldDefinition.FieldId = Aspose.Tasks.ExtendedAttributeTask.Number10.ToString("D");

หมายเหตุ

วิธีที่แนะนำในการตั้งค่าคุณสมบัติ Aspose.Tasks.ExtendedAttributeDefinition.FieldId คือการสร้าง Aspose.Tasks.ExtendedAttributeDefinition โดยใช้หนึ่งในวิธีการโรงงานเฉพาะที่เช่น Aspose.Tasks.ExtendedAttributeDefinition.CreateTaskDefinition(Aspose.Tasks.ExtendedAttributeTask,System.String) หรือ Aspose.Tasks.ExtendedAttributeDefinition.CreateLookupTaskDefinition(Aspose.Tasks.CustomFieldType,Aspose.Tasks.ExtendedAttributeTask,System.String)

FieldName

รับชื่อของฟิลด์ที่กำหนดเอง

public string FieldName { get; }

ค่าของคุณสมบัติ

string

หมายเหตุ

ไม่ควรกำหนดโดยตรง แทนที่จะสร้าง ExtendedAttributeDefinition โดยใช้วิธีการโรงงานที่มีการกำหนดประเภทอย่างเข้มงวดที่มีชื่อว่า Create*Definition()

Formula

รับหรือกำหนดสูตรที่ Microsoft Project ใช้ในการกรอกฟิลด์งานที่กำหนดเอง

public string Formula { get; set; }

ค่าของคุณสมบัติ

string

GraphicalIndicator

รับหรือกำหนดข้อมูลตัวบ่งชี้กราฟิกที่เชื่อมโยงกับคุณสมบัติขยาย ใช้ได้กับรูปแบบ MPP

public GraphicalIndicatorsInfo GraphicalIndicator { get; set; }

ค่าของคุณสมบัติ

GraphicalIndicatorsInfo

Guid

รับหรือกำหนด Guid ของฟิลด์ที่กำหนดเอง

public string Guid { get; set; }

ค่าของคุณสมบัติ

string

หมายเหตุ

ปัจจุบันรองรับเฉพาะรูปแบบ Xml เท่านั้น

LookupUid

รับ Guid ของตารางค้นหาที่เชื่อมโยงกับฟิลด์ที่กำหนดเอง

public string LookupUid { get; }

ค่าของคุณสมบัติ

string

หมายเหตุ

เพื่อสร้างฟิลด์ที่กำหนดเองด้วยการค้นหา ใช้หนึ่งในวิธีการโรงงาน: Aspose.Tasks.ExtendedAttributeDefinition.CreateLookupTaskDefinition(Aspose.Tasks.CustomFieldType,Aspose.Tasks.ExtendedAttributeTask,System.String) หรือ Aspose.Tasks.ExtendedAttributeDefinition.CreateLookupResourceDefinition(Aspose.Tasks.CustomFieldType,Aspose.Tasks.ExtendedAttributeResource,System.String)

MaxMultiValues

รับหรือกำหนดจำนวนค่าสูงสุดที่คุณสามารถตั้งค่าในรายการเลือก

public int MaxMultiValues { get; set; }

ค่าของคุณสมบัติ

int

หมายเหตุ

ปัจจุบันรองรับเฉพาะรูปแบบ Xml เท่านั้น

ParentProject

รับโครงการหลักสำหรับอินสแตนซ์ของ Aspose.Tasks.ExtendedAttributeDefinition

public Project ParentProject { get; }

ค่าของคุณสมบัติ

Project

PhoneticsAlias

รับหรือกำหนดการออกเสียงตามพยัญชนะของนามแฝงของฟิลด์ที่กำหนดเอง

public string PhoneticsAlias { get; set; }

ค่าของคุณสมบัติ

string

หมายเหตุ

ปัจจุบันรองรับเฉพาะรูปแบบ Xml เท่านั้น

RestrictValues

รับหรือกำหนดค่าที่บ่งชี้ว่าค่าฟิลด์ที่กำหนดเองถูกจำกัดให้เป็นค่าที่อยู่ใน Aspose.Tasks.ExtendedAttributeDefinition.ValueList

public bool RestrictValues { get; set; }

ค่าของคุณสมบัติ

bool

RollupType

รับหรือกำหนดวิธีการคำนวณการรวม

public RollupType RollupType { get; set; }

ค่าของคุณสมบัติ

RollupType

หมายเหตุ

การเขียนปัจจุบันรองรับเฉพาะรูปแบบ Xml เท่านั้น

SecondaryGuid

รับหรือกำหนด Guid รองของคุณสมบัติขยาย

public string SecondaryGuid { get; set; }

ค่าของคุณสมบัติ

string

หมายเหตุ

นี่คือคุณสมบัติใหม่สำหรับ MS Project 2010

SecondaryPid

รับหรือกำหนด PID รองของฟิลด์ที่กำหนดเอง

public string SecondaryPid { get; set; }

ค่าของคุณสมบัติ

string

SummaryRowsCalculationType

รับหรือกำหนดประเภทของการคำนวณค่าของคุณสมบัติที่กำหนดเองสำหรับแถวสรุป

public SummaryRowsCalculationType SummaryRowsCalculationType { get; set; }

ค่าของคุณสมบัติ

SummaryRowsCalculationType

UserDef

รับหรือกำหนดค่าที่บ่งชี้ว่าฟิลด์ที่กำหนดเองถูกกำหนดโดยผู้ใช้

public bool UserDef { get; set; }

ค่าของคุณสมบัติ

bool

หมายเหตุ

ปัจจุบันรองรับเฉพาะรูปแบบ Xml เท่านั้น

ValueList

รับ List<Value> ValueList

public List<value> ValueList { get; }

ค่าของคุณสมบัติ

List<Value&gt;

หมายเหตุ

เมื่อค่าของคุณสมบัติขยายถูกกำหนดเป็นคุณสมบัติขององค์ประกอบในสคีมา พวกเขาอาจถูกกำหนดโดยค่าหรือโดยการอ้างอิงไปยังค่าที่อยู่ในรายการนี้ แอปพลิเคชันอาจถือว่าลำดับของรายการโดยลำดับที่ระบุที่นี่ ปัจจุบันรองรับสำหรับรูปแบบ MSP 2003/2007 Xml และ MSP 2003 mpp อย่าเปลี่ยนรายการนี้โดยตรง ใช้เมธอด ExtendedAttributeDefinition.AddLookupValue/RemoveLookupValue แทน

ValuelistSortOrder

รับหรือกำหนดวิธีการเรียงลำดับรายการค่า ค่าเป็น: 0=เรียงจากมากไปน้อย, 1=เรียงจากน้อยไปมาก

public int ValuelistSortOrder { get; set; }

ค่าของคุณสมบัติ

int

หมายเหตุ

ปัจจุบันรองรับสำหรับรูปแบบ MSP 2003/2007 Xml และ MSP 2003 mpp

วิธีการ

AddLookupValue(Value)

เพิ่มค่าไปยังรายการค้นหาภายใน นี่เป็นวิธีที่แนะนำสำหรับการจัดการกับ Aspose.Tasks.ExtendedAttributeDefinition.ValueList

public void AddLookupValue(Value value)

พารามิเตอร์

value Value

ค่าที่จะเพิ่มไปยังการค้นหา

ตัวอย่าง

ใช้โค้ดนี้เพื่อเพิ่มค่าใหม่ไปยังรายการค้นหา: taskTextAttr.AddLookupValue(new Value { Id = 1, Val = "Text value 1", Description = "Text value description 1" });

หมายเหตุ

วิธีนี้ทำงานเฉพาะสำหรับอินสแตนซ์ของ Aspose.Tasks.ExtendedAttributeDefinition ซึ่งมี Aspose.Tasks.ExtendedAttributeDefinition.CalculationType เท่ากับ Aspose.Tasks.CalculationType.Lookup

CreateExtendedAttribute()

สร้างคุณสมบัติขยายใหม่ที่มีรหัสฟิลด์ซึ่งเท่ากับค่ารหัสฟิลด์ของวัตถุนี้

public ExtendedAttribute CreateExtendedAttribute()

คืนค่า

ExtendedAttribute

คืนค่าตัวอย่างที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttribute โดยมี fieldID ซึ่งเท่ากับค่าของ fieldID ของวัตถุนี้

CreateExtendedAttribute(string)

สร้างคุณสมบัติขยายใหม่ที่มีรหัสฟิลด์ซึ่งเท่ากับค่ารหัสฟิลด์ของวัตถุนี้และค่าข้อความที่ระบุ

public ExtendedAttribute CreateExtendedAttribute(string textValue)

พารามิเตอร์

textValue string

ค่าข้อความที่ระบุ

คืนค่า

ExtendedAttribute

คืนค่าตัวอย่างที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttribute โดยมี fieldID ซึ่งเท่ากับค่าของ fieldID ของวัตถุนี้

ข้อยกเว้น

InvalidOperationException

ถ้าคุณสมบัติ Aspose.Tasks.ExtendedAttributeDefinition.CfType ปัจจุบันไม่ใช่ ‘Text’

CreateExtendedAttribute(decimal)

สร้างคุณสมบัติขยายใหม่ที่มีรหัสฟิลด์ซึ่งเท่ากับค่ารหัสฟิลด์ของวัตถุนี้และค่าตัวเลขที่ระบุ

public ExtendedAttribute CreateExtendedAttribute(decimal numericValue)

พารามิเตอร์

numericValue decimal

ค่าตัวเลขที่ระบุ

คืนค่า

ExtendedAttribute

คืนค่าตัวอย่างที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttribute โดยมี fieldID ซึ่งเท่ากับค่าของ fieldID ของวัตถุนี้

ข้อยกเว้น

InvalidOperationException

ถ้าคุณสมบัติ Aspose.Tasks.ExtendedAttributeDefinition.CfType ปัจจุบันไม่ใช่ ‘Number’ หรือ ‘Cost’

CreateExtendedAttribute(DateTime)

สร้างคุณสมบัติขยายใหม่ที่มีรหัสฟิลด์ซึ่งเท่ากับค่ารหัสฟิลด์ของวัตถุนี้และค่าที่ระบุวันที่

public ExtendedAttribute CreateExtendedAttribute(DateTime dateTimeValue)

พารามิเตอร์

dateTimeValue DateTime

ค่าที่ระบุวันที่เวลา

คืนค่า

ExtendedAttribute

คืนค่าตัวอย่างที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttribute โดยมี fieldID ซึ่งเท่ากับค่าของ fieldID ของวัตถุนี้

ข้อยกเว้น

InvalidOperationException

ถ้าคุณสมบัติ Aspose.Tasks.ExtendedAttributeDefinition.CfType ปัจจุบันไม่ใช่ ‘Date’, ‘Start’ หรือ ‘Finish’

CreateExtendedAttribute(Duration)

สร้างคุณสมบัติขยายใหม่ที่มีรหัสฟิลด์ซึ่งเท่ากับค่ารหัสฟิลด์ของวัตถุนี้และค่าที่ระบุระยะเวลา

public ExtendedAttribute CreateExtendedAttribute(Duration durationValue)

พารามิเตอร์

durationValue Duration

ค่าระยะเวลาที่ระบุ

คืนค่า

ExtendedAttribute

คืนค่าตัวอย่างที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttribute โดยมี fieldID ซึ่งเท่ากับค่าของ fieldID ของวัตถุนี้

ข้อยกเว้น

InvalidOperationException

ถ้าคุณสมบัติ Aspose.Tasks.ExtendedAttributeDefinition.CfType ปัจจุบันไม่ใช่ ‘Duration’

CreateExtendedAttribute(bool)

สร้างคุณสมบัติขยายใหม่ที่มีรหัสฟิลด์ซึ่งเท่ากับค่ารหัสฟิลด์ของวัตถุนี้และค่าธงที่ระบุ

public ExtendedAttribute CreateExtendedAttribute(bool flagValue)

พารามิเตอร์

flagValue bool

ค่าธงที่ระบุ

คืนค่า

ExtendedAttribute

คืนค่าตัวอย่างที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttribute โดยมี fieldID ซึ่งเท่ากับค่าของ fieldID ของวัตถุนี้

ข้อยกเว้น

InvalidOperationException

ถ้าคุณสมบัติ Aspose.Tasks.ExtendedAttributeDefinition.CfType ปัจจุบันไม่ใช่ ‘Flag’

CreateExtendedAttribute(Value)

สร้างคุณสมบัติขยายใหม่ที่เชื่อมโยงกับรายการ Aspose.Tasks.Value ที่ระบุ

public ExtendedAttribute CreateExtendedAttribute(Value lookupValue)

พารามิเตอร์

lookupValue Value

รายการ Aspose.Tasks.Value ที่ระบุ

คืนค่า

ExtendedAttribute

คืนค่าตัวอย่างที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttribute ที่เชื่อมโยงกับรายการ Aspose.Tasks.Value ที่ระบุ

ตัวอย่าง

ใช้โค้ดนี้เพื่อสร้าง Aspose.Tasks.ExtendedAttribute ใหม่โดยใช้ค่าที่เฉพาะเจาะจง:

taskTextAttr.AddLookupValue(value1);
taskTextAttr.AddLookupValue(value2);
var extendedAttribute = taskTextAttr.CreateExtendedAttribute(value2);

หมายเหตุ

lookupValue ควรถูกเพิ่มไปยัง Aspose.Tasks.ExtendedAttributeDefinition โดยใช้เมธอด Aspose.Tasks.ExtendedAttributeDefinition.AddLookupValue(Aspose.Tasks.Value) ก่อนหน้านี้

CreateLookupResourceDefinition(ExtendedAttributeResource, string)

วิธีการโรงงานที่สร้างการกำหนดคุณสมบัติขยายที่มีการค้นหา มันมี Aspose.Tasks.ExtendedAttributeDefinition.CalculationType เท่ากับ Aspose.Tasks.CalculationType.Lookup และสามารถใช้ได้เฉพาะในทรัพยากรเท่านั้น คุณต้องระบุ fieldId และ alias เมื่อเรียกใช้วิธีนี้ ประเภทฟิลด์จะถูกอนุมานจากรหัสฟิลด์

public static ExtendedAttributeDefinition CreateLookupResourceDefinition(ExtendedAttributeResource fieldId, string alias)

พารามิเตอร์

fieldId ExtendedAttributeResource

รหัสฟิลด์ Aspose.Tasks.ExtendedAttributeResource ที่ระบุ

alias string

นามแฝง System.String ที่ระบุ

คืนค่า

ExtendedAttributeDefinition

อินสแตนซ์ที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttributeDefinition โดยมี fieldId และ alias ที่ระบุ

ตัวอย่าง

ใช้ตัวอย่างนี้เพื่อสร้างการกำหนดฟิลด์ที่กำหนดเองสำหรับทรัพยากรพร้อมการค้นหาและจากนั้นเติมด้วยค่าข้อความ:

var resourceTextAttr = ExtendedAttributeDefinition.CreateLookupResourceDefinition(ExtendedAttributeResource.Text27, "My custom field");
resourceTextAttr.AddLookupValue(new Value { Id = 1, Val = "Text value 1", Description = "Text value description 1" });
resourceTextAttr.AddLookupValue(new Value { Id = 2, Val = "Text value 2", Description = "Text value description 2" });
project.ExtendedAttributes.Add(resourceTextAttr);

CreateLookupResourceDefinition(CustomFieldType, ExtendedAttributeResource, string)

วิธีการโรงงานที่สร้างการกำหนดคุณสมบัติขยายที่มีการค้นหา มันมี Aspose.Tasks.ExtendedAttributeDefinition.CalculationType เท่ากับ Aspose.Tasks.CalculationType.Lookup และสามารถใช้ได้เฉพาะในทรัพยากรเท่านั้น คุณต้องระบุ customFieldType, fieldId และ alias เมื่อเรียกใช้วิธีนี้

public static ExtendedAttributeDefinition CreateLookupResourceDefinition(CustomFieldType customFieldType, ExtendedAttributeResource fieldId, string alias)

พารามิเตอร์

customFieldType CustomFieldType

ประเภท Aspose.Tasks.CustomFieldType ที่ระบุ

fieldId ExtendedAttributeResource

รหัสฟิลด์ Aspose.Tasks.ExtendedAttributeResource ที่ระบุ

alias string

นามแฝง System.String ที่ระบุ

คืนค่า

ExtendedAttributeDefinition

อินสแตนซ์ที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttributeDefinition โดยมี customFieldType, fieldId และ alias ที่ระบุ

ตัวอย่าง

ใช้ตัวอย่างนี้เพื่อสร้างการกำหนดฟิลด์ที่กำหนดเองสำหรับทรัพยากรพร้อมการค้นหาและจากนั้นเติมด้วยค่าข้อความ:

var resourceTextAttr = ExtendedAttributeDefinition.CreateLookupResourceDefinition(CustomFieldType.Text, ExtendedAttributeResource.Text27, "My custom field");
resourceTextAttr.AddLookupValue(new Value { Id = 1, Val = "Text value 1", Description = "Text value description 1" });
resourceTextAttr.AddLookupValue(new Value { Id = 2, Val = "Text value 2", Description = "Text value description 2" });
project.ExtendedAttributes.Add(resourceTextAttr);

CreateLookupTaskDefinition(ExtendedAttributeTask, string)

วิธีการโรงงานที่สร้างการกำหนดคุณสมบัติขยายที่มีการค้นหา มันมี Aspose.Tasks.ExtendedAttributeDefinition.CalculationType เท่ากับ Aspose.Tasks.CalculationType.Lookup และสามารถใช้ได้เฉพาะในงานเท่านั้น คุณต้องระบุ fieldId และ alias เมื่อเรียกใช้วิธีนี้ ประเภทฟิลด์จะถูกอนุมานจากรหัสฟิลด์

public static ExtendedAttributeDefinition CreateLookupTaskDefinition(ExtendedAttributeTask fieldId, string alias)

พารามิเตอร์

fieldId ExtendedAttributeTask

รหัสฟิลด์ Aspose.Tasks.ExtendedAttributeTask ที่ระบุ

alias string

นามแฝง System.String ที่ระบุ

คืนค่า

ExtendedAttributeDefinition

อินสแตนซ์ที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttributeDefinition โดยมี fieldId และ alias ที่ระบุ

ตัวอย่าง

ใช้ตัวอย่างนี้เพื่อสร้างการกำหนดฟิลด์ที่กำหนดเองสำหรับงานพร้อมการค้นหาและจากนั้นเติมด้วยค่าข้อความ:

var taskTextAttr = ExtendedAttributeDefinition.CreateLookupTaskDefinition(ExtendedAttributeTask.Text27, "My custom field");
taskTextAttr.AddLookupValue(new Value { Id = 1, Val = "Text value 1", Description = "Text value description 1" });
taskTextAttr.AddLookupValue(new Value { Id = 2, Val = "Text value 2", Description = "Text value description 2" });
project.ExtendedAttributes.Add(taskTextAttr);

CreateLookupTaskDefinition(CustomFieldType, ExtendedAttributeTask, string)

วิธีการโรงงานที่สร้างการกำหนดคุณสมบัติขยายที่มีการค้นหา มันมี Aspose.Tasks.ExtendedAttributeDefinition.CalculationType เท่ากับ Aspose.Tasks.CalculationType.Lookup และสามารถใช้ได้เฉพาะในงานเท่านั้น คุณต้องระบุ customFieldType, fieldId และ alias เมื่อเรียกใช้วิธีนี้

public static ExtendedAttributeDefinition CreateLookupTaskDefinition(CustomFieldType customFieldType, ExtendedAttributeTask fieldId, string alias)

พารามิเตอร์

customFieldType CustomFieldType

ประเภท Aspose.Tasks.CustomFieldType ที่ระบุ

fieldId ExtendedAttributeTask

รหัสฟิลด์ Aspose.Tasks.ExtendedAttributeTask ที่ระบุ

alias string

นามแฝง System.String ที่ระบุ

คืนค่า

ExtendedAttributeDefinition

อินสแตนซ์ที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttributeDefinition โดยมี customFieldType, fieldId และ alias ที่ระบุ

ตัวอย่าง

ใช้ตัวอย่างนี้เพื่อสร้างการกำหนดฟิลด์ที่กำหนดเองสำหรับงานพร้อมการค้นหาและจากนั้นเติมด้วยค่าข้อความ:

var taskTextAttr = ExtendedAttributeDefinition.CreateLookupTaskDefinition(CustomFieldType.Text, ExtendedAttributeTask.Text27, "My custom field");
taskTextAttr.AddLookupValue(new Value { Id = 1, Val = "Text value 1", Description = "Text value description 1" });
taskTextAttr.AddLookupValue(new Value { Id = 2, Val = "Text value 2", Description = "Text value description 2" });
project.ExtendedAttributes.Add(taskTextAttr);

CreateResourceDefinition(CustomFieldType, ExtendedAttributeResource, string)

วิธีการโรงงานที่สร้างการกำหนดคุณสมบัติขยายที่เรียบง่าย ซึ่ง Microsoft Project แสดงเป็น “None” มันมี Aspose.Tasks.ExtendedAttributeDefinition.CalculationType เท่ากับ Aspose.Tasks.CalculationType.None และสามารถใช้ได้เฉพาะในทรัพยากรเท่านั้น คุณต้องระบุ customFieldType, fieldId และ alias เมื่อเรียกใช้วิธีนี้

public static ExtendedAttributeDefinition CreateResourceDefinition(CustomFieldType customFieldType, ExtendedAttributeResource fieldId, string alias)

พารามิเตอร์

customFieldType CustomFieldType

ประเภท Aspose.Tasks.CustomFieldType ที่ระบุ

fieldId ExtendedAttributeResource

รหัสฟิลด์ Aspose.Tasks.ExtendedAttributeResource ที่ระบุ

alias string

นามแฝง System.String ที่ระบุ

คืนค่า

ExtendedAttributeDefinition

อินสแตนซ์ที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttributeDefinition โดยมี customFieldType, fieldId และ alias ที่ระบุ

ตัวอย่าง

ใช้ตัวอย่างนี้เพื่อสร้างการกำหนดฟิลด์ข้อความที่กำหนดเอง:

var resourceTextAttr = ExtendedAttributeDefinition.CreateResourceDefinition(CustomFieldType.Text, ExtendedAttributeResource.Text27, "My custom field");
project.ExtendedAttributes.Add(resourceTextAttr);

CreateResourceDefinition(ExtendedAttributeResource, string)

วิธีการโรงงานที่สร้างการกำหนดคุณสมบัติขยายที่เรียบง่าย ซึ่ง Microsoft Project แสดงเป็น “None” มันมี Aspose.Tasks.ExtendedAttributeDefinition.CalculationType เท่ากับ Aspose.Tasks.CalculationType.None และสามารถใช้ได้เฉพาะในทรัพยากรเท่านั้น คุณต้องระบุ fieldId และ alias เมื่อเรียกใช้วิธีนี้ ประเภทฟิลด์จะถูกอนุมานจากรหัสฟิลด์

public static ExtendedAttributeDefinition CreateResourceDefinition(ExtendedAttributeResource fieldId, string alias)

พารามิเตอร์

fieldId ExtendedAttributeResource

รหัสฟิลด์ Aspose.Tasks.ExtendedAttributeResource ที่ระบุ

alias string

นามแฝง System.String ที่ระบุ

คืนค่า

ExtendedAttributeDefinition

อินสแตนซ์ที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttributeDefinition โดยมี fieldId และ alias ที่ระบุ

ตัวอย่าง

ใช้ตัวอย่างนี้เพื่อสร้างการกำหนดฟิลด์ข้อความที่กำหนดเอง:

var resourceTextAttr = ExtendedAttributeDefinition.CreateResourceDefinition(ExtendedAttributeResource.Text27, "My custom field");
project.ExtendedAttributes.Add(resourceTextAttr);

CreateTaskDefinition(CustomFieldType, ExtendedAttributeTask, string)

วิธีการโรงงานที่สร้างการกำหนดคุณสมบัติขยายที่เรียบง่าย ซึ่ง Microsoft Project แสดงเป็น “None” มันมี Aspose.Tasks.ExtendedAttributeDefinition.CalculationType เท่ากับ Aspose.Tasks.CalculationType.None และสามารถใช้ได้เฉพาะในงานเท่านั้น คุณต้องระบุ customFieldType, fieldId และ alias เมื่อเรียกใช้วิธีนี้

public static ExtendedAttributeDefinition CreateTaskDefinition(CustomFieldType customFieldType, ExtendedAttributeTask fieldId, string alias)

พารามิเตอร์

customFieldType CustomFieldType

ประเภท Aspose.Tasks.CustomFieldType ที่ระบุ

fieldId ExtendedAttributeTask

รหัสฟิลด์ Aspose.Tasks.ExtendedAttributeTask ที่ระบุ

alias string

นามแฝง System.String ที่ระบุ

คืนค่า

ExtendedAttributeDefinition

อินสแตนซ์ที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttributeDefinition โดยมี customFieldType, fieldId และ alias ที่ระบุ

ตัวอย่าง

ใช้ตัวอย่างนี้เพื่อสร้างการกำหนดฟิลด์ข้อความที่กำหนดเอง:

var taskTextAttr = ExtendedAttributeDefinition.CreateTaskDefinition(CustomFieldType.Text, ExtendedAttributeTask.Text27, "My custom field");
project.ExtendedAttributes.Add(taskTextAttr);

CreateTaskDefinition(ExtendedAttributeTask, string)

วิธีการโรงงานที่สร้างการกำหนดคุณสมบัติขยายที่เรียบง่าย ซึ่ง Microsoft Project แสดงเป็น “None” มันมี Aspose.Tasks.ExtendedAttributeDefinition.CalculationType เท่ากับ Aspose.Tasks.CalculationType.None และสามารถใช้ได้เฉพาะในงานเท่านั้น คุณต้องระบุ fieldId และ alias เมื่อเรียกใช้วิธีนี้ ประเภทฟิลด์จะถูกอนุมานจากรหัสฟิลด์

public static ExtendedAttributeDefinition CreateTaskDefinition(ExtendedAttributeTask fieldId, string alias)

พารามิเตอร์

fieldId ExtendedAttributeTask

รหัสฟิลด์ Aspose.Tasks.ExtendedAttributeTask ที่ระบุ

alias string

นามแฝง System.String ที่ระบุ

คืนค่า

ExtendedAttributeDefinition

อินสแตนซ์ที่สร้างขึ้นของคลาส Aspose.Tasks.ExtendedAttributeDefinition โดยมี fieldId และ alias ที่ระบุ

ตัวอย่าง

ใช้ตัวอย่างนี้เพื่อสร้างการกำหนดฟิลด์ข้อความที่กำหนดเอง:

var taskTextAttr = ExtendedAttributeDefinition.CreateTaskDefinition(ExtendedAttributeTask.Text27, "My custom field");
project.ExtendedAttributes.Add(taskTextAttr);

Equals(object)

คืนธงที่บ่งชี้ว่าตัวอย่างนี้เท่ากับวัตถุที่ระบุหรือไม่

public override bool Equals(object obj)

พารามิเตอร์

obj object

วัตถุที่ระบุเพื่อเปรียบเทียบกับตัวอย่างนี้

คืนค่า

bool

ธงที่บ่งชี้ว่าตัวอย่างนี้เท่ากับวัตถุที่ระบุหรือไม่

GetHashCode()

คืนค่าแฮชโค้ดสำหรับอินสแตนซ์ของคลาส Aspose.Tasks.ExtendedAttributeDefinition

public override int GetHashCode()

คืนค่า

int

แฮชโค้ดสำหรับวัตถุนี้

RemoveLookupValue(Value)

ลบค่าจากรายการค้นหาภายใน นี่เป็นวิธีที่แนะนำสำหรับการจัดการกับ Aspose.Tasks.ExtendedAttributeDefinition.ValueList

public void RemoveLookupValue(Value value)

พารามิเตอร์

value Value

ค่าที่จะลบออกจากการค้นหา

หมายเหตุ

วิธีนี้ทำงานเฉพาะสำหรับอินสแตนซ์ของ Aspose.Tasks.ExtendedAttributeDefinition ซึ่งมี Aspose.Tasks.ExtendedAttributeDefinition.CalculationType เท่ากับ Aspose.Tasks.CalculationType.Lookup

 แบบไทย