public virtual bool UpdateValue( PropertyEditorEventArgs e )
        {
            string key;
            string name = e.Name;
            object oldValue = e.OldValue;
            object newValue = e.Value;
            object stringValue = e.StringValue;
            bool _IsDirty = Null.NullBoolean;

            Hashtable settings = (Hashtable)DataSource;
            IDictionaryEnumerator settingsEnumerator = settings.GetEnumerator();
            while (settingsEnumerator.MoveNext())
            {
                key = Convert.ToString(settingsEnumerator.Key);
                //Do we have the item in the Hashtable being changed
                if (key == name)
                {
                    //Set the Value property to the new value
                    if (!(newValue == oldValue))
                    {
                        settings[key] = newValue;
                        _IsDirty = true;
                        break;
                    }
                }
            }

            return _IsDirty;
        }
 protected override void OnDataChanged(EventArgs e)
 {
     var args = new PropertyEditorEventArgs(Name);
     args.Value = TimeZoneInfo.FindSystemTimeZoneById(StringValue);
     args.OldValue = OldStringValue;
     args.StringValue = StringValue;
     base.OnValueChanged(args);
 }
 /// <Summary>
 /// OnDataChanged runs when the PostbackData has changed.  It raises the ValueChanged
 /// Event
 /// </Summary>
 protected override void OnDataChanged( EventArgs e )
 {
     PropertyEditorEventArgs args = new PropertyEditorEventArgs( Name );
     args.Value = StringValue;
     args.OldValue = OldStringValue;
     args.StringValue = StringValue;
     base.OnValueChanged( args );
 }
 protected void ctlSkin_ItemDeleted(object sender, PropertyEditorEventArgs e)
 {
     if (e.Key != null)
     {
         SkinController.DeleteSkin(Convert.ToInt32(e.Key));
     }
     BindSkin();
 }
 protected void ctlSkin_ItemAdded(object sender, PropertyEditorEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.StringValue))
     {
         SkinPackageInfo skin = SkinController.GetSkinByPackageID(PackageID);
         SkinController.AddSkin(skin.SkinPackageID, e.StringValue);
     }
     BindSkin();
 }
        /// <Summary>
        /// OnDataChanged runs when the PostbackData has changed.  It raises the ValueChanged
        /// Event
        /// </Summary>
        protected override void OnDataChanged( EventArgs e )
        {
            int intValue = Convert.ToInt32(Value);
            int intOldValue = Convert.ToInt32(OldValue);

            PropertyEditorEventArgs args = new PropertyEditorEventArgs(Name);
            args.Value = Enum.ToObject(EnumType, intValue);
            args.OldValue = Enum.ToObject(EnumType, intOldValue);

            base.OnValueChanged(args);
        }
        /// <Summary>
        /// OnDataChanged runs when the PostbackData has changed.  It raises the ValueChanged
        /// Event
        /// </Summary>
        protected override void OnDataChanged( EventArgs e )
        {
            string strValue = Convert.ToString(Value);
            string strOldValue = Convert.ToString(OldValue);

            PropertyEditorEventArgs args = new PropertyEditorEventArgs(Name);
            args.Value = this.Page.Server.HtmlEncode(strValue);
            args.OldValue = this.Page.Server.HtmlEncode(strOldValue);
            args.StringValue = this.Page.Server.HtmlEncode(StringValue);

            base.OnValueChanged(args);
        }
        public bool UpdateValue(PropertyEditorEventArgs e)
        {
            string NameDataField = Convert.ToString(FieldNames["Name"]);
            string ValueDataField = Convert.ToString(FieldNames["Value"]);
            PropertyInfo objProperty;
            string PropertyName = "";
            bool changed = e.Changed;
            string name = e.Name;
            object oldValue = e.OldValue;
            object newValue = e.Value;
            object stringValue = e.StringValue;
            bool _IsDirty = Null.NullBoolean;
			
			//Get the Name Property
            objProperty = DataSource.GetType().GetProperty(NameDataField);
            if (objProperty != null)
            {
                PropertyName = Convert.ToString(objProperty.GetValue(DataSource, null));
				//Do we have the item in the IEnumerable Collection being changed
                PropertyName = PropertyName.Replace(" ", "_");
                if (PropertyName == name)
                {
					//Get the Value Property
                    objProperty = DataSource.GetType().GetProperty(ValueDataField);
					
					//Set the Value property to the new value
                    if ((!(ReferenceEquals(newValue, oldValue))) || changed)
                    {
                        if (objProperty.PropertyType.FullName == "System.String")
                        {
                            objProperty.SetValue(DataSource, stringValue, null);
                        }
                        else
                        {
                            objProperty.SetValue(DataSource, newValue, null);
                        }
                        _IsDirty = true;
                    }
                }
            }
            return _IsDirty;
        }
 public bool UpdateValue(PropertyEditorEventArgs e)
 {
     bool changed = e.Changed;
     object oldValue = e.OldValue;
     object newValue = e.Value;
     bool _IsDirty = Null.NullBoolean;
     if (DataSource != null)
     {
         PropertyInfo objProperty = DataSource.GetType().GetProperty(e.Name);
         if (objProperty != null)
         {
             if ((!(ReferenceEquals(newValue, oldValue))) || changed)
             {
                 objProperty.SetValue(DataSource, newValue, null);
                 _IsDirty = true;
             }
         }
     }
     return _IsDirty;
 }
 void OnItemChanged(object sender, PropertyEditorEventArgs e)
 {
     var regionContainer = ControlUtilities.FindControl<Control>(Parent, "Region", true);
     if (regionContainer != null)
     {
         var regionControl = ControlUtilities.FindFirstDescendent<DNNRegionEditControl>(regionContainer);
         if (regionControl != null)
         {
             var listController = new ListController();
             var countries = listController.GetListEntryInfoItems("Country");
             foreach (var checkCountry in countries)
             {
                 if (checkCountry.Text == e.StringValue)
                 {
                     var attributes = new object[1];
                     attributes[0] = new ListAttribute("Region", "Country." + checkCountry.Value, ListBoundField.Text, ListBoundField.Text);
                     regionControl.CustomAttributes = attributes;
                     break;
                 }
             }
         }
     }
 }
        public bool UpdateVisibility(PropertyEditorEventArgs e)
        {
            string nameDataField = Convert.ToString(FieldNames["Name"]);
            string dataField = Convert.ToString(FieldNames["ProfileVisibility"]);
            string name = e.Name;
            object newValue = e.Value;
            bool dirty = Null.NullBoolean;
			
			//Get the Name Property
            PropertyInfo property = DataSource.GetType().GetProperty(nameDataField);
            if (property != null)
            {
                string propertyName = Convert.ToString(property.GetValue(DataSource, null));
				//Do we have the item in the IEnumerable Collection being changed
                propertyName = propertyName.Replace(" ", "_");
                if (propertyName == name)
                {
					//Get the Value Property
                    property = DataSource.GetType().GetProperty(dataField);
					//Set the Value property to the new value
                    property.SetValue(DataSource, newValue, null);
                    dirty = true;
                }
            }
            return dirty;
        }
 public bool UpdateVisibility(PropertyEditorEventArgs e)
 {
     return(false);
 }
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Runs when an Item in the List Is Changed.
 /// </summary>
 /// -----------------------------------------------------------------------------
 protected virtual void ListItemChanged(object sender, PropertyEditorEventArgs e)
 {
     this._itemChanged = true;
 }
Example #14
0
 public virtual bool UpdateVisibility(PropertyEditorEventArgs e)
 {
     return(true);
 }
Example #15
0
 /// <Summary>
 /// OnValueChanged runs when the Value has changed.  It raises the ValueChanged
 /// Event
 /// </Summary>
 protected virtual void OnValueChanged( PropertyEditorEventArgs e )
 {
     if (ValueChangedEvent != null)
     {
         ValueChangedEvent(this, e);
     }
 }
 void ValueChanged(object sender, PropertyEditorEventArgs e)
 {
     UpdateDataSource(Value, e.Value, DataField);
 }
Example #17
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Runs when an item is added to a collection type property
 /// </summary>
 /// <history>
 ///     [cnurse]	02/05/2008	created
 /// </history>
 /// -----------------------------------------------------------------------------
 protected virtual void CollectionItemAdded(object sender, PropertyEditorEventArgs e)
 {
     OnItemAdded(e);
 }
Example #18
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Runs when the Visibility of a Property changes
 /// </summary>
 /// <history>
 ///     [cnurse]	05/05/2006	created
 /// </history>
 /// -----------------------------------------------------------------------------
 protected virtual void VisibilityChanged(object sender, PropertyEditorEventArgs e)
 {
     IsDirty = EditorInfoAdapter.UpdateVisibility(e);
 }
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Runs when an Item in the List Is Changed
 /// </summary>
 /// <history>
 ///     [cnurse]	02/15/2006	created
 /// </history>
 /// -----------------------------------------------------------------------------
 protected virtual void ListItemChanged(object sender, PropertyEditorEventArgs e)
 {
     _itemChanged = true;
 }
		/// <summary>
		/// OnVisibilityChanged runs when the Visibility has changed.  It raises the VisibilityChanged
		/// Event
		/// </summary>
		/// <history>
		///     [cnurse]	05/03/2006	created
		/// </history>
		protected virtual void OnVisibilityChanged(PropertyEditorEventArgs e)
		{
			if (VisibilityChanged != null)
			{
				VisibilityChanged(this, e);
			}
		}
		/// <summary>
		/// RaisePostDataChangedEvent runs when the PostBackData has changed.  It triggers
		/// a ValueChanged Event
		/// </summary>
		/// <history>
		///     [cnurse]	05/03/2006	created
		/// </history>
		public void RaisePostDataChangedEvent()
		{
			//Raise the VisibilityChanged Event
		    var args = new PropertyEditorEventArgs(Name) {Value = Value};
		    OnVisibilityChanged(args);
		}
 /// <Summary>Runs when the Value of a Property changes</Summary>
 protected virtual void ValueChanged( object sender, PropertyEditorEventArgs e )
 {
     this._IsDirty = this.EditorInfoAdapter.UpdateValue( e );
 }
 protected override void OnDataChanged(EventArgs e)
 {
     var strValue = RemoveBaseTags(Convert.ToString(Value));
     var strOldValue = RemoveBaseTags(Convert.ToString(OldValue));
     var args = new PropertyEditorEventArgs(Name) { Value = Page.Server.HtmlEncode(strValue), OldValue = Page.Server.HtmlEncode(strOldValue), StringValue = Page.Server.HtmlEncode(RemoveBaseTags(StringValue)) };
     base.OnValueChanged(args);
 }
Example #24
0
        private PropertyEditorEventArgs GetEventArgs()
        {
            var args = new PropertyEditorEventArgs(Name);
            if (ValueField == ListBoundField.Id)
            {
				//This is an Integer Value
                args.Value = IntegerValue;
                args.OldValue = OldIntegerValue;
            }
            else
            {
				//This is a String Value
                args.Value = StringValue;
                args.OldValue = OldStringValue;
            }
            args.StringValue = StringValue;
            return args;
        }
		/// -----------------------------------------------------------------------------
		/// <summary>
		/// Runs when an Item in the List Is Changed
		/// </summary>
		/// <remarks>Raises an ItemChanged event.</remarks>
		/// <history>
		///     [cnurse]	05/05/2006	created
		/// </history>
		/// -----------------------------------------------------------------------------
		protected virtual void ListItemChanged(object sender, PropertyEditorEventArgs e)
		{
			if (ItemChanged != null)
			{
				ItemChanged(this, e);
			}
		}
        public virtual bool UpdateVisibility( PropertyEditorEventArgs e )
        {
            string NameDataField = Convert.ToString(FieldNames["Name"]);
            string VisibilityDataField = Convert.ToString(FieldNames["Visibility"]);
            PropertyInfo objProperty;
            string PropertyName = "";
            string name = e.Name;
            object newValue = e.Value;
            bool _IsDirty = Null.NullBoolean;

            //Get the Name Property
            objProperty = DataSource.GetType().GetProperty(NameDataField);
            if (objProperty != null)
            {
                PropertyName = Convert.ToString(objProperty.GetValue(DataSource, null));

                //Do we have the item in the IEnumerable Collection being changed
                if (PropertyName == name)
                {
                    //Get the Visibility Property
                    objProperty = DataSource.GetType().GetProperty(VisibilityDataField);

                    //Set the Visibility property to the new value
                    objProperty.SetValue(DataSource, newValue, null);
                    _IsDirty = true;
                }
            }

            return _IsDirty;
        }
		/// -----------------------------------------------------------------------------
		/// <summary>
		/// Runs when an item is removed from a collection type property
		/// </summary>
		/// <history>
		///     [cnurse]	02/05/2008	created
		/// </history>
		/// -----------------------------------------------------------------------------
		protected virtual void OnItemDeleted(PropertyEditorEventArgs e)
		{
			if (ItemDeleted != null)
			{
				ItemDeleted(this, e);
			}
		}
        public virtual bool UpdateValue( PropertyEditorEventArgs e )
        {
            object oldValue = e.OldValue;
            object newValue = e.Value;
            bool _IsDirty = Null.NullBoolean;

            //Update the DataSource
            if (DataSource != null)
            {
                PropertyInfo objProperty = DataSource.GetType().GetProperty(e.Name);
                if (objProperty != null)
                {
                    if (!(newValue == oldValue))
                    {
                        objProperty.SetValue(DataSource, newValue, null);
                        _IsDirty = true;
                    }
                }
            }

            return _IsDirty;
        }
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// OnDataChanged runs when the PostbackData has changed.  It raises the ValueChanged
 /// Event
 /// </summary>
 /// <history>
 ///     [cnurse]	02/05/2008	created
 /// </history>
 /// -----------------------------------------------------------------------------
 protected override void OnDataChanged(EventArgs e)
 {
     var args = new PropertyEditorEventArgs(Name);
     args.Value = DictionaryValue;
     args.OldValue = OldDictionaryValue;
     args.StringValue = "";
     args.Changed = true;
     base.OnValueChanged(args);
 }
		/// <summary>
		/// OnDataChanged is called by the PostBack Handler when the Data has changed
		/// </summary>
		/// <param name="e">An EventArgs object</param>
		protected override void OnDataChanged(EventArgs e)
		{
			var args = new PropertyEditorEventArgs(Name);
			args.Value = DateValue;
			args.OldValue = OldDateValue;
			args.StringValue = DateValue.ToString(CultureInfo.InvariantCulture);
			base.OnValueChanged(args);
		}
 public virtual bool UpdateVisibility( PropertyEditorEventArgs e )
 {
     bool _IsDirty = Null.NullBoolean;
     return _IsDirty;
 }
		/// -----------------------------------------------------------------------------
		/// <summary>
		/// Runs when an item is removed from a collection type property
		/// </summary>
		/// <history>
		///     [cnurse]	02/05/2008	created
		/// </history>
		/// -----------------------------------------------------------------------------
		protected virtual void CollectionItemDeleted(object sender, PropertyEditorEventArgs e)
		{
			OnItemDeleted(e);
		}
Example #33
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Runs when an item is removed from a collection type property.
 /// </summary>
 /// -----------------------------------------------------------------------------
 protected virtual void CollectionItemDeleted(object sender, PropertyEditorEventArgs e)
 {
     this.OnItemDeleted(e);
 }
		/// -----------------------------------------------------------------------------
		/// <summary>
		/// Runs when the Visibility of a Property changes
		/// </summary>
		/// <history>
		///     [cnurse]	05/05/2006	created
		/// </history>
		/// -----------------------------------------------------------------------------
		protected virtual void VisibilityChanged(object sender, PropertyEditorEventArgs e)
		{
			IsDirty = EditorInfoAdapter.UpdateVisibility(e);
		}
Example #35
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Runs when the Value of a Property changes.
 /// </summary>
 /// -----------------------------------------------------------------------------
 protected virtual void ValueChanged(object sender, PropertyEditorEventArgs e)
 {
     this.IsDirty = this.EditorInfoAdapter.UpdateValue(e);
 }
 public bool UpdateVisibility(PropertyEditorEventArgs e)
 {
     return false;
 }
 /// <Summary>OnItemChanged runs when the Item has changed</Summary>
 protected virtual void OnItemChanged( PropertyEditorEventArgs e )
 {
     if (ItemChangedEvent != null)
     {
         ItemChangedEvent(this, e);
     }
 }