Jump to content

midora

Members
  • Posts

    1,782
  • Joined

  • Last visited

  • Days Won

    26

Posts posted by midora

  1. VS proposes to use a switch expression

     

                var cipn = property switch
                {
                    BooleanProperty or UriProperty => ControlInfoPropertyNames.Footnote,
                    _ => ControlInfoPropertyNames.Description,
                };

     

    I guess I should take the time to have a look to all the new c# features.

    But on the other side I have to debug now Xamarin code on iOS and should not forget the old stuff 😉

     

  2. I was surprised that switch allows to test for a class type...

     

            public void SetPropertyDescription(Property property)
            {
                ControlInfoPropertyNames cipn;
                switch (property)
                {
                    case BooleanProperty:
                    case UriProperty:
                        cipn = ControlInfoPropertyNames.Footnote;
                        break;
                    default:
                        cipn = ControlInfoPropertyNames.Description;
                        break;
                }
                var descriptionText = Context.MapKeyToText(property.Name + ".Description", "");
                Info.SetPropertyControlValue(property.Name, cipn, descriptionText);
            }

     

  3. Because ControlInfoPropertyNames.Description is used to set the text of the UriProperty allow ControlInfoPropertyNames.Footnote (as used by BooleanProperty).

    Or maybe allow Footnote for all properties (in addition to Description just o be consistent).

    In general I would prefer that .ButtonText sets the text of BooleanProperty and UriProperty and Description would only be used for the description. But it's a little bit late now 😉

     

  4. I'm getting analyzer warnings like the following one. TargetFramework is net6.0-windows and VS is up-to-date. Any idea?


    Warning    CS8032    An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\analyzers\dotnet\cs\System.Text.Json.SourceGeneration.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. 

     

    That's a PropertyBasedEffect plugin.

     

  5. Just to say, in the moment I'm using the above 'feature' to detect the 'DialogResult'.

    I know that's a bad way to do it and I would prefer to get a clean solution for PropertyBasedEffects.

    Maybe a virtual method OnConfigClosed( DialogResult result ) or OnConfigClosed( PropertyBasedEffectConfigToken finalToken, DialogResult result ).

     

    BTW: For Tools Effects I would like to get EffectRenderingSchedule.DoNotRender 😉 Means there should be OnSetRenderInfo but no OnRender

  6. 55 minutes ago, Peter1 said:

    Is it robust against future changes in the PDN contents?

     

    If Rick decides to store more information in the pdn file then the plugin must be adapted (no surprise).

     

    You may also save as .ora that's zip based too.

     

    You can also save as pdn in a watched folder and write a script which reacts on changes to the folder and copies away a zipped file. You can also create diff files this way.

     

  7. 4 hours ago, Rick Brewster said:

    I'll look at this for 4.3.8. It could be super easy to squeeze in, but if there's much risk involved then I'd want to delay it to 4.4 so it could get a full range of testing (alpha, beta, etc.). Sometimes adding a keyboard command means it can be easy for it to overlap with other commands and cause weird behavior or crashes, but that's not always the case.

     

    Please have in mind that there are different keyboard layouts. I's already an issue that ctrl++ is not working on a lot of keyboards.

    Supporting special characters should always be implemented by figuring out which key combination produces the key on the current keyboard layout. That's not so difficult.

     

×
×
  • Create New...