[Mono-osx] [MonoMac] NSPredicateEditor Control and Sample

kjpou kjpou at pt.lu
Tue Nov 30 15:15:21 EST 2010


Hello Miguel

Will fix those up tomorrow and send the fixes.  I had almost all the 
arrays fixed and then lost them in doing all the updates on Saturday and 
Sunday and have not had the time to go back through them.

  Started changing some of the methods to get parameters and was not 
sure that was right so decided not to touch them in case that caused you 
guys more work.  So thanks for pointing that out.  Will go through those 
as well.

When I do a pull to update the sources it does not allow it so I copy to 
a diff file, do a stash and then later re-apply the diff by hand.  My 
first time using git so maybe I am missing a way to do this automatically.

Thanks for the pointers.

Kenneth

On 11/30/10 4:50 PM, Miguel de Icaza wrote:
> Hello,
>
>     The sample shows how to use the NSPredicateEditor within a program
>     and uses the NSMetadataQuery to query SpotLight for a list of
>     names corresponding to the Predicates from your Address Book.
>
>
> A reminder: we never expose the underlying arrays as NSArray, instead 
> we expose them as NSObject [] in the weak cases, and as NSMostDerived 
> [] most of the time to get the advantage of strong typing.
>
> In particular in the NSPredicate code, you need to fix:
>
> TemplateViews return value - Also, it needs to become a property
> PredicateWithSubpredicates - with the proper strong type parameter
> DisplaableSubpredicatesOfPredicate - Strongly type return
> Constructors - arguments are weakly typed NSArrays
> LeftExpressions, Rightexpressions - array types and must be properties,
> RighExpressionAttributeType - must become a property
> Modifier - must become a property
> Operators - must become a property and become strongly typed
> Options - strongly type and become a property, and explore whether ti 
> can be turned into an int [1]
> CompoundTypes - array type
> TemplatesWithAttributeKeyPathsInEntityDescription - both the array 
> type issue and the name should be C#-ified
>
>
> NSRuleEditor:
> CriteriaForRow - array type
> InsertRowAtIndexeWithTypeasBlaBlaBla - Shorten to be C#-like, not be a 
> clone of the ObjC aapi
>
> NSRuleEditorDelegate:
>
> The lesson here is that the signature of the methods is required in 
> Objective-C as people mix a lot of responders in the same file so they 
> need to be unique, and they kind of become unique by using the prefix 
> of the class, but this is not necessary in MonoMac.   You would use 
> these as events, so the name must make sense as an event.   For example:
>
> RuleEditorNumberOfChildrenForCriteriorWithRowType really is merely a 
> compressed name of 3 parameters in ObjC: the first which is the prefix 
> and we do not care about, the second is the actual oepration, and the 
> third is the paramter.   So this really should become
>
> int NumberOfChildren (NSRuleEditor ruleEditor, NSObject forCriterion, 
> NSRuleEditorRowType withRowType)
>
> [1] In general, uints are not CLS-compliant, which means that some 
> languages have trouble accessing those APIs, we need to explore 
> whether a Flags or int is sufficient in those cases.
>
> NSPredicateEditor:
> RowTemplates - array type
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20101130/7d91f195/attachment-0001.html 


More information about the Mono-osx mailing list