/// <summary>
        /// See interface docs.
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            var result = new ReceiverLocationOptions();
            foreach(var receiverLocation in ReceiverLocations) {
                result.ReceiverLocations.Add((ReceiverLocation)receiverLocation.Clone());
            }
            result.CurrentReceiverId = CurrentReceiverId;

            return result;
        }
Пример #2
0
        /// <summary>
        /// See interface docs.
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            var result = new ReceiverLocationOptions();

            foreach (var receiverLocation in ReceiverLocations)
            {
                result.ReceiverLocations.Add((ReceiverLocation)receiverLocation.Clone());
            }
            result.CurrentReceiverId = CurrentReceiverId;

            return(result);
        }
Пример #3
0
        /// <summary>
        /// Returns true if the object passed in is equal to this one.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            bool result = Object.ReferenceEquals(this, obj);

            if (!result)
            {
                ReceiverLocationOptions other = obj as ReceiverLocationOptions;
                if (other != null)
                {
                    result = other.ReceiverLocations.SequenceEqual(ReceiverLocations) && other.CurrentReceiverId == CurrentReceiverId;
                }
            }

            return(result);
        }
        /// <summary>
        /// Displays the editor for the collection of receiver locations being edited.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="provider"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            var result = value as ReceiverLocationOptions;
            if(result != null) {
                using(var dialog = new ReceiverLocationsView()) {
                    dialog.ReceiverLocations.AddRange(result.ReceiverLocations);
                    dialog.SelectedReceiverLocation = result.CurrentReceiverLocation;
                    if(dialog.ShowDialog() == DialogResult.OK) {
                        result = new ReceiverLocationOptions();
                        result.ReceiverLocations.AddRange(dialog.ReceiverLocations);
                        result.CurrentReceiverLocation = dialog.SelectedReceiverLocation;
                    }
                }
            }

            return result;
        }
Пример #5
0
        /// <summary>
        /// Displays the editor for the collection of receiver locations being edited.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="provider"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            var result = value as ReceiverLocationOptions;

            if (result != null)
            {
                using (var dialog = new ReceiverLocationsView()) {
                    dialog.ReceiverLocations.AddRange(result.ReceiverLocations);
                    dialog.SelectedReceiverLocation = result.CurrentReceiverLocation;
                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        result = new ReceiverLocationOptions();
                        result.ReceiverLocations.AddRange(dialog.ReceiverLocations);
                        result.CurrentReceiverLocation = dialog.SelectedReceiverLocation;
                    }
                }
            }

            return(result);
        }
 /// <summary>
 /// Creates a new object.
 /// </summary>
 public SheetRawFeedOptions()
 {
     ReceiverLocationOptions = new ReceiverLocationOptions();
 }