Add() public method

/// has been already added to the project. /// /// is null. ///
public Add ( IProjectItem item ) : void
item IProjectItem
return void
Esempio n. 1
0
        private static Project LoadWithPreviousFormat(XmlElement root)
        {
            Project project = new Project();

            project.loading = true;

            Assembly     assembly    = Assembly.Load("NClass.DiagramEditor");
            IProjectItem projectItem = (IProjectItem)assembly.CreateInstance(
                "NClass.DiagramEditor.ClassDiagram.Diagram", false,
                BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,
                null, null, null, null);

            try
            {
                projectItem.Deserialize(root);
            }
            catch (Exception ex)
            {
                throw new InvalidDataException(Strings.ErrorCorruptSaveFile, ex);
            }
            project.Add(projectItem);
            project.loading    = false;
            project.isReadOnly = true;
            return(project);
        }
Esempio n. 2
0
		private static Project LoadWithPreviousFormat(XmlElement root)
		{
			Project project = new Project();
			project.loading = true;

			Assembly assembly = Assembly.Load("NClass.DiagramEditor");
			IProjectItem projectItem = (IProjectItem) assembly.CreateInstance(
				"NClass.DiagramEditor.ClassDiagram.Diagram", false,
				BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,
				null, null, null, null);

			try
			{
				projectItem.Deserialize(root);
			}
			catch (Exception ex)
			{
				throw new InvalidDataException(Strings.ErrorCorruptSaveFile, ex);
			}
			project.Add(projectItem);
			project.loading = false;
			project.isReadOnly = true;
			return project;
		}