Ejemplo n.º 1
0
        public GuiController(IGuiForm f, string initialFile)
        {
            // This circular reference is a little aggressive here, but we need the form's
            // controller to be set immediately for our CreateNew call.  This is all
            // evidence that things are coupled quite a bit tighter than they should be.
            this.f = f;
            f.c    = this;

            UnbindSong();
            CreateNew();
            if (!System.IO.File.Exists(initialFile))
            {
                return;
            }

            File = new FileInfo(initialFile);
            if (LinkExtensions.Contains(File.Extension.ToLower()))
            {
                File = new FileInfo(WindowsShell.Shortcut.Resolve(initialFile));
            }

            using (FileStream input = File.OpenRead()) Metadata = new MetadataFile(input);
            WipeSelection();
            Dirty = false;
        }