You are viewing limited content. For full access, please sign in.

Question

Question

IList Parameters error in Repository Access

SDK
asked on August 25, 2016

Hello,

 

I'm writing a piece of code to import briefcases using Repository Access, but I'm having troubles with the code at the Template matching step.

 

The code reads as follows:

 

Select Case request.RequestType
Case BriefcaseRequestType.MatchTemplates
                        Dim mTemplates As IList(Of BriefcaseTemplateInfo) = request.MatchTemplates
                        For i As Integer = 0 To mTemplates.Count - 1
                            Dim mTemp As BriefcaseTemplateInfo = mTemplates(i)
                            mTemp.MatchStrategy = If(mTemp.MatchTemplate IsNot Nothing, BriefcaseFieldMatchStrategy.Match, BriefcaseFieldMatchStrategy.Create)
                            'If mTemp.Name = "Daily Journal" Then
                            'mTemp.MatchStrategy = BriefcaseFieldMatchStrategy.Match
                            'End If
                        Next
                        Dim mFields As IList(Of BriefcaseFieldInfo) = request.MatchFields
                        For i As Integer = 0 To mFields.Count - 1
                            Dim mField As BriefcaseFieldInfo = mFields(i)
                            mField.MatchStrategy = If(mField.MatchField IsNot Nothing, BriefcaseFieldMatchStrategy.Match, BriefcaseFieldMatchStrategy.FollowTemplate)
                            'If mField.Name = "Branch" Then
                            'mField.MatchStrategy = BriefcaseFieldMatchStrategy.Match
                            'End If
                        Next
                        request = imp.FinishedMatchingTemplates
end Select

 

But the BriefcaseTemplateInfo and the BriefcaseFieldInfo are not recognized because of the following error:

 

Error 58 'System.Collections.IList' has no type parameters and so cannot have type arguments.

 

Here you have a screenshot of the compilation error:

 

 

Probably it's a silly question, but can anyone help?

I'm using LF 9.2 and VS 2008 for practical reasons.

 

Thank you in advance and best regards,

 

Ignacio PdeA

BMB sal

0 0

Answer

SELECTED ANSWER
replied on August 25, 2016

There are two interfaces called IList in .Net.  The one you are using is in the namespace System.Collections, while the one RA is using is in System.Collections.Generic.  The latter does take a type argument.  The problem is probably in your import statements.  Modern applications should include System.Collections.Generic instead of System.Collections.

1 0

Replies

replied on August 25, 2016 Show version history

Try using "For Each" to iterate over the templates in the enumeration:

For Each mTemp As BriefcaseTemplateInfo In request.MatchTemplates
    ' ...
Next
0 0
replied on August 31, 2016

Thanks Brian and Robert for your replies!

 

Actually if i add 

 

Imports System.Collections.Generic

 

in the General-Declarations section of my project, the IList works fine.

 

So it looks:

 

Imports Laserfiche.RepositoryAccess
Imports System.Collections.Generic

 

Thanks again and best regards,

 

Ignacio PdeA

BMB sal

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.