Skip to content

Commit

Permalink
UX improvement 2
Browse files Browse the repository at this point in the history
  • Loading branch information
NizamLZ committed May 10, 2017
1 parent ff854c9 commit 2e117a8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
2 changes: 2 additions & 0 deletions ANAConversationStudio/Models/Chat/BaseContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public string SectionText
public class TitleCaptionSectionContent : SectionContent
{
private string _Title;
[Category("Important")]
public string Title
{
get { return _Title; }
Expand All @@ -126,6 +127,7 @@ public string Title
}

private string _Caption;
[Category("Important")]
public string Caption
{
get { return _Caption; }
Expand Down
36 changes: 20 additions & 16 deletions ANAConversationStudio/Models/Chat/ChatNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public ChatNode()
#region Important
private string _Name;
[Category("Important")]
[PropertyOrder(1)]
public string Name
{
get { return _Name; }
Expand All @@ -37,9 +38,26 @@ public string Name
}
}

private NodeTypeEnum _NodeType = NodeTypeEnum.Combination;
[Category("Important")]
[PropertyOrder(2)]
public NodeTypeEnum NodeType
{
get { return _NodeType; }
set
{
if (_NodeType != value)
{
_NodeType = value;
OnPropertyChanged();
}
}
}

private ObservableCollection<Section> _Sections = new ObservableCollection<Section>();
[NewItemTypes(typeof(TextSection), typeof(GifSection), typeof(ImageSection), typeof(GraphSection), typeof(AudioSection), typeof(VideoSection))]
[Category("Important")]
[PropertyOrder(3)]
[Editor(typeof(ChatNodeCollectionEditor<Section>), typeof(ChatNodeCollectionEditor<Section>))]
public ObservableCollection<Section> Sections
{
Expand All @@ -57,6 +75,7 @@ public ObservableCollection<Section> Sections
private ObservableCollection<Button> _Buttons = new ObservableCollection<Button>();
[Category("Important")]
[Editor(typeof(ChatNodeCollectionEditor<Button>), typeof(ChatNodeCollectionEditor<Button>))]
[PropertyOrder(4)]
public ObservableCollection<Button> Buttons
{
get { return _Buttons; }
Expand All @@ -70,20 +89,7 @@ public ObservableCollection<Button> Buttons
}
}

private NodeTypeEnum _NodeType = NodeTypeEnum.Combination;
[Category("Important")]
public NodeTypeEnum NodeType
{
get { return _NodeType; }
set
{
if (_NodeType != value)
{
_NodeType = value;
OnPropertyChanged();
}
}
}

#endregion

#region Misc
Expand Down Expand Up @@ -167,8 +173,6 @@ public ObservableCollection<string> RequiredVariables

private ApiMethodEnum? _ApiMethod;
[Category("For NodeType ApiCall")]
//[JsonConverter(typeof(StringEnumConverter))]
//[BsonRepresentation(BsonType.String)]
public ApiMethodEnum? ApiMethod
{
get { return _ApiMethod; }
Expand Down
4 changes: 2 additions & 2 deletions ANAConversationStudio/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.11.0.0")]
[assembly: AssemblyFileVersion("3.11.0.0")]
[assembly: AssemblyVersion("3.12.0.0")]
[assembly: AssemblyFileVersion("3.12.0.0")]
6 changes: 3 additions & 3 deletions ANAConversationStudio/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,10 @@ public void LoadNodesFromDB()

var start = new Point(100, 60);
var allChatNodes = MongoHelper.Current.ChatNodes;
var unuqueChatNodes = allChatNodes.GroupBy(x => x.Id).SelectMany(x => x).OrderByDescending(x => x.IsStartNode).ToList();
var uniqueChatNodes = allChatNodes.GroupBy(x => x.Id).SelectMany(x => x).OrderByDescending(x => x.IsStartNode).ToList();

var nodeVMs = unuqueChatNodes.Select(x => new NodeViewModel(x, MongoHelper.Current.GetPointForNode(x.Id) ?? new Point(start.X, start.Y += 100))).ToList(); //Dont remove .ToList()
this.Network.Nodes.AddRange(nodeVMs); //Add all nodes before adding any connections
var nodeVMs = uniqueChatNodes.Select(x => new NodeViewModel(x, MongoHelper.Current.GetPointForNode(x.Id) ?? new Point(start.X, start.Y += 100))).ToList(); //Dont remove .ToList()
this.Network.Nodes.AddRange(nodeVMs); //Add all nodes before adding any connections

foreach (var node in nodeVMs)
{
Expand Down

0 comments on commit 2e117a8

Please sign in to comment.