Changeset 1842


Ignore:
Timestamp:
Aug 19, 2010, 6:29:55 PM (11 years ago)
Author:
kopal
Message:
  • removed event bug of PluginModel which made saving unable to workspace
  • added new Models:
    • TextModel - represents a Text which can be put onto the workspace
    • ImageModel - represents an Image which can be put onto the workspace
Location:
trunk/CrypPlugins/WorkspaceManager
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/WorkspaceManager/Model/PluginModel.cs

    r1831 r1842  
    6060        #region public members
    6161
     62        [field: NonSerialized]
    6263        public event EventHandler<LogUpdated> LogUpdated;
    6364
  • trunk/CrypPlugins/WorkspaceManager/Model/WorkspaceModel.cs

    r1812 r1842  
    6262
    6363        /// <summary>
     64        /// All ImageModels of our Workspace Model
     65        /// </summary>
     66        public List<ImageModel> AllImageModels;
     67
     68        /// <summary>
     69        /// All TextModels of our Workspace Model
     70        /// </summary>
     71        public List<TextModel> AllTextModels;
     72
     73        /// <summary>
    6474        /// Creates a new Workspace Model
    6575        /// </summary>
     
    6878            this.AllPluginModels = new List<PluginModel>();
    6979            this.AllConnectionModels = new List<ConnectionModel>();
    70             this.AllConnectorModels = new List<ConnectorModel>();           
     80            this.AllConnectorModels = new List<ConnectorModel>();
     81            this.AllImageModels = new List<ImageModel>();
     82            this.AllTextModels = new List<TextModel>();
    7183        }
    7284
     
    168180
    169181        /// <summary>
     182        /// Creates a new ImageModel containing the under imgUri stored Image
     183        /// </summary>
     184        /// <param name="imgUri"></param>
     185        /// <returns></returns>
     186        public ImageModel newImageModel(Uri imgUri)
     187        {
     188            ImageModel imageModel = new ImageModel(imgUri);
     189            this.AllImageModels.Add(imageModel);
     190            this.WorkspaceManagerEditor.HasChanges = true;
     191            return imageModel;
     192        }
     193
     194        /// <summary>
     195        /// Creates a new TextModel
     196        /// </summary>
     197        /// <param name="imgUri"></param>
     198        /// <returns></returns>
     199        public TextModel newTextModel(string text = null )
     200        {
     201            TextModel textModel = new TextModel(text);
     202            this.AllTextModels.Add(textModel);
     203            this.WorkspaceManagerEditor.HasChanges = true;
     204            return textModel;
     205        }
     206
     207        /// <summary>
     208        /// Deletes the given ImageModel
     209        /// </summary>
     210        /// <param name="imgUri"></param>
     211        /// <returns></returns>
     212        public bool deleteImageModel(ImageModel imageModel)
     213        {
     214            return this.AllImageModels.Remove(imageModel);
     215        }
     216
     217        /// <summary>
     218        /// Deletes the given TextModel
     219        /// </summary>
     220        /// <param name="imgUri"></param>
     221        /// <returns></returns>
     222        public bool deleteTextModel(TextModel textModel)
     223        {
     224            return this.AllTextModels.Remove(textModel);
     225        }
     226
     227        /// <summary>
    170228        /// Deletes the pluginModel and all of its Connectors and the connected Connections
    171229        /// from our WorkspaceModel
  • trunk/CrypPlugins/WorkspaceManager/WorkspaceManager.csproj

    r1837 r1842  
    8181  </ItemGroup>
    8282  <ItemGroup>
     83    <Compile Include="Model\ImageModel.cs" />
     84    <Compile Include="Model\TextModel.cs" />
    8385    <Compile Include="StreamRead.cs" />
    8486    <Compile Include="Execution\ExecutionEngine.cs" />
Note: See TracChangeset for help on using the changeset viewer.