示例#1
0
        public AspectControl(AspectWindow win)
        {
            InitializeComponent();
            WinInstance = win;

            // Create the interop host control.
            System.Windows.Forms.Integration.WindowsFormsHost host =
                new System.Windows.Forms.Integration.WindowsFormsHost();

            AspectCore.GlobalData.traceAction = Helpers.OutputWindowHelper.WriteOutput;

            VSInterop ide = new VSInterop(WinInstance);

            // Assign the MaskedTextBox control as the host control's child.
            awp        = new AspectWindowPane(ide);
            host.Child = awp;
            if (AspectPackage.dte != null && AspectPackage.dte.Solution != null)
            {
                string FileName = AspectPackage.dte.Solution.FullName.Replace(".sln", AspectCore.Strings.DefaultAspectExtension);
                if (FileName != "")
                {
                    awp.OpenOrCreateAspectFile(FileName);
                }
            }

            // Add the interop host control to the Grid
            // control's collection of child controls.
            this.grid1.Children.Add(host);
        }
示例#2
0
 public void LoadFile(string FileName)
 {
     FileName = System.IO.Path.GetDirectoryName(FileName) + System.IO.Path.DirectorySeparatorChar + System.IO.Path.GetFileNameWithoutExtension(FileName) + AspectCore.Strings.DefaultAspectExtension;
     awp.SaveAspectFile();
     awp.OpenOrCreateAspectFile(FileName);
 }