///<summary> Обработчик нажатия на пункт меню учасники чата </summary> private void ContextMenuChatMembers_OnClick(object sender, RoutedEventArgs e) { var modelChat = ListBoxChat.SelectedItem as ModelChat; if (modelChat == null) { return; } //var rightWorkspaceContent = WindowMain.GetRightWorkspaceContent(); //var existChatMessageDetail = rightWorkspaceContent != null ? rightWorkspaceContent is ViewChatMessageDetail : true; //var chatMessageDetail = existChatMessageDetail ? rightWorkspaceContent as ViewChatMessageDetail : null; //var createNewViewChatMessageDetail = chatMessageDetail != null ? chatMessageDetail.CurrentModelChat.Id != _viewModelChat.CurrentModelChat.Id: false; var chatMessageDetail = WindowMain.GetRightWorkspaceContent() as ViewChatMessageDetail; if (chatMessageDetail?.CurrentModelChat.Id != _viewModelChat.CurrentModelChat.Id) { var viewChatMessageDetail = new ViewChatMessageDetail(modelChat); WindowMain.ShowInRightWorkspace(viewChatMessageDetail); viewChatMessageDetail.OnInviteMembers_MouseClick(null, null); } else { chatMessageDetail?.OnInviteMembers_MouseClick(null, null); } }
public ProjectDataBase(WindowMain incomeMain, Panel inWindowContainer, WindowTabControlBase incomeWindow, string incomeTitle, IDataController incomeDataController, IRelation incomeRelation) : base(incomeMain, inWindowContainer, incomeWindow, incomeTitle, incomeDataController, incomeRelation) { windowData = (WindowTabControlDataBase)incomeWindow; dataBase = (DataControllerEPlan)incomeDataController; windowData.ClassWindow = this; }
public App() { //var x = new SngRegistratorManager(); //x.Start(); //return; RegisterHook(); TableTileManager = new TableTileManager(); PokerTypeManager = new PokerTypeManager(); RandomizerManager = new RandomizerManager(); HandHistoryManager = new HandHistoryManager(); Handler = new Handler(); TableManager = new TableManager(); Config.LoadXml(); WindowMain = new WindowMain(); WindowMain.Show(); if (!CheckGnuGplV3Agreement()) { return; } HandHistoryManager.ObserverStatus = WindowMain.UcStatusBar; HandHistoryManager.ObserverHands = WindowMain.UCHands; TableManager.ObserverTableManagerTableList = WindowMain.UCTables; TableManager.ObserverTableManagerTableCount = WindowMain.UcStatusBar; ReleaseOnly(); }
///<summary> Обработчик изменения видимости приглашений и запросов </summary> private void ViewContactRequestInviteOnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { if (!(WindowMain.GetRightWorkspaceContent() is ViewContactRequestInvite)) { GridRequestInvite.Background = Brushes.Transparent; } }
///<summary> Обработчик изменения видимости поиска контактов в директории </summary> private void ViewContactDirectoryOnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { if (!(WindowMain.GetRightWorkspaceContent() is ViewContactDirectory)) { GridFindNewContact.Background = Brushes.Transparent; } }
List <Week> weeks; //список учебных недель, рассчитанных из календарного года public ProjectSchedule(WindowMain incomeMain, Panel inWindowContainer, WindowTabControlBase incomeWindow, String incomeTitle, IDataController incomeDataController, IRelation incomeRelation) : base(incomeMain, inWindowContainer, incomeWindow, incomeTitle, incomeDataController, incomeRelation) { months = new Dictionary <int, Month>(); months.Add(1, new Month(1, "Январь", 31)); if (DateTime.IsLeapYear(DateTime.Now.Year)) { months.Add(2, new Month(2, "Февраль", 29)); } else { months.Add(2, new Month(2, "Февраль", 28)); } months.Add(3, new Month(3, "Март", 31)); months.Add(4, new Month(4, "Апрель", 30)); months.Add(5, new Month(5, "Май", 31)); months.Add(6, new Month(6, "Июнь", 30)); months.Add(7, new Month(7, "Июль", 31)); months.Add(8, new Month(8, "Август", 31)); months.Add(9, new Month(9, "Сентябрь", 30)); months.Add(10, new Month(10, "Октябрь", 31)); months.Add(11, new Month(11, "Ноябрь", 30)); months.Add(12, new Month(12, "Декабрь", 31)); weeks = new List <Week>(); ((WindowTabControlEProcess)incomeWindow).ClassWindow = this; }
///<summary> Обработчик нажатия на пункт меню отправить сообщение</summary> private void ContextMenuWriteMessage_OnClick(object sender, RoutedEventArgs e) { if (_viewModelCallHistory.CurrentModelCallHistoryPeer.ModelPeerObj.IsDodicall) { WindowMain.ShowInRightWorkspace(new ViewChatMessageDetail(_viewModelCallHistory.CurrentModelCallHistoryPeer.ModelPeerObj.ModelContactObj)); } }
public async void Start() { var watch = new Stopwatch( ); watch.Start( ); var taskList = new List <Task> { _container.Resolve <ResourcePlayer>( ).InitializeAsync( ), //=> Loading Player Resources _container.Resolve <ResourceAlly>( ).InitializeAsync( ), //=> Loading Ally Resources _container.Resolve <ResourceVillage>( ).InitializeAsync( ), //=> Loading Village Resources _container.Resolve <ResourceConquer>( ).InitializeAsync( ), //=> Loading Conquer Resources _container.Resolve <ResourceBashpointAlly>( ).InitializeAsync( ), //=> Loading Bashpoint Ally Resources _container.Resolve <ResourceBashpointPlayer>( ).InitializeAsync( ), //=> Loading Bashpoint Player Resources _container.Resolve <ResourceTroup>( ).Load( ) //=> Loading Troup Saves }; await Task.WhenAll(taskList); watch.Stop( ); TrayIcon.ShowInfo("Welcome to Venom!", "Loading finished in " + watch.ElapsedMilliseconds + "ms"); //WindowStart.Close( ); //=> Loading finished, close main window WindowMain.Show( ); //=> Show main window }
public static void Main() { Application app = new Application(); WindowMain wnd = new WindowMain(); app.Run(wnd); }
/// <summary> Обработчик клика по профилю </summary> private void OpenUserDetail(object sender, MouseButtonEventArgs e) { var viewUserDetail = new ViewUserDetail(_modelUser); viewUserDetail.IsVisibleChanged += (o, args) => { Background = (bool)args.NewValue ? Brushes.WhiteSmoke : Brushes.Transparent; }; WindowMain.ShowInRightWorkspace(viewUserDetail); }
/// <summary> показать звонок </summary> public static void ShowCall(ViewModelCallActive viewModelCallActive) { if (viewModelCallActive == null) { return; } WindowMain.ShowInRightWorkspaceFront(new ViewCallActive(viewModelCallActive)); }
/// <summary> Исходящий звонок </summary> public static void OutgoingCall(string number) { if (String.IsNullOrWhiteSpace(number)) { return; } WindowMain.ShowInRightWorkspaceFront(new ViewCallActive(number)); }
/// <summary> Исходящий звонок </summary> public static void OutgoingCall(ModelContact modelContact) { if (modelContact == null) { return; } WindowMain.ShowInRightWorkspaceFront(new ViewCallActive(modelContact)); }
///<summary> Обработчик нажатия на кнопку приглашений и запросов </summary> private void ButtonRequestInvite_OnClick(object sender, RoutedEventArgs e) { var viewContactRequestInvite = new ViewContactRequestInvite(); WindowMain.ShowInRightWorkspace(viewContactRequestInvite); GridRequestInvite.Background = Brushes.WhiteSmoke; viewContactRequestInvite.IsVisibleChanged += ViewContactRequestInviteOnIsVisibleChanged; }
///<summary> Обработчик нажатия на кнопку поиска новых контактов </summary> private void ButtonFindNewContact_OnClick(object sender, RoutedEventArgs e) { var viewContactDirectory = new ViewContactDirectory(); WindowMain.ShowInRightWorkspace(viewContactDirectory); GridFindNewContact.Background = Brushes.WhiteSmoke; viewContactDirectory.IsVisibleChanged += ViewContactDirectoryOnIsVisibleChanged; }
/// <summary> Обработчик выбора контакта </summary> private void ItemContact_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { var modelContact = ListBoxContact.SelectedItem as ModelContact; WindowMain.ShowInRightWorkspace(new ViewChatMessageDetail(modelContact, _listRedirectModelMessage)); ViewChat.CurrentViewChat.SetModelChat(modelContact); OnCloseWindow(); }
public ProjectBase(WindowMain incomeMain, Panel inWindowContainer, WindowTabControlBase incomeWindow, String incomeTitle, IDataController incomeDataController, IRelation incomeRelation) { m_parent = incomeMain; m_window = incomeWindow; m_title = incomeTitle; m_windowConteiner = inWindowContainer; DataControllerBehaviour = incomeDataController; RelationBehaviour = incomeRelation; // class to m_window }
///<summary> Обработчик изменения выбора ListBoxCallHistory </summary> private void ListBoxCallHistory_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (ListBoxCallHistory.SelectedItem != null) { var modelCallHistoryPeer = (ModelCallHistoryPeer)ListBoxCallHistory.SelectedItem; _viewModelCallHistory.SetModelCallHistoryReaded(modelCallHistoryPeer); WindowMain.ShowInRightWorkspace(new ViewCallHistoryDetail(modelCallHistoryPeer)); } }
///<summary> Обработчик клика по элементу звонка в ListBoxCallHistory </summary> private void GridCallItem_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (ListBoxCallHistory.SelectedItem != null && !(WindowMain.GetRightWorkspaceContent() is ViewCallHistoryDetail)) { var modelCallHistoryPeer = (ModelCallHistoryPeer)ListBoxCallHistory.SelectedItem; _viewModelCallHistory.SetModelCallHistoryReaded(modelCallHistoryPeer); WindowMain.ShowInRightWorkspace(new ViewCallHistoryDetail(modelCallHistoryPeer)); } }
public static void Main() { WindowMain wnd = new WindowMain(); Application.Run(wnd); var browser = wnd.browserView.Browser; wnd.browserView.Dispose(); browser.Dispose(); }
///<summary> Обработчик смены текущего чата </summary> private void Grid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { var modelChat = ListBoxChat.SelectedItem as ModelChat; if (modelChat == null) { return; } WindowMain.ShowInRightWorkspace(new ViewChatMessageDetail(modelChat)); }
static void Main() { if (!BouncyCastle.IntegrityCheck()) { MessageBox.Show("BouncyCastle assembly integrity check failed."); return; } try { WindowMain window = new WindowMain(); window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Width = (int)ConfigFile.RegistryGet("Width", 800); window.Height = (int)ConfigFile.RegistryGet("Height", 600); window.FontFamily = new FontFamily((string)ConfigFile.RegistryGet("FontFamily", "Courier New")); window.FontSize = (int)ConfigFile.RegistryGet("FontSize", 12); MenuItem menuOptions = Add(window.m_menu.Items, "Options"); foreach (var family in Fonts.SystemFontFamilies) { MenuItem item = Add(menuOptions.Items, family); item.IsChecked = family.Source == window.FontFamily.Source; item.Click += (sender, e) => { window.FontFamily = family; foreach (MenuItem x in menuOptions.Items) { x.IsChecked = x == item; } }; } Add(window.m_menu.Items, " - ").Click += (sender, e) => window.FontSize = Math.Max(8.0, window.FontSize / 1.1); Add(window.m_menu.Items, " + ").Click += (sender, e) => window.FontSize *= 1.1; MenuItem menuHelp = Add(window.m_menu.Items, "Help"); Add(menuHelp.Items, "http://minicryptowallet.com/").Click += (sender, e) => System.Diagnostics.Process.Start("http://minicryptowallet.com/"); new Application().Run(window); ConfigFile.RegistrySet("Width", (int)window.Width); ConfigFile.RegistrySet("Height", (int)window.Height); ConfigFile.RegistrySet("FontFamily", window.FontFamily.Source); ConfigFile.RegistrySet("FontSize", (int)window.FontSize); } catch (Exception e) { MessageBox.Show(e.Message); } }
public ProjectEPlan(WindowMain incomeMain, Panel inWindowContainer, WindowTabControlBase incomeWindow, String incomeTitle, IDataController incomeDataController, IRelation incomeRelation) : base(incomeMain, inWindowContainer, incomeWindow, incomeTitle, incomeDataController, incomeRelation) { min_srs = 30; max_srs = 70; kred = 30; min_kredits_per_disc = 1; max_kredits_per_disc = 8; hours_in_kred = 30; weeks = 30; max_hours_per_disc = 20; min_hours_per_disc = 1; disciplines = new List <Discipline>(); srs_values = new Dictionary <Tuple <decimal, decimal>, float>(); ((WindowTabControlEPlan)incomeWindow).ClassWindow = this; }
///<summary> Добавить контакт в список (Временный кастыль для демо !!!) </summary> public void AddContactListBoxContact(ModelContact modelContact, bool showDetailInRightWorkspace) { var modelContactFromList = _viewModelContact.CurrentListModelContact.FirstOrDefault(obj => obj.Id == modelContact.Id); if (modelContactFromList == null) { _viewModelContact.ListModelContact.Add(modelContact); _viewModelContact.ApplyFilter(); } if (showDetailInRightWorkspace) { SetSelectedListBoxContact(modelContact); WindowMain.ShowInRightWorkspace(new ViewContactDetail(modelContact)); } }
///<summary> Удалить контакт из списока (Временный кастыль для демо !!!) </summary> public void DeleteContactListBoxContact(ModelContact modelContact) { var modelContactFromList = _viewModelContact.CurrentListModelContact.FirstOrDefault(obj => obj.Id == modelContact.Id); if (modelContactFromList != null) { _viewModelContact.ListModelContact.Remove(modelContact); _viewModelContact.ApplyFilter(); } var userControl = WindowMain.GetRightWorkspaceContent() as ViewContactDetail; if (userControl != null && userControl.CurrentModelContact.Id == modelContact.Id) { WindowMain.ShowInRightWorkspace(null); } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); IUnityContainer container = new UnityContainer(); container.RegisterType <IServiceSetting, ServiceSettingStatic>(); var mainWindow = new WindowMain() { DataContext = new ViewModelContainerSearch(container.Resolve <IServiceSetting>()) { } }; // var t = (new WindowLogin()).ShowDialog(); // if (t == true) mainWindow.ShowDialog(); System.Environment.Exit(7); }
private void continue_Click(object sender, RoutedEventArgs e) { Properties.Settings.Default.projectDiameter = false; Properties.Settings.Default.projectWeb = false; Properties.Settings.Default.projectTension = false; Properties.Settings.Default.projectTransmitter = false; Properties.Settings.Default.Save(); if (diameter.IsChecked == true) { Properties.Settings.Default.projectDiameter = true; MainPage mainPage = new MainPage(); mainPage.Show(); } else if (web.IsChecked == true) { HomeScreen homeScreen = new HomeScreen(); homeScreen.Show(); } else if (tension.IsChecked == true) { Properties.Settings.Default.projectTension = true; MainWindow mainWindow = new MainWindow(); mainWindow.Show(); } else if (transmitter.IsChecked == true) { Properties.Settings.Default.projectTransmitter = true; WindowMain mainWindow = new WindowMain(); mainWindow.Show(); } Properties.Settings.Default.signedIn = true; Properties.Settings.Default.userFirstTime = false; Properties.Settings.Default.Save(); this.Close(); }
private void openSelectedProject() { if (Properties.Settings.Default.projectDiameter) { MainPage mainPage = new MainPage(); mainPage.Show(); } else if (Properties.Settings.Default.projectWeb) { HomeScreen homeScreen = new HomeScreen(); homeScreen.Show(); } else if (Properties.Settings.Default.projectTension) { MainWindow mainWindow = new MainWindow(); mainWindow.Show(); } else if (Properties.Settings.Default.projectTransmitter) { WindowMain mainWindow = new WindowMain(); mainWindow.Show(); } welcomeScreen.Close(); }
///<summary> Открыть карточку контакта </summary> private void OpenModelContactDetail(ModelContact modelContact) { if (modelContact == null) { return; } var userControl = WindowMain.GetRightWorkspaceContent(); if (userControl != null && (userControl as ViewContactDetail)?.CurrentModelContact.Id == modelContact.Id) { var userControlFront = WindowMain.GetRightWorkspaceFrontContent(); // проверить на null и попробовать привести к ViewCallActive if (userControlFront != null && userControlFront is ViewCallActive) { WindowMain.CloseInRightWorkspaceFront(); } return; } WindowMain.ShowInRightWorkspace(new ViewContactDetail(modelContact)); }
///<summary> Обработчик изменения ViewModelChat </summary> private void ViewModelChatOnPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName.Equals("CurrentListModelChat", StringComparison.InvariantCultureIgnoreCase)) { int count; var viewChatMessageDetail = WindowMain.GetRightWorkspaceContent() as ViewChatMessageDetail; if (viewChatMessageDetail != null && viewChatMessageDetail.IsScrollAtBottom) { var chatId = viewChatMessageDetail.CurrentModelChat.Id; var list = _viewModelChat.CurrentListModelChat.Where(obj => obj.Id != chatId); count = list.Sum(obj => obj.NewMessagesCount); } else { count = _viewModelChat.CurrentListModelChat.Sum(obj => obj.NewMessagesCount); } OnCountUnreadMessageChanged(count); } }