public override ICollection Deserialize(SerializationStore store)
 {
     if (store == null) throw new ArgumentNullException("store");
     WorkflowMarkupSerializationStore xomlStore = store as WorkflowMarkupSerializationStore;
     if (xomlStore == null) throw new InvalidOperationException(SR.GetString(SR.Error_UnknownSerializationStore));
     return (ICollection)xomlStore.Deserialize(this.serviceProvider);
 }
 public override void Serialize(SerializationStore store, object value)
 {
     if (store == null) throw new ArgumentNullException("store");
     if (value == null) throw new ArgumentNullException("value");
     WorkflowMarkupSerializationStore xomlStore = store as WorkflowMarkupSerializationStore;
     if (xomlStore == null) throw new InvalidOperationException(SR.GetString(SR.Error_UnknownSerializationStore));
     xomlStore.AddObject(value);
 }
 public override void SerializeMember(SerializationStore store, object owningObject, MemberDescriptor member)
 {
     if (store == null) throw new ArgumentNullException("store");
     if (owningObject == null) throw new ArgumentNullException("owningObject");
     if (member == null) throw new ArgumentNullException("member");
     WorkflowMarkupSerializationStore xomlStore = store as WorkflowMarkupSerializationStore;
     if (xomlStore == null) throw new InvalidOperationException(SR.GetString(SR.Error_UnknownSerializationStore));
     xomlStore.AddMember(owningObject, member);
 }
 public override ICollection Deserialize(SerializationStore store)
 {
     if (store == null)
     {
         throw new ArgumentNullException("store");
     }
     CodeDomSerializationStore store2 = store as CodeDomSerializationStore;
     if (store2 == null)
     {
         throw new InvalidOperationException(System.Design.SR.GetString("CodeDomComponentSerializationServiceUnknownStore"));
     }
     return store2.Deserialize(this._provider);
 }
 public override ICollection Deserialize(SerializationStore store)
 {
     if (store == null)
     {
         throw new ArgumentNullException("store");
     }
     WorkflowMarkupSerializationStore store2 = store as WorkflowMarkupSerializationStore;
     if (store2 == null)
     {
         throw new InvalidOperationException(SR.GetString("Error_UnknownSerializationStore"));
     }
     return store2.Deserialize(this.serviceProvider);
 }
Example #6
0
        ICollection IDesignerSerializationService.Deserialize(object serializationData)
        {
            if (serializationData == null)
            {
                throw new ArgumentNullException("serializationData");
            }

            ComponentSerializationService service = LoaderHost.GetService(typeof(ComponentSerializationService)) as ComponentSerializationService;
            SerializationStore            store   = serializationData as SerializationStore;

            if (service != null && serializationData != null)
            {
                return(service.Deserialize(store, this.LoaderHost.Container));
            }
            return(new object[0]);
        }
 public override void DeserializeTo(SerializationStore store, IContainer container, bool validateRecycledTypes, bool applyDefaults)
 {
     if (store == null)
     {
         throw new ArgumentNullException("store");
     }
     if (container == null)
     {
         throw new ArgumentNullException("container");
     }
     WorkflowMarkupSerializationStore store2 = store as WorkflowMarkupSerializationStore;
     if (store2 == null)
     {
         throw new InvalidOperationException(SR.GetString("Error_UnknownSerializationStore"));
     }
     store2.DeserializeTo(this.serviceProvider, container);
 }
 public override void DeserializeTo(SerializationStore store, IContainer container, bool validateRecycledTypes, bool applyDefaults)
 {
     if (store == null)
     {
         throw new ArgumentNullException("store");
     }
     if (container == null)
     {
         throw new ArgumentNullException("container");
     }
     CodeDomSerializationStore store2 = store as CodeDomSerializationStore;
     if (store2 == null)
     {
         throw new InvalidOperationException(System.Design.SR.GetString("CodeDomComponentSerializationServiceUnknownStore"));
     }
     store2.DeserializeTo(this._provider, container, validateRecycledTypes, applyDefaults);
 }
        private void SerializeCore(SerializationStore store, object value, bool absolute)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            if (store == null)
            {
                throw new ArgumentNullException("store");
            }

            CodeDomSerializationStore codeDomStore = store as CodeDomSerializationStore;

            if (store == null)
            {
                throw new InvalidOperationException("store type unsupported");
            }

            codeDomStore.AddObject(value, absolute);
        }
Example #10
0
        object IDesignerSerializationService.Serialize(ICollection objects)
        {
            if (objects == null)
            {
                throw new ArgumentNullException("objects");
            }

            ComponentSerializationService service = LoaderHost.GetService(typeof(ComponentSerializationService)) as ComponentSerializationService;

            if (service != null)
            {
                SerializationStore store = service.CreateStore();
                foreach (object o in objects)
                {
                    service.Serialize(store, o);
                }
                store.Close();
                return(store);
            }
            return(null);
        }
        private void SerializeMemberCore(SerializationStore store, object owningObject, MemberDescriptor member, bool absolute)
        {
            if (member == null)
            {
                throw new ArgumentNullException("member");
            }
            if (owningObject == null)
            {
                throw new ArgumentNullException("owningObject");
            }
            if (store == null)
            {
                throw new ArgumentNullException("store");
            }

            CodeDomSerializationStore codeDomStore = store as CodeDomSerializationStore;

            if (codeDomStore == null)
            {
                throw new InvalidOperationException("store type unsupported");
            }
            codeDomStore.AddMember(owningObject, member, absolute);
        }
 public void DeserializeTo(SerializationStore store, IContainer container)
 {
     DeserializeTo(store, container, true, true);
 }
 /// <summary>
 ///     Normal serialization only serializes values that differ from the component's default state.  
 ///     This provides the most compact serialization mechanism but assumes that during deserilalization 
 ///     a new, freshly created object will be used.  If an existing object is used properties that 
 ///     contained default values during serialization would not be reset back to their defaults.  
 ///     The SerializeAbsolute method does not require this assumption on the deserializing end.  
 ///     Instead, it saves data in the serialization store about default values as well so that 
 ///     deserialization can reset non-default properties back to their default values.  This is 
 ///     especially true for collection objects, where the collections are either cleared and 
 ///     items re-added, or individual items are removed and added.
 /// </summary>
 public abstract void SerializeAbsolute(SerializationStore store, object value);
 public abstract void Serialize(SerializationStore store, Object value);
		private void SerializeMemberCore (SerializationStore store, object owningObject, MemberDescriptor member, bool absolute)
		{
			if (member == null)
				throw new ArgumentNullException ("member");
			if (owningObject == null)
				throw new ArgumentNullException ("owningObject");
			if (store == null)
				throw new ArgumentNullException ("store");

			CodeDomSerializationStore codeDomStore = store as CodeDomSerializationStore;
			if (codeDomStore == null)
				throw new InvalidOperationException ("store type unsupported");
			codeDomStore.AddMember (owningObject, member, absolute);
		}
Example #16
0
 public override void SerializeMemberAbsolute(SerializationStore store, object owningObject, MemberDescriptor member)
 {
     throw null;
 }
 public abstract System.Collections.ICollection Deserialize(SerializationStore store, System.ComponentModel.IContainer container);
 public abstract System.Collections.ICollection Deserialize(SerializationStore store);
Example #19
0
 public override void DeserializeTo(SerializationStore store, IContainer container, bool validateRecycledTypes, bool applyDefaults)
 {
     throw null;
 }
 public void DeserializeTo(SerializationStore store, System.ComponentModel.IContainer container)
 {
 }
 public abstract void DeserializeTo(SerializationStore store, System.ComponentModel.IContainer container, bool validateRecycledTypes, bool applyDefaults);
 private void SaveAfterState(UndoEngine engine)
 {
     object component = null;
     IReferenceService service = engine.GetService(typeof(IReferenceService)) as IReferenceService;
     if (service != null)
     {
         component = service.GetReference(this._componentName);
     }
     else
     {
         IDesignerHost host = engine.GetService(typeof(IDesignerHost)) as IDesignerHost;
         if (host != null)
         {
             component = host.Container.Components[this._componentName];
         }
     }
     if (component != null)
     {
         this._after = this.Serialize(engine, component, this._member);
     }
 }
Example #23
0
 public void DeserializeTo(SerializationStore store, IContainer container)
 {
     DeserializeTo(store, container, validateRecycledTypes: true, applyDefaults: true);
 }
 public abstract void SerializeMemberAbsolute(SerializationStore store, Object owningObject, System.ComponentModel.MemberDescriptor member);
 /// <summary>
 ///     This method deserializes the given store to produce a collection of 
 ///     objects contained within it.  If a container is provided, objects 
 ///     that are created that implement IComponent will be added to the container. 
 /// </summary>
 public abstract ICollection Deserialize(SerializationStore store);
		public override ICollection Deserialize (SerializationStore store)
		{
			return this.Deserialize (store, null);
		}
 // error CS0534: 'System.Workflow.ComponentModel.Design.XomlComponentSerializationService' does not implement inherited abstract member 'System.ComponentModel.Design.Serialization.ComponentSerializationService.SerializeAbsolute(System.ComponentModel.Design.Serialization.SerializationStore, object)'
 public override void SerializeAbsolute(SerializationStore store, object value)
 {
     this.Serialize(store, value);
 }
		public override void DeserializeTo (SerializationStore store, IContainer container, bool validateRecycledTypes, bool applyDefaults)
		{
			DeserializeCore (store, container, validateRecycledTypes, applyDefaults);
		}
Example #29
0
				public void SetModifiedState (UndoEngine engine, IComponent component, MemberDescriptor member)
				{
					// Console.WriteLine ("ComponentChangeAction.SetModifiedState (" + (_componentName != null ? (_componentName + ".") : "") +
					// 		   member.Name + "): " +
					// 		   (((PropertyDescriptor)member).GetValue (component) == null ? "null" :
					// 		   ((PropertyDescriptor)member).GetValue (component).ToString ()));
					ComponentSerializationService serializationService = engine.GetRequiredService (
						typeof (ComponentSerializationService)) as ComponentSerializationService;
					_afterChange = serializationService.CreateStore ();
					serializationService.SerializeMemberAbsolute (_afterChange, component, member);
					_afterChange.Close ();
				}
		public override void Serialize (SerializationStore store, object value)
		{
			SerializeCore (store, value, false);
		}
 public override void SerializeMemberAbsolute(SerializationStore store, object owningObject, MemberDescriptor member)
 {
     SerializeMemberCore(store, owningObject, member, true);
 }
		public override void SerializeMemberAbsolute (SerializationStore store, object owningObject, MemberDescriptor member)
		{
			SerializeMemberCore (store, owningObject, member, true);
		}
 /// <summary>
 ///     This method deserializes the given store, but rather than produce
 ///     new objects, the data in the store is applied to an existing
 ///     set of objects that are taken from the provided container.  This
 ///     allows the caller to pre-create an object however it sees fit.  If
 ///     an object has deserialization state and the object is not named in
 ///     the set of existing objects, a new object will be created.  If that
 ///     object also implements IComponent, it will be added to the given
 ///     container.  Objects in the container must have names that
 ///     match objects in the serialization store in order for an existing
 ///     object to be used.  If validateRecycledTypes is true it is guaranteed
 ///     that the deserialization will only work if applied to an object of the
 ///     same type.
 /// </summary>
 public abstract void DeserializeTo(SerializationStore store, IContainer container, bool validateRecycledTypes, bool applyDefaults);
 public void DeserializeTo(SerializationStore store, System.ComponentModel.IContainer container, bool validateRecycledTypes)
 {
 }
 public void DeserializeTo(SerializationStore store, IContainer container)
 {
     DeserializeTo(store, container, true, true);
 }
 public void DeserializeTo(SerializationStore store, IContainer container, bool validateRecycledTypes)
 {
     DeserializeTo(store, container, validateRecycledTypes, true);
 }
		public override ICollection Deserialize (SerializationStore store, IContainer container)
		{
			return DeserializeCore (store, container, true, true);
		}
 /// <summary>
 ///     Normal serialization only serializes values that differ from the component's default state.
 ///     This provides the most compact serialization mechanism but assumes that during deserilalization
 ///     a new, freshly created object will be used.  If an existing object is used properties that
 ///     contained default values during serialization would not be reset back to their defaults.
 ///     The SerializeAbsolute method does not require this assumption on the deserializing end.
 ///     Instead, it saves data in the serialization store about default values as well so that
 ///     deserialization can reset non-default properties back to their default values.  This is
 ///     especially true for collection objects, where the collections are either cleared and
 ///     items re-added, or individual items are removed and added.
 /// </summary>
 public abstract void SerializeAbsolute(SerializationStore store, object value);
		private ICollection DeserializeCore (SerializationStore store, IContainer container, bool validateRecycledTypes, 
						     bool applyDefaults)
		{
			CodeDomSerializationStore codeDomStore = store as CodeDomSerializationStore;
			if (codeDomStore == null)
				throw new InvalidOperationException ("store type unsupported");
			return codeDomStore.Deserialize (_provider, container, validateRecycledTypes, applyDefaults);
		}
 /// <summary>
 ///     This method serializes the given member on the given object,
 ///     but also serializes the member if it contains the default value.
 ///     Note that for some members, containing the default value and setting
 ///     the same value back to the member are different concepts.  For example,
 ///     if a property inherits its value from a parent object if no local value
 ///     is set, setting the value back to the property can may not be what is desired.
 ///     SerializeMemberAbsolute takes this into account and would clear the state of
 ///     the property in this case.
 /// </summary>
 public abstract void SerializeMemberAbsolute(SerializationStore store, object owningObject, MemberDescriptor member);
		public override void SerializeAbsolute (SerializationStore store, object value)
		{
			SerializeCore (store, value, true);
		}
 /// <summary>
 ///     This method deserializes the given store to produce a collection of
 ///     objects contained within it.  If a container is provided, objects
 ///     that are created that implement IComponent will be added to the container.
 /// </summary>
 public abstract ICollection Deserialize(SerializationStore store);
		private void SerializeCore (SerializationStore store, object value, bool absolute)
		{
			if (value == null)
				throw new ArgumentNullException ("value");
			if (store == null)
				throw new ArgumentNullException ("store");

			CodeDomSerializationStore codeDomStore = store as CodeDomSerializationStore;
			if (store == null)
				throw new InvalidOperationException ("store type unsupported");

			codeDomStore.AddObject (value, absolute);
		}
 /// <summary>
 ///     This method deserializes the given store to produce a collection of
 ///     objects contained within it.  If a container is provided, objects
 ///     that are created that implement IComponent will be added to the container.
 /// </summary>
 public abstract ICollection Deserialize(SerializationStore store, IContainer container);
 /// <summary>
 ///     This method deserializes the given store, but rather than produce 
 ///     new objects, the data in the store is applied to an existing 
 ///     set of objects that are taken from the provided container.  This 
 ///     allows the caller to pre-create an object however it sees fit.  If
 ///     an object has deserialization state and the object is not named in 
 ///     the set of existing objects, a new object will be created.  If that 
 ///     object also implements IComponent, it will be added to the given 
 ///     container.  Objects in the container must have names that 
 ///     match objects in the serialization store in order for an existing 
 ///     object to be used.  If validateRecycledTypes is true it is guaranteed
 ///     that the deserialization will only work if applied to an object of the 
 ///     same type.
 /// </summary>
 public abstract void DeserializeTo(SerializationStore store, IContainer container, bool validateRecycledTypes, bool applyDefaults);
 private void SerializeDropDownItems(ToolStripDropDownItem parent, ref SerializationStore _serializedDataForDropDownItems, ComponentSerializationService _serializationService)
 {
     foreach (System.Windows.Forms.ToolStripItem item in parent.DropDownItems)
     {
         if (!(item is DesignerToolStripControlHost))
         {
             _serializationService.Serialize(_serializedDataForDropDownItems, item);
             ToolStripDropDownItem item2 = item as ToolStripDropDownItem;
             if (item2 != null)
             {
                 this.SerializeDropDownItems(item2, ref _serializedDataForDropDownItems, _serializationService);
             }
         }
     }
 }
 public void DeserializeTo(SerializationStore store, IContainer container, bool validateRecycledTypes)
 {
     DeserializeTo(store, container, validateRecycledTypes, true);
 }
 public override ICollection Deserialize(SerializationStore store)
 {
     return(this.Deserialize(store, null));
 }
 /// <summary>
 ///     This method serializes the given member on the given object, 
 ///     but also serializes the member if it contains the default value.  
 ///     Note that for some members, containing the default value and setting 
 ///     the same value back to the member are different concepts.  For example, 
 ///     if a property inherits its value from a parent object if no local value 
 ///     is set, setting the value back to the property can may not be what is desired.  
 ///     SerializeMemberAbsolute takes this into account and would clear the state of 
 ///     the property in this case.
 /// </summary>
 public abstract void SerializeMemberAbsolute(SerializationStore store, object owningObject, MemberDescriptor member);
 //error CS0534: 'System.Workflow.ComponentModel.Design.XomlComponentSerializationService' does not implement inherited abstract member 'System.ComponentModel.Design.Serialization.ComponentSerializationService.SerializeMemberAbsolute(System.ComponentModel.Design.Serialization.SerializationStore, object, System.ComponentModel.MemberDescriptor)'
 public override void SerializeMemberAbsolute(SerializationStore store, object owningObject, MemberDescriptor member)
 {
     this.SerializeMember(store, owningObject, member);
 }
 /// <summary>
 ///     This method deserializes the given store to produce a collection of 
 ///     objects contained within it.  If a container is provided, objects 
 ///     that are created that implement IComponent will be added to the container. 
 /// </summary>
 public abstract ICollection Deserialize(SerializationStore store, IContainer container);
Example #52
0
 public override ICollection Deserialize(SerializationStore store)
 {
     throw null;
 }
 public override ICollection Deserialize(SerializationStore store, IContainer container)
 {
     return(DeserializeCore(store, container, true, true));
 }
Example #54
0
 public override ICollection Deserialize(SerializationStore store, IContainer container)
 {
     throw null;
 }
 public override void DeserializeTo(SerializationStore store, IContainer container, bool validateRecycledTypes, bool applyDefaults)
 {
     DeserializeCore(store, container, validateRecycledTypes, applyDefaults);
 }
 public override void Serialize(SerializationStore store, object value)
 {
     SerializeCore(store, value, false);
 }
Example #57
0
				public ComponentAddRemoveAction (UndoEngine engine, IComponent component, bool added)
				{
					if (component == null)
						throw new ArgumentNullException ("component");
					// Console.WriteLine ((added ? "Component*Add*RemoveAction" : "ComponentAdd*Remove*Action") +
					// 		   " (" + component.Site.Name + ")");
					ComponentSerializationService serializationService = engine.GetRequiredService (
						typeof (ComponentSerializationService)) as ComponentSerializationService;

					_serializedComponent = serializationService.CreateStore ();
					serializationService.Serialize (_serializedComponent, component);
					_serializedComponent.Close ();

					_added = added;
					_componentName = component.Site.Name;
				}
 public override void SerializeAbsolute(SerializationStore store, object value)
 {
     SerializeCore(store, value, true);
 }
Example #59
0
				// Reminder: _component might no longer be a valid instance
				// so one should request a new one.
				// 
				public override void Undo (UndoEngine engine)
				{
					if (_beforeChange == null) {
						// Console.WriteLine ("ComponentChangeAction.Undo: ERROR: UndoUnit is not complete.");
						return;
					}

					// Console.WriteLine ("ComponentChangeAction.Undo (" + _componentName + "." + _member.Name + ")");
					IDesignerHost host = (IDesignerHost)engine.GetRequiredService (typeof(IDesignerHost));
					_component = host.Container.Components[_componentName];

					ComponentSerializationService serializationService = engine.GetRequiredService (
						typeof (ComponentSerializationService)) as ComponentSerializationService;
					serializationService.DeserializeTo (_beforeChange, host.Container);

					SerializationStore tmp = _beforeChange;
					_beforeChange = _afterChange;
					_afterChange = tmp;
				}
Example #60
0
 public override void SerializeAbsolute(SerializationStore store, object value)
 {
     throw null;
 }