public ProfileEditorViewModel(ProfileModule module, ICollection <ProfileEditorPanelViewModel> viewModels, IProfileEditorService profileEditorService, IProfileService profileService, IDialogService dialogService, ISettingsService settingsService) { _profileEditorService = profileEditorService; _profileService = profileService; _settingsService = settingsService; DisplayName = "Profile editor"; Module = module; DialogService = dialogService; DisplayConditionsViewModel = (DisplayConditionsViewModel)viewModels.First(vm => vm is DisplayConditionsViewModel); LayerPropertiesViewModel = (LayerPropertiesViewModel)viewModels.First(vm => vm is LayerPropertiesViewModel); ProfileTreeViewModel = (ProfileTreeViewModel)viewModels.First(vm => vm is ProfileTreeViewModel); ProfileViewModel = (ProfileViewModel)viewModels.First(vm => vm is ProfileViewModel); Profiles = new BindableCollection <Profile>(); Items.AddRange(viewModels); module.ActiveProfileChanged += ModuleOnActiveProfileChanged; }
private void _Click(object sender, RoutedEventArgs e) { var tag = (e.OriginalSource as Button)?.Tag as string; if (tag == null) { return; } if (tag == "apply") { ProfileModule.SetProfile(uiNameBox.Text, uiSignBox.Text); } else if (tag == "image") { var ofd = new System.Windows.Forms.OpenFileDialog() { Filter = "位图文件|*.bmp;*.png;*.jpg" }; if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } try { ProfileModule.SetImage(ofd.FileName); } catch (Exception ex) { Entrance.ShowError("设置头像失败!", ex); Log.Error(ex); } } }
public ProfileEditorViewModel(ProfileModule module, ProfileViewModel profileViewModel, ProfileTreeViewModel profileTreeViewModel, DisplayConditionsViewModel dataModelConditionsViewModel, LayerPropertiesViewModel layerPropertiesViewModel, IProfileEditorService profileEditorService, IProfileService profileService, IDialogService dialogService, ISettingsService settingsService, IModuleService moduleService, ISnackbarMessageQueue snackbarMessageQueue) { _profileEditorService = profileEditorService; _profileService = profileService; _settingsService = settingsService; _moduleService = moduleService; _snackbarMessageQueue = snackbarMessageQueue; DisplayName = "PROFILE EDITOR"; Module = module; DialogService = dialogService; Profiles = new BindableCollection <ProfileDescriptor>(); // Populate the panels ProfileViewModel = profileViewModel; ProfileTreeViewModel = profileTreeViewModel; DisplayConditionsViewModel = dataModelConditionsViewModel; LayerPropertiesViewModel = layerPropertiesViewModel; Items.Add(ProfileViewModel); Items.Add(ProfileTreeViewModel); Items.Add(dataModelConditionsViewModel); Items.Add(LayerPropertiesViewModel); }
private void _Click(object sender, RoutedEventArgs e) { var tag = (e.OriginalSource as Button)?.Tag as string; if (tag == null) { return; } if (tag == "exit") { LinkModule.Shutdown(); Application.Current.MainWindow.Close(); } else if (tag == "out") { var mai = Application.Current.MainWindow as Entrance; if (mai == null) { return; } LinkModule.Shutdown(); ProfileModule.Shutdown(); mai.frame.Navigate(new Connection()); } }
public ProfileImportViewModel(ProfileModule profileModule, IProfileService profileService, IMessageService messageService) { ProfileModule = profileModule; _profileService = profileService; _messageService = messageService; }
public ActionResult ContactMe(ProfileModule profilemodule) { if (ModelState.IsValid) { var body = "<p>Email From: {0} ({1})</p><p>Message:</p><p>{2}</p>"; var message = new MailMessage(); message.To.Add(new MailAddress("*****@*****.**")); // your email address message.From = new MailAddress(profilemodule.ContactEmail); // sender email address message.Subject = "Email from my online Resume"; message.Body = string.Format(body, profilemodule.ContactName, profilemodule.ContactEmail, profilemodule.ContactComment); message.IsBodyHtml = true; using (var smtp = new SmtpClient()) { var credential = new NetworkCredential { UserName = "******", // email id Password = "******" // password }; smtp.Credentials = credential; smtp.Host = "smtp-mail.outlook.com"; smtp.Port = 587; smtp.EnableSsl = true; smtp.Send(message); //return RedirectToAction("Sent"); ViewBag.Message = OnlineResumeRes.Emailhassend; //"Your message has been sent"; return((ActionResult)this.RedirectToAction("Index", "Home")); } } return(View(profilemodule)); }
public ProfileEditorViewModel(ProfileModule module, ProfileViewModel profileViewModel, ProfileTreeViewModel profileTreeViewModel, DisplayConditionsViewModel dataModelConditionsViewModel, LayerPropertiesViewModel layerPropertiesViewModel, IProfileEditorService profileEditorService, IProfileService profileService, IDialogService dialogService, ISettingsService settingsService, IModuleService moduleService, IMessageService messageService) { _profileEditorService = profileEditorService; _profileService = profileService; _settingsService = settingsService; _moduleService = moduleService; _messageService = messageService; DisplayName = "PROFILE EDITOR"; Module = module; DialogService = dialogService; Profiles = new BindableCollection <ProfileDescriptor>(); // Populate the panels ProfileViewModel = profileViewModel; ProfileViewModel.ConductWith(this); ProfileTreeViewModel = profileTreeViewModel; ProfileTreeViewModel.ConductWith(this); DisplayConditionsViewModel = dataModelConditionsViewModel; DisplayConditionsViewModel.ConductWith(this); LayerPropertiesViewModel = layerPropertiesViewModel; LayerPropertiesViewModel.ConductWith(this); }
internal DataModelJsonPluginEndPoint(ProfileModule <T> profileModule, string name, PluginsModule pluginsModule) : base(profileModule, name, pluginsModule) { _profileModule = profileModule ?? throw new ArgumentNullException(nameof(profileModule)); ThrowOnFail = true; Accepts = MimeType.Json; }
public ProfileImportViewModel(ProfileModule profileModule, IProfileService profileService, ISnackbarMessageQueue mainMessageQueue) { ProfileModule = profileModule; Document = new TextDocument(); _profileService = profileService; _mainMessageQueue = mainMessageQueue; }
public ProfileImportViewModel(ProfileModule profileModule, IProfileService profileService, IMessageService messageService) { ProfileModule = profileModule; Document = new TextDocument(); _profileService = profileService; _messageService = messageService; }
internal ProfileDescriptor(ProfileModule profileModule, ProfileEntity profileEntity) { ProfileModule = profileModule; Id = profileEntity.Id; Name = profileEntity.Name; IsLastActiveProfile = profileEntity.IsActive; }
public async Task ActivateLastProfileAnimated(ProfileModule profileModule) { ProfileDescriptor activeProfile = GetLastActiveProfile(profileModule); if (activeProfile != null) { await ActivateProfileAnimated(activeProfile); } }
public void ActivateLastProfile(ProfileModule profileModule) { ProfileDescriptor activeProfile = GetLastActiveProfile(profileModule); if (activeProfile != null) { ActivateProfile(activeProfile); } }
public void ActivateProfile(ProfileModule module, Profile profile) { module.ChangeActiveProfile(profile, _surfaceService.ActiveSurface); if (profile != null) { InstantiateProfileLayerBrushes(profile); InstantiateProfileKeyframeEngines(profile); } }
public ProfileDescriptor CreateProfileDescriptor(ProfileModule module, string name) { ProfileEntity profileEntity = new ProfileEntity { Id = Guid.NewGuid(), Name = name, PluginGuid = module.PluginInfo.Guid }; _profileRepository.Add(profileEntity); return(new ProfileDescriptor(module, profileEntity)); }
public ProfileDescriptor ImportProfile(string json, ProfileModule profileModule) { ProfileEntity profileEntity = JsonConvert.DeserializeObject <ProfileEntity>(json, ExportSettings); // Assign a new GUID to make sure it is unique in case of a previous import of the same content profileEntity.UpdateGuid(Guid.NewGuid()); profileEntity.Name = $"{profileEntity.Name} - Imported"; _profileRepository.Add(profileEntity); return(new ProfileDescriptor(profileModule, profileEntity)); }
internal Profile(ProfileModule module, ProfileEntity profileEntity) { Profile = this; ProfileEntity = profileEntity; EntityId = profileEntity.Id; Module = module; UndoStack = new Stack <string>(); RedoStack = new Stack <string>(); Load(); }
private void _SendText() { var str = uiInputBox.Text.TrimEnd(new char[] { '\0', '\r', '\n', '\t', ' ' }); if (str.Length < 1) { return; } uiInputBox.Text = string.Empty; PostModule.Text(_profile.Id, str); ProfileModule.SetRecent(_profile); }
public static void _ListBoxSelectionChanged(object sender, SelectionChangedEventArgs e) { var lst = e.AddedItems; if (lst.Count < 1) { return; } var itm = lst[0] as Profile; ProfileModule.SetInscope(itm); }
public ProfileDescriptor GetLastActiveProfile(ProfileModule module) { List <ProfileEntity> moduleProfiles = _profileRepository.GetByPluginGuid(module.PluginInfo.Guid); if (!moduleProfiles.Any()) { return(CreateProfileDescriptor(module, "Default")); } ProfileEntity profileEntity = moduleProfiles.FirstOrDefault(p => p.IsActive) ?? moduleProfiles.FirstOrDefault(); return(profileEntity == null ? null : new ProfileDescriptor(module, profileEntity)); }
public Profile CreateProfile(ProfileModule module, string name) { var profile = new Profile(module.PluginInfo, name); _profileRepository.Add(profile.ProfileEntity); if (_surfaceService.ActiveSurface != null) { profile.PopulateLeds(_surfaceService.ActiveSurface); } return(profile); }
public DataModelJsonPluginEndPoint <T> AddDataModelJsonEndPoint <T>(ProfileModule <T> profileModule, string endPointName) where T : DataModel { if (profileModule == null) { throw new ArgumentNullException(nameof(profileModule)); } if (endPointName == null) { throw new ArgumentNullException(nameof(endPointName)); } DataModelJsonPluginEndPoint <T> endPoint = new(profileModule, endPointName, PluginsModule); PluginsModule.AddPluginEndPoint(endPoint); return(endPoint); }
private void SaveActiveProfile(ProfileModule module) { if (module.ActiveProfile == null) { return; } List <ProfileEntity> profileEntities = _profileRepository.GetByPluginGuid(module.PluginInfo.Guid); foreach (ProfileEntity profileEntity in profileEntities) { profileEntity.IsActive = module.ActiveProfile.EntityId == profileEntity.Id; _profileRepository.Save(profileEntity); } }
internal Profile(ProfileModule module, string name) { ProfileEntity = new ProfileEntity(); EntityId = Guid.NewGuid(); Profile = this; Module = module; Name = name; UndoStack = new Stack <string>(); RedoStack = new Stack <string>(); Folder _ = new Folder(this, "Root folder"); Save(); }
public void RedoUpdateProfile(Profile profile, ProfileModule module) { if (!profile.RedoStack.Any()) { return; } ActivateProfile(module, null); var top = profile.RedoStack.Pop(); var memento = JsonConvert.SerializeObject(profile.ProfileEntity); profile.UndoStack.Push(memento); profile.ProfileEntity = JsonConvert.DeserializeObject <ProfileEntity>(top); profile.ApplyToProfile(); ActivateProfile(module, profile); }
public void InitializeHttpEvents(HttpApplication application) { SannsynConfiguration sannsynConfiguration = ServiceLocator.Current.GetInstance <SannsynConfiguration>(); if (sannsynConfiguration.ModuleEnabled) { for (int i = 0; i < application.Modules.Count; i++) { ProfileModule module = application.Modules[i] as ProfileModule; if (module != null) { module.MigrateAnonymous += OnMigrateAnonymous; _log.Debug("Initializing Anonymous Migration Module"); } } } }
public Profile GetActiveProfile(ProfileModule module) { if (module.ActiveProfile != null) { return(module.ActiveProfile); } var moduleProfiles = _profileRepository.GetByPluginGuid(module.PluginInfo.Guid); var profileEntity = moduleProfiles.FirstOrDefault(p => p.IsActive) ?? moduleProfiles.FirstOrDefault(); if (profileEntity == null) { return(null); } return(new Profile(module.PluginInfo, profileEntity)); }
public void Profile() { var cid = Data["id"].As <int>(); var pro = new Profile(cid) { Name = Data["name"].As <string>(), Text = Data["text"].As <string>(), }; var buf = Data["image"].As <byte[]>(); if (buf.Length > 0) { pro.Image = CacheModule.SetBuffer(buf, true); } ProfileModule.Insert(pro); }
public List <Profile> GetProfiles(ProfileModule module) { var profileEntities = _profileRepository.GetByPluginGuid(module.PluginInfo.Guid); var profiles = new List <Profile>(); foreach (var profileEntity in profileEntities) { // If the profile entity matches the module's currently active profile, use that instead if (module.ActiveProfile != null && module.ActiveProfile.EntityId == profileEntity.Id) { profiles.Add(module.ActiveProfile); } else { profiles.Add(new Profile(module.PluginInfo, profileEntity)); } } return(profiles); }
private void _PushImage() { var ofd = new OpenFileDialog() { Filter = "位图文件|*.bmp;*.png;*.jpg" }; if (ofd.ShowDialog() != true) { return; } try { var buf = CacheModule.ImageZoom(ofd.FileName); PostModule.Image(_profile.Id, buf); ProfileModule.SetRecent(_profile); } catch (Exception ex) { Log.Error(ex); Entrance.ShowError("发送图片失败", ex); } }
public static void AddModules(int id, List<int> modules) { try { EcommercePlatformDataContext db = new EcommercePlatformDataContext(); List<ProfileModule> new_mods = new List<ProfileModule>(); foreach (int m in modules) { // Make sure we don't have a record for this user that ties them to the looped module ProfileModule pm = db.ProfileModules.Where(x => x.moduleID.Equals(m) && x.profileID.Equals(id)).FirstOrDefault<ProfileModule>(); if (pm == null) { ProfileModule pm_new = new ProfileModule { moduleID = m, profileID = id }; new_mods.Add(pm_new); } } db.ProfileModules.InsertAllOnSubmit<ProfileModule>(new_mods); db.SubmitChanges(); } catch (Exception) { throw new Exception(); } }