Ejemplo n.º 1
0
 /// <summary>
 /// Initializes the contract setting composite with the given
 /// EditorProject instance. This will attach the event handler
 /// to the EditorProject's PropertyChangedHandler.
 /// </summary>
 /// <param name="project">The EditorProject instance
 /// to which the contract setting is attached.</param>
 public ContractSetting(EditorProject project)
     : this()
 {
     this.Project = project;
     this.PropertyChanged += project.RaisePropertyChangedHandler;
     this.attributes.PropertyChanged += project.RaisePropertyChangedHandler;
 }
Ejemplo n.º 2
0
 public frmEditor(MainFormBase parent, EditorProject project)
     : base((MainFormBase)parent)
 {
     InitializeComponent();
     this.project = project;
     this.project.PropertyChanged +=
         new EventHandler<AdaptiveConsole.DesignModel.PropertyChangedEventArgs>(project_PropertyChanged);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Serialzes and saves the project.
 /// </summary>
 /// <param name="fileName">The file to which the project is saved.</param>
 /// <param name="project">The project which is going to be saved.</param>
 public static void Save(string fileName, EditorProject project)
 {
     FileStream fileStream = null;
     try
     {
         fileStream = new FileStream(fileName, FileMode.Create);
         XmlSerializer serializer = new XmlSerializer(typeof(EditorProject));
         serializer.Serialize(fileStream, project);
         project.Modified = false;
         project.FileName = fileName;
     }
     catch
     {
         throw;
     }
     finally
     {
         if (fileStream != null)
             fileStream.Close();
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes and creates a new instance of the editor project
 /// by the given project name.
 /// </summary>
 /// <param name="name">Name of the project.</param>
 /// <returns>The newly created instance object.</returns>
 public static EditorProject Create(string name)
 {
     EditorProject editorProject = new EditorProject();
     editorProject.Language = ProgrammingLanguage.CSharp;
     editorProject.ReferencedAssembliesSettings = new ReferencedAssembliesSettings();
     editorProject.ApplicationContractSettings = new ApplicationContractSettings();
     editorProject.ApplicationProviderSettings = new ApplicationProviderSettings();
     editorProject.Name = name;
     editorProject.InitAttachEventHandler();
     return editorProject;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes the contract setting composite with the given
 /// EditorProject instance and name. This will attach the event
 /// handler to the EditorProject's PropertyChangedHandler, and
 /// give a name to the contract.
 /// </summary>
 /// <param name="project">The EditorProject instance to
 /// which the contract setting is attached.</param>
 /// <param name="name">The name of the contract.</param>
 public ContractSetting(EditorProject project, string name)
     : this(project)
 {
     this.Name = name;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes the option setting composite with default values
 /// and the EditorProject instance to which the option setting
 /// is attached.
 /// </summary>
 /// <param name="project">The instance of EditorProject.</param>
 public OptionSetting(EditorProject project)
     : this()
 {
     this.Project = project;
     this.PropertyChanged += project.RaisePropertyChangedHandler;
     this.Attributes.PropertyChanged += project.RaisePropertyChangedHandler;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes the option setting composite with default values
 /// and the given property name, and attach the option setting to
 /// the specified EditorProject's instance.
 /// </summary>
 /// <param name="project">The EditorProject's instance to which
 /// the option setting is attached.</param>
 /// <param name="propertyName">Name of the property which will
 /// be given to the option setting.</param>
 public OptionSetting(EditorProject project, string propertyName)
     : this(project)
 {
     this.propertyName = propertyName;
 }