Exemple #1
0
 private static void MigrateValue(
     [NotNull] IContextBoundSettingsStore store,
     [NotNull] Expression <Func <IdentifierTooltipSettings, AnnotationsDisplayKind> > oldSettingExpr,
     [NotNull] Expression <Func <IdentifierTooltipSettings, AttributesDisplayKind> > newSettingExpr)
 {
     if (!store.IsEntryEqualToDefault(oldSettingExpr) && store.IsEntryEqualToDefault(newSettingExpr))
     {
         AnnotationsDisplayKind annotationsDisplayKind = store.GetValue(oldSettingExpr);
         store.SetValue(newSettingExpr, annotationsDisplayKind.ToAttributesDisplayKind());
     }
 }
 private static void MigrateValue <TDisplayKind>(
     IContextBoundSettingsStore store,
     Expression <Func <IdentifierTooltipSettings, bool> > oldSettingExpr,
     Expression <Func <IdentifierTooltipSettings, TDisplayKind> > newSettingExpr,
     TDisplayKind trueValue,
     TDisplayKind falseValue)
     where TDisplayKind : struct
 {
     if (!store.IsEntryEqualToDefault(oldSettingExpr) && store.IsEntryEqualToDefault(newSettingExpr))
     {
         TDisplayKind displayKind = store.GetValue(oldSettingExpr) ? trueValue : falseValue;
         store.SetValue(newSettingExpr, displayKind);
     }
 }