コード例 #1
0
        public Login(EnvDTE80.DTE2 dte, Settings settings)
        {
            WifDetector.CheckForWifInstall();
            InitializeComponent();

            var main = dte.GetMainWindow();

            this.Owner = main;
            //Loaded += delegate  { this.CenterWindow(main); };

            this.settings             = settings;
            this.txtPassword.Password = settings.Password;  // PasswordBox doesn't allow 2 way binding
            this.DataContext          = settings;
        }
コード例 #2
0
        public AddTemplate(EnvDTE80.DTE2 dte, Project project)
        {
            InitializeComponent();

            var main = dte.GetMainWindow();

            this.Owner = main;
            //Loaded += delegate { this.CenterWindow(main); };

            _Props           = new AddTemplateProp();
            this.DataContext = Props;

            var samplesPath = System.IO.Path.Combine(DteHelper.AssemblyDirectory(), @"Resources\Templates");
            var dir         = new DirectoryInfo(samplesPath);

            Props.TemplateList = new ObservableCollection <String>(dir.GetFiles().Select(x => x.Name).Where(x => !x.Equals("_Blank.tt")).ToArray());
            Props.Template     = "CrmSchema.tt";
            Props.Folder       = project.GetProjectDirectory();
        }