protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); System.Diagnostics.Debug.WriteLine(DateTime.Now.TimeOfDay + " OnStartup"); _WorkItem = new MainWorkItem(); MainWindow = _WorkItem.MainWindow; bool noupdate = false; if (e.Args.Length > 0 && e.Args[0] == "-noupdate") { noupdate = true; } _WorkItem.Commands.Start.Execute(noupdate); }
public void Init( MainWorkItem workItem, AppGroup appGroup, AppInfo appInfo, AppType appType, DeletedAppCollection deletedApps, AppStatCollection stat) { _AppGroup = appGroup; _Controller = new AppManagerController(workItem); AppTypes.ItemsSource = appGroup.AppTypes; _AppTypes = appGroup.AppTypes; AppTypeSelector.ItemsSource = appGroup.AppTypes; DeletedAppList.ItemsSource = deletedApps; _DeletedApps = deletedApps; StatList.ItemsSource = stat; //AppScanType.ItemsSource = appGroup.AppTypes; if (appInfo != null) { AppType selAppType = appGroup.FindAppType(appInfo); AppTypes.SelectedItem = selAppType; AppTypeSelector.SelectedItem = selAppType; _ItemToSelect = appInfo; AppList.SelectedItem = appInfo; AppTabs.SelectedIndex = 1; } if (appType != null) { AppType selAppType = appGroup.AppTypes.FindBySource(appType); AppTypes.SelectedItem = selAppType; AppTypeSelector.SelectedItem = selAppType; _ItemToSelect = appGroup.CreateNewAppInfo(selAppType); AppList.SelectedItem = _ItemToSelect; AppTabs.SelectedIndex = 1; } }
public MainWindow(MainWorkItem workItem) { InitializeComponent(); _FocusElement = AppTypeContent; _NativeWindow = new System.Windows.Interop.WindowInteropHelper(this); //ContentPanel.Children.Clear(); //ContentPanel.RowDefinitions.Clear(); _Controller = new MainWindowController(workItem); InitCommands(_Controller.WorkItem.Commands); _AppDrop = new SimpleDragDataHandler( ButtonListDrag <AppInfo> .DragDataFormat, typeof(AppInfo), AppGroupLoader.Default); _AppDrop.ObjectDroped += (s, e) => _Controller.AddApp( ((s as FrameworkElement).DataContext as AppTypeView).Source, e.DropObject as AppInfo); _AppTypeDrop = new SimpleDragDataHandler( AppTypeDrag.DragDataFormat, typeof(AppType), AppGroupLoader.Default); _AppTypeDrop.ObjectDroped += (s, e) => _Controller.InsertAppType( _AppData, e.DropObject as AppType, ((s as FrameworkElement).DataContext as AppTypeView).Source); _FileDrop.AddFiles += (s, e) => OnDropFiles(s as FrameworkElement, e); workItem.Settings.PropertyChanged += Settings_PropertyChanged; new BorderResizer(MainContentBorder, 8); }
public void InitData(MainWorkItem workItem) { _AppData = workItem.AppData; DataContext = workItem; }
public AppController(MainWorkItem workItem) : base(workItem) { }
public HelpBoxController(MainWorkItem workItem) : base(workItem) { _WorkItem.UpdateCompleted += WorkItem_UpdateCompleted; }
public MainWindowController(MainWorkItem workItem) : base(workItem) { _SearchTimer.Interval = new TimeSpan(0, 0, 60); _SearchTimer.Tick += (s, e) => _QuickSearchWnd.Close(); }
public AppManagerController(MainWorkItem workItem) : base(workItem) { //_Data = data; }