/// <summary> /// Initializes a new instance of the <see cref="PluginType"/> class. /// </summary> /// <param name="entity"></param> public PluginType(Entity entity, PluginAssembly parentAssembly) { this.origin = entity; this.Id = entity.Id; this.ParentAssembly = parentAssembly; this.FriendlyName = (string)entity.Attributes[Constants.Crm.Attributes.NAME]; }
/// <summary> /// Initializes a new instance of the <see cref="ProcessingStep"/> class. /// </summary> /// <param name="entity"></param> public ProcessingStep(Entity entity, PluginAssembly parentAssembly, PluginType parentType) { this.origin = entity; this.Id = entity.Id; this.ParentAssembly = parentAssembly; this.ParentType = parentType; this.FriendlyName = (string)entity.Attributes[Constants.Crm.Attributes.NAME]; this.StateCode = (StateCode)((OptionSetValue)entity.Attributes[Constants.Crm.Attributes.STATE_CODE]).Value; }
private void Load(XmlDocument document) { var solutions = new List<Solution>(); var assemblies = new List<PluginAssembly>(); this.Solutions = solutions.ToArray(); this.Assemblies = assemblies.ToArray(); foreach (XmlElement element in document.DocumentElement.ChildNodes) { if (element.Name == Constants.Xml.SOLUTIONS) { foreach (XmlElement solution in element.ChildNodes) { try { var item = new Solution { Version = new Version(solution.Attributes[Constants.Xml.VERSION].Value), UniqueName = solution.Attributes[Constants.Xml.UNIQUE_NAME].Value, FriendlyName = solution.Attributes[Constants.Xml.FRIENDLY_NAME].Value }; solutions.Add(item); } catch (NullReferenceException) { // Hiding import errors } } this.Solutions = solutions.ToArray(); } if (element.Name == Constants.Xml.ASSEMBLIES) { foreach (XmlElement assembly in element.ChildNodes) { try { var item = new PluginAssembly() { Version = new Version(assembly.Attributes[Constants.Xml.VERSION].Value), FriendlyName = assembly.Attributes[Constants.Xml.FRIENDLY_NAME].Value, UniqueName = assembly.Attributes[Constants.Xml.UNIQUE_NAME].Value }; assemblies.Add(item); } catch (NullReferenceException) { // Hiding import errors } } this.Assemblies = assemblies.ToArray(); } } }