示例#1
0
        public override bool ApplyChanges(ISupportsEditing editableObject, SupportedEditingActions actions)
        {
            if (base.ApplyChanges(editableObject, actions))
            {
                XmlConfiguration configuration = editableObject as XmlConfiguration;
                if (configuration != null)
                {
                    if (_isBeingEdited)
                    {
                        this.BeginInit();
                    }

                    if (_categories != null)
                    {
                        _categories.ApplyChanges((ISupportsEditing)configuration.Categories, actions);
                    }

                    if (_isBeingEdited)
                    {
                        this.EndInit();
                    }
                }
                return(true);
            }
            return(false);
        }
示例#2
0
        public virtual bool ApplyChanges(ISupportsEditing editableObject, Carbon.Configuration.SupportedEditingActions actions)
        {
            if (actions == SupportedEditingActions.None)
            {
                return(true);
            }

            XmlConfigurationElement element = editableObject as XmlConfigurationElement;

            if (element != null)
            {
                /// do we match in full paths?
                if (string.Compare(this.Fullpath, element.Fullpath, true) == 0)
                {
                    /// does the element have changes, if not we don't need to bother
                    if (element.HasChanges)
                    {
                        /// yes so apply it's changed features
                        this.ElementName = element.ElementName;
                        this.Description = element.Description;
                        this.Category    = element.Category;
                        this.DisplayName = element.DisplayName;
                        this.Hidden      = element.Hidden;
                        this.Readonly    = element.Readonly;
                        this.Persistent  = element.Persistent;
                    }
                    return(true);
                }
            }


            return(false);
        }
//		protected override XmlConfigurationElement GetElementToEdit()
//		{
//			XmlConfigurationCategory category = (XmlConfigurationCategory)this.Clone();
//			category.Parent = this.Parent;
//			return (XmlConfigurationElement)category;
//		}

        public override bool ApplyChanges(ISupportsEditing editableObject, SupportedEditingActions actions)
        {
            if (base.ApplyChanges(editableObject, actions))
            {
                XmlConfigurationCategory category = editableObject as XmlConfigurationCategory;
                if (category != null)
                {
                    if (_categories != null)
                    {
                        _categories.ApplyChanges((ISupportsEditing)category.Categories, actions);
                    }
                }
                return(true);
            }
            return(false);
        }
示例#4
0
 public override bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
 {
     if (base.ApplyToSelf(editableObject, actions))
     {
         XmlConfigurationOption option = editableObject as XmlConfigurationOption;
         if (option != null)
         {
             if (option.HasChanges)
             {
                 this.Value = option.Value;
                 this.ValueAssemblyQualifiedName  = option.ValueAssemblyQualifiedName;
                 this.EditorAssemblyQualifiedName = option.EditorAssemblyQualifiedName;
             }
         }
         return(true);
     }
     return(false);
 }
示例#5
0
        public override bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
        {
            if (base.ApplyToSelf(editableObject, actions))
            {
                XmlConfiguration configuration = editableObject as XmlConfiguration;
                if (configuration != null)
                {
                    if (_categories != null)
                    {
                        _categories.ApplyToSelf((ISupportsEditing)configuration.Categories, actions);
                    }
                }
                return(true);
            }

            this.ItIsNowTimeToSave();

            return(false);
        }
        public bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
        {
            XmlConfigurationOptionCollection options = editableObject as XmlConfigurationOptionCollection;

            if (options != null)
            {
                foreach (XmlConfigurationOption option in options)
                {
                    XmlConfigurationOption myOption = this[option.ElementName];
                    if (myOption != null)
                    {
                        try
                        {
                            myOption.ApplyToSelf((ISupportsEditing)option, actions);
                        }
                        catch (System.Exception systemException)
                        {
                            System.Diagnostics.Trace.WriteLine(systemException);
                        }
                    }
                }
            }
            return(true);
        }
示例#7
0
        public bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
        {
            XmlConfigurationCategoryCollection categories = editableObject as XmlConfigurationCategoryCollection;

            if (categories != null)
            {
                foreach (XmlConfigurationCategory category in categories)
                {
                    XmlConfigurationCategory myCategory = this[category.ElementName];
                    if (myCategory != null)
                    {
                        try
                        {
                            myCategory.ApplyToSelf((ISupportsEditing)category, actions);
                        }
                        catch (System.Exception systemException)
                        {
                            System.Diagnostics.Trace.WriteLine(systemException);
                        }
                    }
                }
            }
            return(true);
        }
示例#8
0
        public virtual bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
        {
            XmlConfigurationElement element = editableObject as XmlConfigurationElement;

            if (element != null)
            {
                // if this fullpath matches the element's full path, then these may apply to each other
                if (string.Compare(this.Fullpath, element.Fullpath, true) == 0)
                {
                    if (element.HasChanges)
                    {
                        this.ElementName = element.ElementName;
                        this.Description = element.Description;
                        this.Category    = element.Category;
                        this.DisplayName = element.DisplayName;
                        this.Hidden      = element.Hidden;
                        this.Readonly    = element.Readonly;
                        this.Persistent  = element.Persistent;
                    }
                    return(true);
                }
            }
            return(false);
        }
        public bool ApplyChanges(ISupportsEditing editableObject, Carbon.Configuration.SupportedEditingActions actions)
        {
            XmlConfigurationCategoryCollection categories = editableObject as XmlConfigurationCategoryCollection;

            if (categories != null)
            {
                foreach (XmlConfigurationCategory category in categories)
                {
                    XmlConfigurationCategory myCategory = this[category.ElementName];
                    if (myCategory != null)
                    {
                        try
                        {
                            myCategory.ApplyChanges((ISupportsEditing)category, actions);
                        }
                        catch (Exception ex)
                        {
                            Debug.WriteLine(ex);
                        }
                    }
                }
            }
            return(true);
        }
示例#10
0
        public bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
        {
            XmlConfigurationOptionCollection options = editableObject as XmlConfigurationOptionCollection;

            if (options != null)
            {
                foreach (XmlConfigurationOption option in options)
                {
                    XmlConfigurationOption myOption = this[option.ElementName];
                    if (myOption != null)
                    {
                        try
                        {
                            myOption.ApplyToSelf((ISupportsEditing)option, actions);
                        }
                        catch (Exception ex)
                        {
                            Debug.WriteLine(ex);
                        }
                    }
                }
            }
            return(true);
        }
		public bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
		{
			XmlConfigurationOptionCollection options = editableObject as XmlConfigurationOptionCollection;
			if (options != null)
			{	
				foreach(XmlConfigurationOption option in options)
				{					
					XmlConfigurationOption myOption = this[option.ElementName];
					if (myOption != null)
					{
						try
						{
							myOption.ApplyToSelf((ISupportsEditing)option, actions);
						}
						catch(System.Exception systemException)
						{
							System.Diagnostics.Trace.WriteLine(systemException);
						}
					}
				}
			}
			return true;
		}
		public override bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
		{
			if (base.ApplyToSelf(editableObject, actions))
			{
				XmlConfigurationCategory category = editableObject as XmlConfigurationCategory;			
				if (category != null)
				{
					if (_options != null)
						_options.ApplyToSelf((ISupportsEditing)category.Options, actions);					

					if (_categories != null)
						_categories.ApplyToSelf((ISupportsEditing)category.Categories, actions);
				}
				return true;
			}
			return false;
		}	
		public override bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
		{
			if (base.ApplyToSelf(editableObject, actions))
			{
				XmlConfiguration configuration = editableObject as XmlConfiguration;			
				if (configuration != null)
				{																				
					if (_categories != null)
						_categories.ApplyToSelf((ISupportsEditing)configuration.Categories, actions);
				}
				return true;
			}

			this.ItIsNowTimeToSave();

			return false;
		}
		public bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
		{
			XmlConfigurationCategoryCollection categories = editableObject as XmlConfigurationCategoryCollection;
			if (categories != null)
			{	
				foreach(XmlConfigurationCategory category in categories)
				{					
					XmlConfigurationCategory myCategory = this[category.ElementName];
					if (myCategory != null)
					{
						try
						{
							myCategory.ApplyToSelf((ISupportsEditing)category, actions);
						}
						catch(Exception ex)
						{
							Debug.WriteLine(ex);
						}
					}
				}

			}
			return true;
		}
		public bool ApplyChanges(ISupportsEditing editableObject, Razor.Configuration.SupportedEditingActions actions)
		{
			XmlConfigurationCategoryCollection categories = editableObject as XmlConfigurationCategoryCollection;
			if (categories != null)
			{					
				foreach(XmlConfigurationCategory category in categories)
				{					
					XmlConfigurationCategory myCategory = this[category.ElementName];
					if (myCategory != null)
					{
						try
						{
							myCategory.ApplyChanges((ISupportsEditing)category, actions);
						}
						catch(System.Exception systemException)
						{
							System.Diagnostics.Trace.WriteLine(systemException);
						}
					}
				}

			}
			return true;
		}
		public override bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
		{			
			if (base.ApplyToSelf(editableObject, actions))
			{
				XmlConfigurationOption option = editableObject as XmlConfigurationOption;			
				if (option != null)
				{				
					if (option.HasChanges)
					{
						this.Value = option.Value;
						this.ValueAssemblyQualifiedName = option.ValueAssemblyQualifiedName;
						this.EditorAssemblyQualifiedName = option.EditorAssemblyQualifiedName;
					}
				}
				return true;
			}
			return false;			
		}
		public bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
		{
			XmlConfigurationOptionCollection options = editableObject as XmlConfigurationOptionCollection;
			if (options != null)
			{	
				foreach(XmlConfigurationOption option in options)
				{					
					XmlConfigurationOption myOption = this[option.ElementName];
					if (myOption != null)
					{
						try
						{
							myOption.ApplyToSelf((ISupportsEditing)option, actions);
						}
						catch(Exception ex)
						{
							Debug.WriteLine(ex);
						}
					}
				}
			}
			return true;
		}
		public virtual bool ApplyChanges(ISupportsEditing editableObject, Carbon.Configuration.SupportedEditingActions actions)
		{
			if (actions == SupportedEditingActions.None)
				return true;

			XmlConfigurationElement element = editableObject as XmlConfigurationElement;			
			if (element != null)
			{
				/// do we match in full paths?
				if (string.Compare(this.Fullpath, element.Fullpath, true) == 0)
				{
					/// does the element have changes, if not we don't need to bother
					if (element.HasChanges)
					{				
						/// yes so apply it's changed features
						this.ElementName = element.ElementName;
						this.Description = element.Description;
						this.Category = element.Category;
						this.DisplayName = element.DisplayName;
						this.Hidden = element.Hidden;
						this.Readonly = element.Readonly;
						this.Persistent = element.Persistent;
					}
					return true;
				}
			}


			return false;
		}
		public virtual bool ApplyToSelf(ISupportsEditing editableObject, SupportedEditingActions actions)
		{
			XmlConfigurationElement element = editableObject as XmlConfigurationElement;			
			if (element != null)
			{
				// if this fullpath matches the element's full path, then these may apply to each other
				if (string.Compare(this.Fullpath, element.Fullpath, true) == 0)
				{
					if (element.HasChanges)
					{
						this.ElementName = element.ElementName;
						this.Description = element.Description;
						this.Category = element.Category;
						this.DisplayName = element.DisplayName;
						this.Hidden = element.Hidden;
						this.Readonly = element.Readonly;
						this.Persistent = element.Persistent;
					}
					return true;
				}
			}
			return false;
		}
		public override bool ApplyChanges(ISupportsEditing editableObject, SupportedEditingActions actions)
		{
			if (base.ApplyChanges (editableObject, actions))
			{
				XmlConfiguration configuration = editableObject as XmlConfiguration;			
				if (configuration != null)
				{
					if (_isBeingEdited)
						this.BeginInit();									
										
					if (_categories != null)
						_categories.ApplyChanges((ISupportsEditing)configuration.Categories, actions);

					if (_isBeingEdited)
						this.EndInit();
				}
				return true;
			}
			return false;
		}