示例#1
0
        private void frmCR2WDocument_Load(object sender, EventArgs e)
        {
            string config = Path.Combine(Path.GetDirectoryName(Configuration.ConfigurationPath), "cr2wdocument_layout.xml");

            if (System.IO.File.Exists(config))
            {
                try
                {
                    FormPanel.LoadFromXml(config, m_deserializeDockContent);
                    // if anything went wrong
                    if (FormPanel.DockWindows.Count < 2)
                    {
                        chunkList.Show(FormPanel, DockState.Document);
                        propertyWindow.Show(FormPanel, DockState.DockRight);
                    }
                }
                catch (Exception exception)
                {
                    chunkList.Show(FormPanel, DockState.Document);
                    propertyWindow.Show(FormPanel, DockState.DockRight);


                    Console.WriteLine(exception);
                }
            }
            else
            {
                chunkList.Show(FormPanel, DockState.Document);
                propertyWindow.Show(FormPanel, DockState.DockRight);
            }

            //propertyWindow .RequestChunkViewUpdate += ChunkWindowRequestChunkViewUpdate;
            propertyWindow.RequestBytesOpen += PropertyWindowOnRequestBytesOpen;



            chunkList.Activate();

            if (File.Embedded.Count > 0)
            {
                embeddedFiles = new frmEmbeddedFiles
                {
                    File      = File,
                    DockAreas = DockAreas.DockLeft
                };
                embeddedFiles.Show(FormPanel, DockState.DockLeftAutoHide);

                embeddedFiles.RequestFileOpen += EmbeddedWindow_OnRequestOpen;
            }
        }
示例#2
0
        public frmCR2WDocument()
        {
            InitializeComponent();

            try
            {
                dockPanel.LoadFromXml(
                    Path.Combine(Path.GetDirectoryName(Configuration.ConfigurationPath), "cr2wdocument_layout.xml"),
                    DeserializeDockContent);
            }
            catch { }
            ApplyCustomTheme();

            chunkList = new frmChunkList
            {
                File      = File,
                DockAreas = DockAreas.Document
            };
            chunkList.Show(dockPanel, DockState.Document);
            chunkList.OnSelectChunk += frmCR2WDocument_OnSelectChunk;
            propertyWindow           = new frmChunkProperties();
            propertyWindow.Show(dockPanel, DockState.DockBottom);
            propertyWindow.OnItemsChanged += PropertyWindow_OnItemsChanged;

            chunkList.Activate();
        }