我得到一個錯誤,當我嘗試建立:不含定義或擴展方法
不含定義或擴展方法
我有一類這樣的:
[Serializable]
public class JobFile
{
private FileInfo mFileInfo;
private string mJobNumber = string.Empty;
private string mBaseJobNumber = string.Empty;
private Guid mDocumentTytpeid = Guid.Empty;
public string DocumentTypeDescription
{
get
{
string description;
DocumentType DocType;
DocType = DocumentType.GetDocType(DocumentTypeCode);
if (DocType.Code == null)
description = "Unknown";
else
description = DocType.Description;
return description;
}
}
public Guid DocumentTypeID
{
get
{
DocumentType DocType;
DocType = DocumentType.GetDocType(DocumentTypeCode);
if (DocType.Code == null)
mDocumentTytpeid = Guid.Empty;
else
mDocumentTytpeid = DocType.Id;
return mDocumentTytpeid;
}
}
現在我試圖讓Documenttypeid的價值在我的其他類,像這樣:
foreach (FileInfo fi in files)
{
JobFile jf = null;
jf = new JobFile(ref fi);
f.DocumentTypeId = jf.DocumentTypeID; //<-- error is here
}
有誰知道什麼可能是錯的,以及如何解決它? 謝謝。
in'f.DocumentTypeId','f'的類型是什麼? –
循環中聲明瞭「f」的位置?它不應該是'fi'嗎? –
請發佈完整的錯誤文本。並且自己格式化你的代碼,這是不可讀的。 – abatishchev