public baseProduct(Form mainForm, productSaveClass psc) { _initialize(mainForm); foreach (pageMatFrameSaveClass content in psc.contents) { _loadPageMatFrame(content); //temp lines _currentPageMatFrame = _pagesMatsFrames[0]; _layoutArea.intitialPlacePageMatFrame(_currentPageMatFrame); //need to somehow load items without haveing to display them until the page is active _currentPageMatFrame.loadItems(content); } if (_pagesMatsFrames.Count > 0) { _currentPageMatFrame = _pagesMatsFrames[0]; _layoutArea.intitialPlacePageMatFrame(_currentPageMatFrame); _layoutArea.Refresh(); } }
private productSaveClass openProduct(productSaveClass psc) { productSaveClass returnValue = null; OpenFileDialog ofd = new OpenFileDialog(); ofd.AddExtension = true; ofd.CheckFileExists = true; ofd.DefaultExt = "lpf"; ofd.Filter = "layout app project|*.lpf"; ofd.Title = "Open Project"; ofd.ShowDialog(); if (ofd.FileName != "") { XmlSerializer x = new XmlSerializer(psc.GetType()); FileStream myFileStream = new FileStream(ofd.FileName, FileMode.Open); psc = (productSaveClass)x.Deserialize(myFileStream); myFileStream.Close(); projectFile = ofd.FileName; returnValue = psc; } return (returnValue); }