public IMyGenDocument Open(IMyGenerationMDI mdi, FileInfo file, params string[] args)
        {
            SampleEditor edit = null;

            if (file.Exists)
            {
                bool isopen = mdi.IsDocumentOpen(file.FullName);

                if (!isopen)
                {
                    edit = new SampleEditor(mdi);
                    edit.LoadImage(file.FullName);
                }
                else
                {
                    edit = mdi.FindDocument(file.FullName) as SampleEditor;
                    if (edit != null)
                    {
                        edit.Activate();
                    }
                }
            }

            return edit;
        }
Exemplo n.º 2
0
        public IMyGenDocument Open(IMyGenerationMDI mdi, FileInfo file, params string[] args)
        {
            SampleEditor edit = null;

            if (file.Exists)
            {
                bool isopen = mdi.IsDocumentOpen(file.FullName);

                if (!isopen)
                {
                    edit = new SampleEditor(mdi);
                    edit.LoadImage(file.FullName);
                }
                else
                {
                    edit = mdi.FindDocument(file.FullName) as SampleEditor;
                    if (edit != null)
                    {
                        edit.Activate();
                    }
                }
            }

            return(edit);
        }