Skip to content

Commit 1b3bdad

Browse files
committed
Fix for PCL.
1 parent 4d77550 commit 1b3bdad

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

xFunc.Maths/Expressions/Collections/FunctionCollection.cs

+8
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args
9090
public new void Add(UserFunction key, IExpression value)
9191
{
9292
base.Add(key, value);
93+
#if PORTABLE
94+
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, key, Count - 1));
95+
#else
9396
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, key));
97+
#endif
9498
}
9599

96100
/// <summary>
@@ -100,7 +104,11 @@ protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args
100104
public new void Remove(UserFunction key)
101105
{
102106
if (base.Remove(key))
107+
#if PORTABLE
108+
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, key, Count));
109+
#else
103110
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, key));
111+
#endif
104112
}
105113

106114
/// <summary>

xFunc.Maths/Expressions/Collections/ParameterCollection.cs

+8
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,11 @@ public void Add(Parameter param)
220220
throw new ArgumentException(Resource.ConstError);
221221

222222
collection.Add(param);
223+
#if PORTABLE
224+
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, param, collection.Count - 1));
225+
#else
223226
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, param));
227+
#endif
224228
}
225229

226230
/// <summary>
@@ -256,7 +260,11 @@ public void Remove(Parameter param)
256260
throw new ArgumentException(Resource.ConstError);
257261

258262
collection.Remove(param);
263+
#if PORTABLE
264+
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, param, collection.Count));
265+
#else
259266
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, param));
267+
#endif
260268
}
261269

262270
/// <summary>

xFunc.Maths/Parser.cs

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public Parser()
4747
/// Initializes a new instance of the <see cref="Parser" /> class.
4848
/// </summary>
4949
/// <param name="lexer">The lexer.</param>
50-
/// <param name="simplifier">The simplifier.</param>
5150
/// <param name="factory">The factory.</param>
5251
public Parser(ILexer lexer, IExpressionFactory factory)
5352
{

xFunc.Maths/xFunc.Maths (Portable).csproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<RootNamespace>xFunc.Maths</RootNamespace>
1212
<AssemblyName>xFunc.Maths</AssemblyName>
1313
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14-
<TargetFrameworkProfile>Profile328</TargetFrameworkProfile>
14+
<TargetFrameworkProfile>Profile158</TargetFrameworkProfile>
1515
<FileAlignment>512</FileAlignment>
1616
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1717
<FileUpgradeFlags>
@@ -94,6 +94,7 @@
9494
<Compile Include="Expressions\AngleMeasurement.cs" />
9595
<Compile Include="Expressions\Define.cs" />
9696
<Compile Include="Expressions\BinaryExpression.cs" />
97+
<Compile Include="Expressions\Lb.cs" />
9798
<Compile Include="Expressions\LogicalAndBitwise\And.cs" />
9899
<Compile Include="Expressions\LogicalAndBitwise\Not.cs" />
99100
<Compile Include="Expressions\LogicalAndBitwise\Or.cs" />
@@ -183,8 +184,10 @@
183184
<Compile Include="Expressions\Undefine.cs" />
184185
<Compile Include="Expressions\UserFunction.cs" />
185186
<Compile Include="Expressions\Variable.cs" />
187+
<Compile Include="Helpers.cs" />
186188
<Compile Include="IDifferentiator.cs" />
187189
<Compile Include="ILexer.cs" />
190+
<Compile Include="IParser.cs" />
188191
<Compile Include="ISimplifier.cs" />
189192
<Compile Include="Differentiator.cs" />
190193
<Compile Include="MathExtentions.cs" />

0 commit comments

Comments
 (0)