Skip to content

Commit

Permalink
Bug fix when adding new QuerySimple
Browse files Browse the repository at this point in the history
  • Loading branch information
HichemDax committed Aug 21, 2020
1 parent dcf3583 commit 2d90b6b
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 256 deletions.
13 changes: 12 additions & 1 deletion D365FONinjaDevTools/AddItemsToFolder/ElementTypes/QuerySimple.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Microsoft.Dynamics.AX.Metadata.Core.Collections;
using Microsoft.Dynamics.AX.Metadata.MetaModel;

namespace D365FONinjaDevTools.AddItemsToFolder.ElementTypes
Expand All @@ -17,7 +18,17 @@ public override Type GetElementType()

protected override void Create()
{
var element = new AxQuerySimple {Name = ElementName};
var element = new AxQuerySimple
{
Name = ElementName, Methods = new KeyedObjectCollection<AxMethod>()
{
new AxMethod()
{
Name = "classDeclaration",
Source = "[Query]\r\npublic class " + ElementName + " extends QueryRun \r\n{\r\n}",
}
}
};
MetaService.CreateQuery(element, Model);
}
}
Expand Down
238 changes: 0 additions & 238 deletions D365FONinjaDevTools/AddPackageReference/AddPackageReferenceCommand.cs

This file was deleted.

This file was deleted.

5 changes: 3 additions & 2 deletions D365FONinjaDevTools/D365FONinjaDevTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
<Compile Include="AddItemsToFolder\ElementTypes\SecurityRole.cs" />
<Compile Include="AddItemsToFolder\ElementTypes\SsrsReport.cs" />
<Compile Include="AddItemsToFolder\ElementTypes\Table.cs" />
<Compile Include="AddPackageReference\AddPackageReferenceCommand.cs" />
<Compile Include="AddPackageReference\AddPackageReferenceDialog.cs" />
<Compile Include="AddReferencePackages\AddPackageReferenceCommand.cs" />
<Compile Include="AddReferencePackages\AddMissingPackageReferenceCommand.cs" />
<Compile Include="Kernel\AxElementType.cs" />
<Compile Include="AddItemsToFolder\ElementTypes\ElementType.cs" />
<Compile Include="AddItemsToFolder\ElementTypes\Enum.cs" />
Expand All @@ -101,6 +101,7 @@
<Compile Include="AddItemsToFolder\ElementTypes\QuerySimple.cs" />
<Compile Include="AddItemsToFolder\ElementTypes\SecurityDuty.cs" />
<Compile Include="AddItemsToFolder\ElementTypes\SecurityPrivilege.cs" />
<Compile Include="Kernel\ReflectionUtils.cs" />
<Compile Include="LabelIt\LabelItAddIn.cs" />
<Compile Include="Kernel\LocalUtils.cs" />
<Compile Include="IndentCode\Command1.cs" />
Expand Down
1 change: 1 addition & 0 deletions D365FONinjaDevTools/D365FoNinjaDevExtensionsPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ protected override void Initialize()
{
AddItemCommand.Initialize(this);
AddPackageReferenceCommand.Initialize(this);
AddMissingPackageReferenceCommand.Initialize(this);
ExtendElementsCommand.Initialize(this);
NewFolder1.Command1.Initialize(this);
base.Initialize();
Expand Down
15 changes: 15 additions & 0 deletions D365FONinjaDevTools/D365FoNinjaDevExtensionsPackage.vsct
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
<Group guid="guidCommand1PackageCmdSet" id="MyMenuGroup3" priority="0x0100">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PROJNODE" />
</Group>

<Group guid="guidCommand1PackageCmdSet" id="MyMenuGroup4" priority="0x0100">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_ERRORLIST" />
</Group>

</Groups>


Expand Down Expand Up @@ -61,6 +66,14 @@
</Strings>
</Button>

<Button guid="guidCommand1PackageCmdSet" id="cmdIdAddMissingPackageReference" priority="0x0100" type="Button">
<Parent guid="guidCommand1PackageCmdSet" id="MyMenuGroup4" />
<CommandFlag>DynamicVisibility</CommandFlag>
<Strings>
<ButtonText>Add Missing Package...</ButtonText>
</Strings>
</Button>

</Buttons>


Expand Down Expand Up @@ -95,8 +108,10 @@
<IDSymbol name="MyMenuGroup1" value="0x1010" />
<IDSymbol name="MyMenuGroup2" value="300" />
<IDSymbol name="MyMenuGroup3" value="400" />
<IDSymbol name="MyMenuGroup4" value="500" />
<IDSymbol name="cmdidCommand1" value="1025" />
<IDSymbol name="cmdIdAddPackageReference" value="0X0300" />
<IDSymbol name="cmdIdAddMissingPackageReference" value="0X0400" />
</GuidSymbol>

<GuidSymbol name="guidImages" value="{d7fde224-2a28-4562-9926-a6578a13cf0f}">
Expand Down
1 change: 1 addition & 0 deletions D365FONinjaDevTools/Kernel/LocalUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ static LocalUtils()

var metaModelProviders = CoreUtility.ServiceProvider.GetService(typeof(IMetaModelProviders)) as IMetaModelProviders;
MetaService = metaModelProviders?.CurrentMetaModelService;

//ProjectService = CoreUtility.ServiceProvider.GetService(typeof(IDynamicsProjectService)) as IDynamicsProjectService;
ElementService = CoreUtility.ServiceProvider.GetService(typeof(IDisplayElementProvider)) as IDisplayElementProvider;

Expand Down
14 changes: 14 additions & 0 deletions D365FONinjaDevTools/Kernel/ReflectionUtils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace D365FONinjaDevTools.Kernel
{
public class ReflectionUtil
{

}
}

0 comments on commit 2d90b6b

Please sign in to comment.