Example #1
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
 /// <exception cref="System.ArgumentNullException">if <paramref name="obj"/> is null</exception>
 public int GetHashCode(NodeDescriptorBase obj)
 {
     if (obj == null)
     {
         throw new ArgumentNullException(nameof(obj));
     }
     return(obj.GetHashCode());
 }
Example #2
0
        internal static NodeDescriptorBase Clone(INodeDescriptor descriptor)
        {
            NodeDescriptorBase _ret = new NodeDescriptorBase()
            {
                BindingDescription  = descriptor.BindingDescription,
                DataType            = descriptor.DataType,
                InstanceDeclaration = descriptor.InstanceDeclaration,
                NodeClass           = descriptor.NodeClass,
                NodeIdentifier      = descriptor.NodeIdentifier
            };

            return(_ret);
        }
Example #3
0
        /// <summary>
        /// Gets the instance to be used by a user to configure the selected node.
        /// </summary>
        /// <param name="descriptor">Provides identifying description of the node to be configured.</param>
        /// <returns>Returned object provides access to the instance node configuration edition functionality.</returns>
        /// <exception cref="ArgumentNullException"></exception>
        public override IInstanceConfiguration GetInstanceConfiguration(INodeDescriptor descriptor)
        {
            if (descriptor == null)
            {
                throw new ArgumentNullException(nameof(descriptor));
            }
            if (CurrentConfiguration == null)
            {
                return(null);
            }
            NodeDescriptorBase _nd = NodeDescriptorBase.Clone(descriptor);

            return(InstanceConfigurationFactory.GetIInstanceConfiguration(CurrentConfiguration.GetInstanceConfiguration(_nd), CurrentConfiguration.GetMessageHandlers(), TraceSource.TraceData, () => this.RaiseOnChangeEvent()));
        }
Example #4
0
        /// <summary>
        /// Determines whether the specified <see cref="System.Object" /> is equal to this instance.
        /// </summary>
        /// <param name="obj">The object to compare with the current object.</param>
        /// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
        /// <exception cref="ArgumentException"></exception>
        public override bool Equals(object obj)
        {
            if (Object.Equals(obj, null))
            {
                return(false);
            }
            NodeDescriptorBase _other = obj as NodeDescriptorBase;

            if (Object.Equals(_other, null))
            {
                return(false);
            }
            return(CompareTo(_other) == 0);
        }
Example #5
0
 /// <summary>
 /// Determines whether the specified objects are equal.
 /// </summary>
 /// <param name="x">The first object of type <see cref="NodeDescriptorBase"/> to compare.</param>
 /// <param name="y">The second object of type <see cref="NodeDescriptorBase"/> to compare.</param>
 /// <returns><c>true</c> if the specified objects are equal; otherwise, false.</returns>
 public bool Equals(NodeDescriptorBase x, NodeDescriptorBase y)
 {
     return(x.CompareTo(y) == 0);
 }