Пример #1
0
        /// <summary>
        /// Constructs the main form.
        /// </summary>
        public ContentManagerForm(FyriProject project)
        {
            InitializeComponent();

            // Don't initialize the graphics device if we are running in the designer.
            if (!DesignMode)
            {
                currentProject = project;
                if (!currentProject.IsInitialized)
                {
                    currentProject.Initialize(this.Handle, this.Width, this.Height);
                }
                RefreshProject();
            }

            /// Automatically bring up the "Load Model" dialog when we are first shown.
            //this.Shown += OpenMenuClicked;
        }
Пример #2
0
        private void OpenDefaultProject()
        {
            Stream stream;
            string defaultProjectFilePath = "C:\\Users\\dovieya\\Desktop\\TestContentLoader\\testProject.ff";

            if (File.Exists(defaultProjectFilePath))
            {
                if ((stream = File.OpenRead(defaultProjectFilePath)) != null)
                {
                    BinaryFormatter bFormatter = new BinaryFormatter();
                    currentProject = (FyriProject)bFormatter.Deserialize(stream);
                    stream.Close();
                }
            }

            if (!currentProject.IsInitialized)
            {
                currentProject.Initialize(this.Handle, this.Width, this.Height);
            }
        }