Add() public method

/// has been already added to the project. /// /// is null. ///
public Add ( IProjectItem item ) : void
item IProjectItem
return void
示例#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);
        }
示例#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;
		}