Skip to content

Commit

Permalink
Restructuring namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Jun 30, 2022
1 parent 175efb2 commit 8d84a02
Show file tree
Hide file tree
Showing 52 changed files with 151 additions and 102 deletions.
2 changes: 1 addition & 1 deletion FXBTests/QueryExpressionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cinteros.Xrm.FetchXmlBuilder.AppCode;
using Cinteros.Xrm.FetchXmlBuilder.Converters;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Xrm.Sdk.Query;

Expand Down
2 changes: 1 addition & 1 deletion FetchXmlBuilder/AppCode/FXBMessageBusArgument.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.Xrm.Sdk.Query;

namespace Cinteros.Xrm.FetchXmlBuilder
namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
{
public class FXBMessageBusArgument
{
Expand Down
2 changes: 1 addition & 1 deletion FetchXmlBuilder/AppCode/HistoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Windows.Forms;

namespace Cinteros.Xrm.FetchXmlBuilder
namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
{
public class HistoryManager
{
Expand Down
15 changes: 5 additions & 10 deletions FetchXmlBuilder/AppCode/ScintillaHelper.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
using System;
using System.Collections.Generic;
using Cinteros.Xrm.FetchXmlBuilder.Settings;
using ScintillaNET;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using Cinteros.Xrm.FetchXmlBuilder.AppCode;
using ScintillaNET;

namespace Cinteros.Xrm.FetchXmlBuilder
namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
{
static class ScintillaHelper
internal static class ScintillaHelper
{
public static void ConfigureForXml(this Scintilla scintilla, FXBSettings settings)
{
Expand Down Expand Up @@ -247,4 +242,4 @@ public static void FormatXML(this Scintilla scintilla, string text, FXBSettings
}
}
}
}
}
2 changes: 1 addition & 1 deletion FetchXmlBuilder/AppCode/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ public static string ProcessURL(string url)
return urib.Uri.ToString();
}
}
}
}
2 changes: 1 addition & 1 deletion FetchXmlBuilder/AppCode/WebAPIMetadataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using MarkMpn.FetchXmlToWebAPI;
using Microsoft.Xrm.Sdk.Metadata;

namespace Cinteros.Xrm.FetchXmlBuilder
namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
{
internal class WebAPIMetadataProvider : IMetadataProvider
{
Expand Down
2 changes: 1 addition & 1 deletion FetchXmlBuilder/Builder/FetchIsAggregateException.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
namespace Cinteros.Xrm.FetchXmlBuilder.Builder
{
internal class FetchIsAggregateException : Exception
{
Expand Down
17 changes: 13 additions & 4 deletions FetchXmlBuilder/Builder/FetchNodeCapabilities.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Cinteros.Xrm.XmlEditorUtils;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Collections.Generic;

namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
namespace Cinteros.Xrm.FetchXmlBuilder.Builder
{
public class FetchNodeCapabilities
{
Expand Down Expand Up @@ -32,22 +30,27 @@ private FetchNodeCapabilities(string name)
Delete = false;
Comment = false;
break;

case "entity":
Multiple = false;
Attributes = true;
break;

case "link-entity":
Attributes = true;
break;

case "all-attributes":
Multiple = false;
break;

case "attribute":
case "order":
case "filter":
case "condition":
case "value":
break;

case "#comment":
Comment = false;
Uncomment = true;
Expand All @@ -65,6 +68,7 @@ private void AddChildren()
ChildTypes.Add(new FetchNodeCapabilities("-"));
ChildTypes.Add(new FetchNodeCapabilities("#comment"));
break;

case "entity":
case "link-entity":
ChildTypes.Add(new FetchNodeCapabilities("-"));
Expand All @@ -76,25 +80,30 @@ private void AddChildren()
ChildTypes.Add(new FetchNodeCapabilities("-"));
ChildTypes.Add(new FetchNodeCapabilities("#comment"));
break;

case "all-attributes":
case "attribute":
case "order":
ChildTypes.Add(new FetchNodeCapabilities("#comment"));
break;

case "filter":
ChildTypes.Add(new FetchNodeCapabilities("condition"));
ChildTypes.Add(new FetchNodeCapabilities("filter"));
ChildTypes.Add(new FetchNodeCapabilities("-"));
ChildTypes.Add(new FetchNodeCapabilities("#comment"));
break;

case "condition":
ChildTypes.Add(new FetchNodeCapabilities("value"));
ChildTypes.Add(new FetchNodeCapabilities("-"));
ChildTypes.Add(new FetchNodeCapabilities("#comment"));
break;

case "value":
ChildTypes.Add(new FetchNodeCapabilities("#comment"));
break;

case "#comment":
break;
}
Expand Down
15 changes: 5 additions & 10 deletions FetchXmlBuilder/Builder/TreeNodeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
using Cinteros.Xrm.FetchXmlBuilder.AppCode;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Linq;

namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
namespace Cinteros.Xrm.FetchXmlBuilder.Builder
{
public static class TreeNodeExtensions
{
Expand All @@ -26,17 +21,17 @@ internal static TreeNode LocalEntityNode(this TreeNode node)
return null;
}
}
return (node.Name.Equals("entity") || node.Name.Equals("link-entity")) ? node : null;
return node.Name.Equals("entity") || node.Name.Equals("link-entity") ? node : null;
}

internal static bool LocalEntityIsRoot(this TreeNode node)
{
return LocalEntityNode(node)?.Name == "entity";
return node.LocalEntityNode()?.Name == "entity";
}

internal static string LocalEntityName(this TreeNode node)
{
return LocalEntityNode(node).Value("name");
return node.LocalEntityNode().Value("name");
}

internal static string Value(this TreeNode node, string key)
Expand Down
16 changes: 12 additions & 4 deletions FetchXmlBuilder/Builder/TreeNodeHelper.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using Cinteros.Xrm.FetchXmlBuilder.Controls;
using Cinteros.Xrm.FetchXmlBuilder.DockControls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Linq;
using Cinteros.Xrm.FetchXmlBuilder.Settings;

namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
namespace Cinteros.Xrm.FetchXmlBuilder.Builder
{
internal class TreeNodeHelper
{
Expand Down Expand Up @@ -83,7 +82,7 @@ public static TreeNode AddTreeViewNode(TreeNode parentnode, TreeNode node, XmlNo
if (node.Text != originalText ||
node.Name != originalName ||
originalAttributes == null ||
String.Join(";", attributes.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Key + "=" + kvp.Value)) != String.Join(";", originalAttributes.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Key + "=" + kvp.Value)))
string.Join(";", attributes.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Key + "=" + kvp.Value)) != string.Join(";", originalAttributes.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Key + "=" + kvp.Value)))
{
node.TreeView.SelectedNode = null;
node.TreeView.SelectedNode = node;
Expand Down Expand Up @@ -146,6 +145,7 @@ public static void SetNodeText(TreeNode node, FetchXmlBuilder fxb, bool validate
text = "fetch";
}
break;

case "entity":
case "link-entity":
text += " " + fxb.GetEntityDisplayName(name);
Expand All @@ -158,6 +158,7 @@ public static void SetNodeText(TreeNode node, FetchXmlBuilder fxb, bool validate
text += " M:M";
}
break;

case "attribute":
if (!string.IsNullOrEmpty(name))
{
Expand Down Expand Up @@ -190,6 +191,7 @@ public static void SetNodeText(TreeNode node, FetchXmlBuilder fxb, bool validate
}
}
break;

case "filter":
var type = node.Value("type");
if (string.IsNullOrEmpty(type))
Expand All @@ -198,6 +200,7 @@ public static void SetNodeText(TreeNode node, FetchXmlBuilder fxb, bool validate
}
text += " " + type;
break;

case "condition":
{
var ent = node.Value("entityname");
Expand Down Expand Up @@ -232,10 +235,12 @@ public static void SetNodeText(TreeNode node, FetchXmlBuilder fxb, bool validate
text += (" " + attr + " " + oper + " " + val).TrimEnd();
}
break;

case "value":
var value = node.Value("#text");
text += " " + value;
break;

case "order":
{
var attr = node.Value("attribute");
Expand All @@ -261,6 +266,7 @@ public static void SetNodeText(TreeNode node, FetchXmlBuilder fxb, bool validate
}
}
break;

case "#comment":
text = node.Value("#comment")
.Trim()
Expand Down Expand Up @@ -313,9 +319,11 @@ private static void SetWarnings(TreeNode node, FetchXmlBuilder fxb)
case ControlValidationLevel.Error:
node.ImageKey = "error";
break;

case ControlValidationLevel.Warning:
node.ImageKey = "warning";
break;

case ControlValidationLevel.Info:
node.ImageKey = "info";
break;
Expand Down
2 changes: 1 addition & 1 deletion FetchXmlBuilder/Builder/Validations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Windows.Forms;

namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
namespace Cinteros.Xrm.FetchXmlBuilder.Builder
{
internal static class Validations
{
Expand Down
3 changes: 2 additions & 1 deletion FetchXmlBuilder/Controls/attributeControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Cinteros.Xrm.FetchXmlBuilder.AppCode;
using Cinteros.Xrm.FetchXmlBuilder.Builder;
using Cinteros.Xrm.FetchXmlBuilder.ControlsClasses;
using Cinteros.Xrm.FetchXmlBuilder.DockControls;
using Microsoft.Xrm.Sdk.Metadata;
using System;
Expand Down
4 changes: 3 additions & 1 deletion FetchXmlBuilder/Controls/conditionControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Cinteros.Xrm.FetchXmlBuilder.AppCode;
using Cinteros.Xrm.FetchXmlBuilder.Builder;
using Cinteros.Xrm.FetchXmlBuilder.ControlsClasses;
using Cinteros.Xrm.FetchXmlBuilder.DockControls;
using Cinteros.Xrm.XmlEditorUtils;
using Microsoft.Xrm.Sdk;
Expand All @@ -10,6 +11,7 @@
using System.Linq;
using System.ServiceModel;
using System.Windows.Forms;
using Cinteros.Xrm.FetchXmlBuilder.Extensions;

namespace Cinteros.Xrm.FetchXmlBuilder.Controls
{
Expand Down
2 changes: 1 addition & 1 deletion FetchXmlBuilder/Controls/entityControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Cinteros.Xrm.FetchXmlBuilder.AppCode;
using Cinteros.Xrm.FetchXmlBuilder.ControlsClasses;
using Cinteros.Xrm.FetchXmlBuilder.DockControls;
using Microsoft.Xrm.Sdk.Metadata;
using System.Collections.Generic;
Expand Down
3 changes: 2 additions & 1 deletion FetchXmlBuilder/Controls/linkEntityControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Cinteros.Xrm.FetchXmlBuilder.AppCode;
using Cinteros.Xrm.FetchXmlBuilder.Builder;
using Cinteros.Xrm.FetchXmlBuilder.ControlsClasses;
using Cinteros.Xrm.FetchXmlBuilder.DockControls;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Metadata;
Expand Down
3 changes: 2 additions & 1 deletion FetchXmlBuilder/Controls/orderControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Cinteros.Xrm.FetchXmlBuilder.AppCode;
using Cinteros.Xrm.FetchXmlBuilder.Builder;
using Cinteros.Xrm.FetchXmlBuilder.ControlsClasses;
using Cinteros.Xrm.FetchXmlBuilder.DockControls;
using Microsoft.Xrm.Sdk.Metadata;
using System.Collections.Generic;
Expand Down
3 changes: 2 additions & 1 deletion FetchXmlBuilder/Controls/valueControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Cinteros.Xrm.FetchXmlBuilder.AppCode;
using Cinteros.Xrm.FetchXmlBuilder.Builder;
using Cinteros.Xrm.FetchXmlBuilder.ControlsClasses;
using Cinteros.Xrm.FetchXmlBuilder.DockControls;
using Microsoft.Xrm.Sdk.Metadata;
using System;
Expand Down
2 changes: 1 addition & 1 deletion FetchXmlBuilder/ControlsClasses/AttributeItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.Xrm.Sdk.Metadata;
using System.Windows.Forms;

namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
namespace Cinteros.Xrm.FetchXmlBuilder.ControlsClasses
{
internal class AttributeItem : IComboBoxItem
{
Expand Down
2 changes: 1 addition & 1 deletion FetchXmlBuilder/ControlsClasses/EntityItem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Cinteros.Xrm.XmlEditorUtils;
using Microsoft.Xrm.Sdk.Metadata;

namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
namespace Cinteros.Xrm.FetchXmlBuilder.ControlsClasses
{
public class EntityItem : IComboBoxItem
{
Expand Down
2 changes: 1 addition & 1 deletion FetchXmlBuilder/ControlsClasses/EntityNameItem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Cinteros.Xrm.XmlEditorUtils;
using Microsoft.Xrm.Sdk.Metadata;

namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
namespace Cinteros.Xrm.FetchXmlBuilder.ControlsClasses
{
public class EntityNameItem : IComboBoxItem
{
Expand Down
4 changes: 2 additions & 2 deletions FetchXmlBuilder/ControlsClasses/EntityNode.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Cinteros.Xrm.FetchXmlBuilder.AppCode;
using Cinteros.Xrm.FetchXmlBuilder.Builder;
using System.Windows.Forms;

namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
namespace Cinteros.Xrm.FetchXmlBuilder.ControlsClasses
{
public class EntityNode
{
Expand Down
3 changes: 1 addition & 2 deletions FetchXmlBuilder/ControlsClasses/EntityRelationship.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Metadata;
using System;
using System.Linq;

namespace Cinteros.Xrm.FetchXmlBuilder.AppCode
namespace Cinteros.Xrm.FetchXmlBuilder.ControlsClasses
{
public class EntityRelationship : IComparable
{
Expand Down
Loading

0 comments on commit 8d84a02

Please sign in to comment.