Skip to content

Commit 100cd9c

Browse files
committed
Partial implementation of Input sub elements; - NWZ
1 parent 2dc60f2 commit 100cd9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1070
-195
lines changed

UI++Editor/(G)UI++.csproj

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@
227227
<Compile Include="Models\Messages.cs" />
228228
<Compile Include="Models\Package.cs" />
229229
<Compile Include="Models\ChoiceList.cs" />
230-
<Compile Include="Models\ChoiceInput.cs" />
230+
<Compile Include="Models\InputChoice.cs" />
231231
<Compile Include="Models\Choice.cs" />
232232
<Compile Include="Models\Check.cs" />
233233
<Compile Include="Models\Case.cs" />
234-
<Compile Include="Models\CheckboxInput.cs" />
234+
<Compile Include="Models\InputCheckbox.cs" />
235235
<Compile Include="Models\SoftwareRef.cs" />
236236
<Compile Include="Models\Variable.cs" />
237237
<Compile Include="Models\Field.cs" />
@@ -244,26 +244,30 @@
244244
<Compile Include="Models\SoftwareListRef.cs" />
245245
<Compile Include="Models\SoftwareSets.cs" />
246246
<Compile Include="Models\Text.cs" />
247-
<Compile Include="Models\TextInput.cs" />
247+
<Compile Include="Models\InputText.cs" />
248248
<Compile Include="Models\UIpp.cs" />
249249
<Compile Include="Models\_Template.cs" />
250250
<Compile Include="Controllers\ConfigMgrScanner.cs" />
251251
<Compile Include="Controllers\XMLToClassModel.cs" />
252252
<Compile Include="Converters\AvailableApplicationsListConverter.cs" />
253253
<Compile Include="Interfaces\IAction.cs" />
254-
<Compile Include="Interfaces\IChoice.cs" />
255254
<Compile Include="Interfaces\IElement.cs" />
256255
<Compile Include="Models\Application.cs" />
257256
<Compile Include="Controllers\BrowserBehavior.cs" />
258257
<Compile Include="Converters\TreeViewLineConverter.cs" />
259258
<Compile Include="EventAggregators\ChangeUI.cs" />
260259
<Compile Include="EventAggregators\SendMessage.cs" />
261-
<Compile Include="Interfaces\IInput.cs" />
262260
<Compile Include="Interfaces\IRootElement.cs" />
263261
<Compile Include="Interfaces\ISoftware.cs" />
264262
<Compile Include="Interfaces\ISoftwareRef.cs" />
265263
<Compile Include="ViewModels\Actions\Children\CaseViewModel.cs" />
266264
<Compile Include="ViewModels\Actions\Children\CheckViewModel.cs" />
265+
<Compile Include="ViewModels\Actions\Children\ChoiceListViewModel.cs" />
266+
<Compile Include="ViewModels\Actions\Children\ChoiceViewModel.cs" />
267+
<Compile Include="ViewModels\Actions\Children\InputCheckboxViewModel.cs" />
268+
<Compile Include="ViewModels\Actions\Children\InputChoiceViewModel.cs" />
269+
<Compile Include="ViewModels\Actions\Children\InputInfoViewModel.cs" />
270+
<Compile Include="ViewModels\Actions\Children\InputTextViewModel.cs" />
267271
<Compile Include="ViewModels\Actions\Children\MatchViewModel.cs" />
268272
<Compile Include="ViewModels\Actions\Children\PropertyViewModel.cs" />
269273
<Compile Include="ViewModels\Actions\Children\SoftwareListRefViewModel.cs" />
@@ -304,10 +308,10 @@
304308
<Compile Include="ViewModels\Menus\StatusMessageViewModel.cs" />
305309
<Compile Include="ViewModels\Preview\AppTreeViewModel.cs" />
306310
<Compile Include="ViewModels\Preview\Children\CheckViewModel.cs" />
307-
<Compile Include="ViewModels\Preview\Children\TextInputViewModel.cs" />
311+
<Compile Include="ViewModels\Preview\Children\InputTextViewModel.cs" />
308312
<Compile Include="ViewModels\Preview\Children\InputInfoViewModel.cs" />
309-
<Compile Include="ViewModels\Preview\Children\ChoiceInputViewModel.cs" />
310-
<Compile Include="ViewModels\Preview\Children\CheckBoxInputViewModel.cs" />
313+
<Compile Include="ViewModels\Preview\Children\InputChoiceViewModel.cs" />
314+
<Compile Include="ViewModels\Preview\Children\InputCheckboxViewModel.cs" />
311315
<Compile Include="ViewModels\Preview\Children\_IChild.cs" />
312316
<Compile Include="ViewModels\Preview\ErrorInfoViewModel.cs" />
313317
<Compile Include="ViewModels\Preview\InfoFullScreenViewModel.cs" />
@@ -317,6 +321,12 @@
317321
<Compile Include="ViewModels\Preview\InfoViewModel.cs" />
318322
<Compile Include="ViewModels\Preview\_IPreview.cs" />
319323
<Compile Include="ViewModels\Preview\_NoPreviewViewModel.cs" />
324+
<Compile Include="Views\Actions\Children\ChoiceListView.xaml.cs">
325+
<DependentUpon>ChoiceListView.xaml</DependentUpon>
326+
</Compile>
327+
<Compile Include="Views\Actions\Children\ChoiceView.xaml.cs">
328+
<DependentUpon>ChoiceView.xaml</DependentUpon>
329+
</Compile>
320330
<Compile Include="Views\Actions\Children\MatchView.xaml.cs">
321331
<DependentUpon>MatchView.xaml</DependentUpon>
322332
</Compile>
@@ -362,11 +372,11 @@
362372
<Compile Include="Views\Actions\AppTreeView.xaml.cs">
363373
<DependentUpon>AppTreeView.xaml</DependentUpon>
364374
</Compile>
365-
<Compile Include="Views\Actions\Children\CheckBoxInputView.xaml.cs">
366-
<DependentUpon>CheckBoxInputView.xaml</DependentUpon>
375+
<Compile Include="Views\Actions\Children\InputCheckboxView.xaml.cs">
376+
<DependentUpon>InputCheckboxView.xaml</DependentUpon>
367377
</Compile>
368-
<Compile Include="Views\Actions\Children\ChoiceInputView.xaml.cs">
369-
<DependentUpon>ChoiceInputView.xaml</DependentUpon>
378+
<Compile Include="Views\Actions\Children\InputChoiceView.xaml.cs">
379+
<DependentUpon>InputChoiceView.xaml</DependentUpon>
370380
</Compile>
371381
<Compile Include="Views\Actions\Children\InputInfoView.xaml.cs">
372382
<DependentUpon>InputInfoView.xaml</DependentUpon>
@@ -389,8 +399,8 @@
389399
<Compile Include="Views\Actions\Children\SwitchCaseView.xaml.cs">
390400
<DependentUpon>SwitchCaseView.xaml</DependentUpon>
391401
</Compile>
392-
<Compile Include="Views\Actions\Children\TextInputView.xaml.cs">
393-
<DependentUpon>TextInputView.xaml</DependentUpon>
402+
<Compile Include="Views\Actions\Children\InputTextView.xaml.cs">
403+
<DependentUpon>InputTextView.xaml</DependentUpon>
394404
</Compile>
395405
<Compile Include="Views\Actions\Children\UserAuthFieldView.xaml.cs">
396406
<DependentUpon>UserAuthFieldView.xaml</DependentUpon>
@@ -464,20 +474,20 @@
464474
<Compile Include="Views\Preview\AppTreeView.xaml.cs">
465475
<DependentUpon>AppTreeView.xaml</DependentUpon>
466476
</Compile>
467-
<Compile Include="Views\Preview\Children\CheckBoxInputView.xaml.cs">
468-
<DependentUpon>CheckBoxInputView.xaml</DependentUpon>
477+
<Compile Include="Views\Preview\Children\InputCheckboxView.xaml.cs">
478+
<DependentUpon>InputCheckboxView.xaml</DependentUpon>
469479
</Compile>
470480
<Compile Include="Views\Preview\Children\CheckView.xaml.cs">
471481
<DependentUpon>CheckView.xaml</DependentUpon>
472482
</Compile>
473-
<Compile Include="Views\Preview\Children\ChoiceInputView.xaml.cs">
474-
<DependentUpon>ChoiceInputView.xaml</DependentUpon>
483+
<Compile Include="Views\Preview\Children\InputChoiceView.xaml.cs">
484+
<DependentUpon>InputChoiceView.xaml</DependentUpon>
475485
</Compile>
476486
<Compile Include="Views\Preview\Children\InputInfoView.xaml.cs">
477487
<DependentUpon>InputInfoView.xaml</DependentUpon>
478488
</Compile>
479-
<Compile Include="Views\Preview\Children\TextInputView.xaml.cs">
480-
<DependentUpon>TextInputView.xaml</DependentUpon>
489+
<Compile Include="Views\Preview\Children\InputTextView.xaml.cs">
490+
<DependentUpon>InputTextView.xaml</DependentUpon>
481491
</Compile>
482492
<Compile Include="Views\Preview\ErrorInfoView.xaml.cs">
483493
<DependentUpon>ErrorInfoView.xaml</DependentUpon>
@@ -549,6 +559,14 @@
549559
<Resource Include="Images\warn.png" />
550560
</ItemGroup>
551561
<ItemGroup>
562+
<Page Include="Views\Actions\Children\ChoiceListView.xaml">
563+
<Generator>MSBuild:Compile</Generator>
564+
<SubType>Designer</SubType>
565+
</Page>
566+
<Page Include="Views\Actions\Children\ChoiceView.xaml">
567+
<Generator>MSBuild:Compile</Generator>
568+
<SubType>Designer</SubType>
569+
</Page>
552570
<Page Include="Views\Actions\Children\MatchView.xaml">
553571
<Generator>MSBuild:Compile</Generator>
554572
<SubType>Designer</SubType>
@@ -609,11 +627,11 @@
609627
<SubType>Designer</SubType>
610628
<Generator>MSBuild:Compile</Generator>
611629
</Page>
612-
<Page Include="Views\Actions\Children\CheckBoxInputView.xaml">
630+
<Page Include="Views\Actions\Children\InputCheckboxView.xaml">
613631
<SubType>Designer</SubType>
614632
<Generator>MSBuild:Compile</Generator>
615633
</Page>
616-
<Page Include="Views\Actions\Children\ChoiceInputView.xaml">
634+
<Page Include="Views\Actions\Children\InputChoiceView.xaml">
617635
<SubType>Designer</SubType>
618636
<Generator>MSBuild:Compile</Generator>
619637
</Page>
@@ -645,7 +663,7 @@
645663
<SubType>Designer</SubType>
646664
<Generator>MSBuild:Compile</Generator>
647665
</Page>
648-
<Page Include="Views\Actions\Children\TextInputView.xaml">
666+
<Page Include="Views\Actions\Children\InputTextView.xaml">
649667
<SubType>Designer</SubType>
650668
<Generator>MSBuild:Compile</Generator>
651669
</Page>
@@ -745,23 +763,23 @@
745763
<SubType>Designer</SubType>
746764
<Generator>MSBuild:Compile</Generator>
747765
</Page>
748-
<Page Include="Views\Preview\Children\CheckBoxInputView.xaml">
766+
<Page Include="Views\Preview\Children\InputCheckboxView.xaml">
749767
<SubType>Designer</SubType>
750768
<Generator>MSBuild:Compile</Generator>
751769
</Page>
752770
<Page Include="Views\Preview\Children\CheckView.xaml">
753771
<SubType>Designer</SubType>
754772
<Generator>MSBuild:Compile</Generator>
755773
</Page>
756-
<Page Include="Views\Preview\Children\ChoiceInputView.xaml">
774+
<Page Include="Views\Preview\Children\InputChoiceView.xaml">
757775
<SubType>Designer</SubType>
758776
<Generator>MSBuild:Compile</Generator>
759777
</Page>
760778
<Page Include="Views\Preview\Children\InputInfoView.xaml">
761779
<SubType>Designer</SubType>
762780
<Generator>MSBuild:Compile</Generator>
763781
</Page>
764-
<Page Include="Views\Preview\Children\TextInputView.xaml">
782+
<Page Include="Views\Preview\Children\InputTextView.xaml">
765783
<SubType>Designer</SubType>
766784
<Generator>MSBuild:Compile</Generator>
767785
</Page>

UI++Editor/Interfaces/IChoice.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

UI++Editor/Interfaces/IInput.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

UI++Editor/Models/ActionClasses/Input.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,22 @@
1010

1111
namespace UI__Editor.Models.ActionClasses
1212
{
13-
public class Input : PropertyChangedBase, IElement, IAction
13+
public class Input : PropertyChangedBase, IElement, IAction, IParentElement
1414
{
1515
public IEventAggregator EventAggregator { get; set; }
1616
public ViewModels.Actions.IAction ViewModel { get; set; }
1717
public IElement Parent { get; set; }
1818
public bool HasSubChildren { get { return true; } }
1919
public string ActionType { get; } = "Input";
20+
public string[] ValidChildren { get; set; } = { "InputCheckbox","InputChoice","InputInfo","InputText" };
2021
public bool? ShowBack { get; set; } = false;
2122
public bool? ShowCancel { get; set; } = false;
2223
public bool? ADValidate { get; set; } = false;
2324
public string Name { get; set; }
2425
public string Size { get; set; } // default is Regular | Regular, Tall
2526
public bool CenterTitle = false;
2627
public string Title { get; set; }
27-
public ObservableCollection<IInput> SubChildren { get; set; }
28+
public ObservableCollection<IChildElement> SubChildren { get; set; }
2829
public string Condition { get; set; }
2930

3031
// Code to handle TreeView Selection
@@ -42,6 +43,7 @@ public Input(IEventAggregator ea)
4243
{
4344
EventAggregator = ea;
4445
ViewModel = new ViewModels.Actions.InputViewModel(this);
46+
SubChildren = new ObservableCollection<IChildElement>();
4547
}
4648

4749
public XmlNode GenerateXML()
@@ -103,7 +105,7 @@ public XmlNode GenerateXML()
103105
output.Attributes.Append(centerTitle);
104106

105107
// Append Children
106-
foreach (IInput input in SubChildren)
108+
foreach (IChildElement input in SubChildren)
107109
{
108110
XmlNode importNode = d.ImportNode(input.GenerateXML(), true);
109111
output.AppendChild(importNode);

UI++Editor/Models/Choice.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,25 @@
1212

1313
namespace UI__Editor.Models
1414
{
15-
public class Choice : PropertyChangedBase, IElement, IChoice
15+
public class Choice : PropertyChangedBase, IElement, IChildElement
1616
{
1717
public ViewModels.Actions.IAction ViewModel { get; set; }
1818
public IElement Parent { get; set; }
1919
public bool HasSubChildren { get { return false; } }
2020
public string ActionType { get { return "Choice"; } }
21+
public string[] ValidParents { get; set; } = { "InputChoice" };
22+
public string[] ValidChildren { get; set; }
2123
public string Option { get; set; } // required
2224
public string Value { get; set; }
2325
public string AlternateValue { get; set; }
2426
public string Condition { get; set; }
2527

28+
public Choice(IElement p)
29+
{
30+
Parent = p;
31+
ViewModel = new ViewModels.Actions.Children.ChoiceViewModel(this);
32+
}
33+
2634
// Code to handle TreeView Selection
2735
private bool _TVSelected = false;
2836
public bool TVSelected

UI++Editor/Models/ChoiceList.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,24 @@
1212

1313
namespace UI__Editor.Models
1414
{
15-
public class ChoiceList : PropertyChangedBase, IElement, IChoice
15+
public class ChoiceList : PropertyChangedBase, IElement, IChildElement
1616
{
1717
public ViewModels.Actions.IAction ViewModel { get; set; }
1818
public IElement Parent { get; set; }
1919
public bool HasSubChildren { get { return false; } }
20-
public string ActionType { get { return "Choice List"; } }
20+
public string ActionType { get { return "ChoiceList"; } }
21+
public string[] ValidParents { get; set; } = { "InputChoice" };
22+
public string[] ValidChildren { get; set; }
2123
public string AlternateValueList { get; set; }
2224
public string OptionList { get; set; }
2325
public string ValueList { get; set; }
26+
public string Condition { get; set; }
27+
28+
public ChoiceList(IElement p)
29+
{
30+
Parent = p;
31+
ViewModel = new ViewModels.Actions.Children.ChoiceListViewModel(this);
32+
}
2433

2534
// Code to handle TreeView Selection
2635
private bool _TVSelected = false;
@@ -41,14 +50,16 @@ public XmlNode GenerateXML()
4150
XmlAttribute optionList = d.CreateAttribute("OptionList");
4251
XmlAttribute valueList = d.CreateAttribute("ValueList");
4352
XmlAttribute alternateValueList = d.CreateAttribute("AlternateValueList");
53+
XmlAttribute condition = d.CreateAttribute("Condition");
4454

4555
// Set Attribute Values
4656
optionList.Value = OptionList;
4757
valueList.Value = ValueList;
4858
alternateValueList.Value = AlternateValueList;
59+
condition.Value = Condition;
4960

5061
// Append Attribute
51-
if(!string.IsNullOrEmpty(OptionList))
62+
if (!string.IsNullOrEmpty(OptionList))
5263
{
5364
output.Attributes.Append(optionList);
5465
}
@@ -60,6 +71,10 @@ public XmlNode GenerateXML()
6071
{
6172
output.Attributes.Append(alternateValueList);
6273
}
74+
if (!string.IsNullOrEmpty(Condition))
75+
{
76+
output.Attributes.Append(condition);
77+
}
6378

6479
return output;
6580
}

0 commit comments

Comments
 (0)