Example #1
0
 private void DefaultSerializationService_ItemSerializing(object sender, SerializationEventArgs<IDiagramItem> e)
 {
     if (e.Entity is RadDiagramShape)
     {
         e.SerializationInfo["MyGeometry"] = (e.Entity as RadDiagramShape).Geometry.ToString();
     }
 }
Example #2
0
 private void DefaultSerializationService_ItemSerializing(object sender, SerializationEventArgs <IDiagramItem> e)
 {
     if (e.Entity is RadDiagramShape)
     {
         e.SerializationInfo["MyGeometry"] = (e.Entity as RadDiagramShape).Geometry.ToString();
     }
 }
Example #3
0
 //Tell the plugins to unpack themselves from the saved state
 public void UnpackProjectState(IDictionary <string, IDictionary <string, object> > dictPackedStates)
 {
     if (ProjectOpened != null) //Has some method been told to handle this event?
     {
         SerializationEventArgs e = new SerializationEventArgs(dictPackedStates);
         ProjectOpened(this, e);
     }
 }
Example #4
0
 /// <summary>
 /// Handle exception from docManager_SaveEvent function
 /// </summary>
 /// <param name="ex"></param>
 /// <param name="fileName"></param>
 private void HandleSaveException(Exception ex, SerializationEventArgs e)
 {
     MessageBox.Show(this,
                     "Save File operation failed. File name: " + e.FileName + "\n" +
                     "Reason: " + ex.Message,
                     Application.ProductName);
     e.Error = true;
 }
 private void Default_ItemSerializing(object sender, SerializationEventArgs <IDiagramItem> e)
 {
     if (e.Entity is StateShape)
     {
         e.SerializationInfo["StateID"] = (e.Entity as StateShape).StateID;
         e.SerializationInfo["Title"]   = (e.Entity as StateShape).Title;
     }
 }
Example #6
0
 void Default_ItemSerializing(object sender, SerializationEventArgs<IDiagramItem> e)
 {
     if (e.Entity is RadDiagramShape)
     {
         e.SerializationInfo["MyGeometry"] = (e.Entity as RadDiagramShape).Geometry.ToString();
         if ((e.Entity as RadDiagramShape).DataContext is MyShape)
             e.SerializationInfo["DataContent"] = ((e.Entity as RadDiagramShape).DataContext as MyShape).Header;
     }
 }
Example #7
0
        void Default_ItemSerializing(object sender, SerializationEventArgs<IDiagramItem> e)
        {
            var shape = e.Entity as RadDiagramShape;
            if (shape != null)
            {
                e.SerializationInfo["MyGeometry"] = shape.Geometry.ToString();

                var myShape = shape.DataContext as MyShape;
                if (myShape != null)
                    e.SerializationInfo["DataContent"] = myShape.Header;
            }
        }
Example #8
0
 private void ProjectOpenedListener(object sender, SerializationEventArgs e)
 {
     if (e.PackedPluginStates.ContainsKey(strPanelKey))
     {
         //Unpack the state of this plugin.
         cLocation.UnpackState(e.PackedPluginStates[strPanelKey]);
     }
     else
     {
         //Set this plugin to an empty state.
     }
 }
Example #9
0
        void Default_ItemSerializing(object sender, SerializationEventArgs <IDiagramItem> e)
        {
            var shape = e.Entity as RadDiagramShape;

            if (shape != null)
            {
                e.SerializationInfo["MyGeometry"] = shape.Geometry.ToString();

                var myShape = shape.DataContext as MyShape;
                if (myShape != null)
                {
                    e.SerializationInfo["DataContent"] = myShape.Header;
                }
            }
        }
Example #10
0
 /// <summary>
 /// Save document to stream supplied by DocManager
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void docManager_SaveEvent(object sender, SerializationEventArgs e)
 {
     // DocManager asks to save document to supplied stream
     try
     {
         e.Formatter.Serialize(e.SerializationStream, drawArea.TheLayers);
     } catch (ArgumentNullException ex)
     {
         HandleSaveException(ex, e);
     } catch (SerializationException ex)
     {
         HandleSaveException(ex, e);
     } catch (SecurityException ex)
     {
         HandleSaveException(ex, e);
     }
 }
Example #11
0
 /// <summary>
 /// Load document from the stream supplied by DocManager
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void docManager_LoadEvent(object sender, SerializationEventArgs e)
 {
     // DocManager asks to load document from supplied stream
     try
     {
         drawArea.TheLayers = (Layers)e.Formatter.Deserialize(e.SerializationStream);
     } catch (ArgumentNullException ex)
     {
         HandleLoadException(ex, e);
     } catch (SerializationException ex)
     {
         HandleLoadException(ex, e);
     } catch (SecurityException ex)
     {
         HandleLoadException(ex, e);
     }
 }
		private void DefaultSerializationService_ItemSerializing(object sender, SerializationEventArgs<IDiagramItem> e)
		{
			if (e.Entity is RadDiagramShape)
			{
				var shape = e.Entity as RadDiagramShape;
				if (shape != null && shape.Geometry != null)
				{
                    string geometryString = string.Empty;
#if WPF
                    geometryString = (e.Entity as RadDiagramShape).Geometry.ToString(CultureInfo.InvariantCulture);
#else
                    geometryString = (e.Entity as RadDiagramShape).Geometry.ToString();
#endif
                    e.SerializationInfo["MyGeometry"] = geometryString;
				}				
			}
		}
Example #13
0
 private void SerealizationEvent(object sender, SerializationEventArgs e)
 {
     projectService.ProjectSerialization(e.project);
 }
Example #14
0
 private void ProjectSavedListener(object sender, SerializationEventArgs e)
 {
     e.PackedPluginStates.Add(strPanelKey, cLocation.PackState());
 }
Example #15
0
 public void OnReaderReady(object sender, SerializationEventArgs e)
 {
     SendSerializedData(e.DataIndex, e.Data, e.CanSkip);
 }