/// <summary>
        /// Initializes a new instance of the WebBrowserVM class.
        /// </summary>
        public BuySellShareBaseVM(Uri aUri, CommonVM aCommonVM, Int32 aColumn, Int32 aRow, Int32 aCode)
            : base(aCommonVM)
        {
            MyGrid = new MyWebBrowser();
            MyGrid.DataContext = this;
            Grid.SetRow(MyGrid, aRow);
            Grid.SetColumn(MyGrid, aColumn);
            Grid.SetColumnSpan(MyGrid, 3);
            Grid.SetRowSpan(MyGrid, 4);

            MyUri = aUri;
            WB = this.MyGrid.Children.OfType<WebBrowser>().First();
            MyStatus = Status.Watching;
            Code = aCode;

            User = CVM.GetIniData("login.ini", "LOGIN", "USER");
            Pass = CVM.GetIniData("login.ini", "LOGIN", "PASS");
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(Dispatcher aDispatcher)
        {
            LoadedCommand = new RelayCommand<RoutedEventArgs>(LoadedCommandEventHandler);
            ClosedCommand = new RelayCommand<EventArgs>(ClosedCommandEventHandler);
            ButtonClickCommand = new RelayCommand<MainWindow>(ButtonClickCommandEventHandler);

            CVM = new CommonVM(aDispatcher);

            WBVMWatchCollection = new Collection<ICheckPortfolioWBVM>();

            // Catalogを1まとめに
            CVM.AggregateCatalog = new AggregateCatalog();
            CVM.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly()));

            var container = new CompositionContainer(CVM.AggregateCatalog);

            // CatalogでContainerを作成
            container.ComposeExportedValue("ICheckPortfolioWBVM.aUri", CVM.MyUri);
            container.ComposeExportedValue("ICheckPortfolioWBVM.aCommonVM", CVM);
            container.ComposeExportedValue("ICheckPortfolioWBVM.aColumn", 0);
            container.ComposeExportedValue("ICheckPortfolioWBVM.aRow", 1);
            container.ComposeExportedValue("ICheckPortfolioWBVM.aPortFolio", "角川ドワンゴ");

            container.ComposeExportedValue("ICheckShareWBVM.aUri", CVM.MyUri);
            container.ComposeExportedValue("ICheckShareWBVM.aCommonVM", CVM);
            container.ComposeExportedValue("ICheckShareWBVM.aColumn", 0);
            container.ComposeExportedValue("ICheckShareWBVM.aRow", 2);

            container.ComposeParts(this);

            WatchSpecificShareVMCollection = new Collection<IWatchSpecificShareVM>();
            //            WatchSpecificShareVMCollection.Add(new WatchSpecificShareVM(CVM.MyUri, CVM, 0, 3, 3715));

            CVM.BuyShare += CVM_BuyShare;
            CVM.BuyShareEnd += CVM_BuyShareEnd;
            CVM.SellShare += CVM_SellShare;
            CVM.SellShareEnd += CVM_SellShareEnd;
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the WebBrowserVM class.
        /// </summary>
        public ACheckWBVM(Uri aUri, CommonVM aCommonVM, Int32 aColumn, Int32 aRow)
            : base(aCommonVM)
        {
            MyGrid = new MyWebBrowser();
            MyGrid.DataContext = this;
            Grid.SetRow(MyGrid, aRow);
            Grid.SetColumn(MyGrid, aColumn);
            Grid.SetColumnSpan(MyGrid, 3);

            MyUri = aUri;
            WB = this.MyGrid.Children.OfType<WebBrowser>().First();
            MyStatus = Status.Watching;

            _MyDispatcherTimer = new DispatcherTimer(new TimeSpan(30 * TimeSpan.TicksPerSecond),
                                                     DispatcherPriority.Normal,
                                                     MyDispatcherTimer_Tick,
                                                     Dispatcher.CurrentDispatcher) { IsEnabled = false };

            LoadCompletedCommand = new RelayCommand<WebBrowser>(LoadCompletedEvent);

            User = CVM.GetIniData("login.ini", "LOGIN", "USER");
            Pass = CVM.GetIniData("login.ini", "LOGIN", "PASS");
        }
 /// <summary>
 /// Initializes a new instance of the WebBrowserVM class.
 /// </summary>
 public WatchSpecificShareVM(Uri aUri, CommonVM aCommonVM, Int32 aColumn, Int32 aRow, Int32 aCode)
     : base(aUri, aCommonVM, aColumn, aRow, aCode)
 {
     LoadCompletedCommand = new RelayCommand<WebBrowser>(LoadCompletedEvent);
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the MyViewModelBase class.
 /// </summary>
 public MyViewModelBase(CommonVM aCVM)
 {
     CVM = aCVM;
 }