private void LoadData() { if (!File.Exists(_dataFilename)) { UpdateStatusStripLabel("Please setup general settings."); return; } using (StreamReader r = new StreamReader(_dataFilename)) { string json = r.ReadToEnd(); CustomDataObject data = JsonConvert.DeserializeObject <CustomDataObject>(json); txtClientName.Text = data.ClientName; chkFullScreen.Checked = data.FullScreenWhenAuto; chkFullScreen.CheckState = data.FullScreenWhenAuto ? CheckState.Checked : CheckState.Unchecked; txtScreenResolutionX.Text = data.ScreenResolution.X.ToString(); txtScreenResolutionY.Text = data.ScreenResolution.Y.ToString(); Master.Instance.ScreenResolution = data.ScreenResolution; foreach (Profile profile in data.Profiles) { TabPage tp = new TabPage(profile.Name); UControlContext context = new UControlContext(IntPtr.Zero, chkFullScreen.Checked); context.LoadData(profile.Data); tp.Controls.Add(context); tabUControl.TabPages.Add(tp); } } }
public async Task CreateGetAppendAndDeleteCustomDataObject() { var client = await GetTestClientAsync(); var existingCdos = await client.Company.GlobalCustomDataObjects.GetCustomDataObjectsAsync(); const string firstText = "Hello World!"; var cdo = new CustomDataObject(Guid.NewGuid().ToString().Substring(0, 8) + ".txt", Encoding.UTF8.GetBytes(firstText)); await client.Company.GlobalCustomDataObjects.CreateOrReplaceCustomDataObjectAsync(cdo); await Task.Delay(10000); var cdo2 = await client.Company.GlobalCustomDataObjects.GetCustomDataObjectAsync(cdo.Name); Assert.AreEqual(firstText, Encoding.UTF8.GetString(cdo.DataObject)); await Task.Delay(10000); const string secondText = "Goodbye World!"; cdo2.DataObject = Encoding.UTF8.GetBytes(secondText); await client.Company.GlobalCustomDataObjects.AppendToCustomDataObjectAsync(cdo2, true); Assert.AreEqual($"{firstText}{secondText}", Encoding.UTF8.GetString(cdo2.DataObject)); await client.Company.GlobalCustomDataObjects.DeleteCustomDataObjectAsync(cdo.Name); }
public LinksAndResources() { RefreshControl(); CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key); Links = cdo.Links == null || cdo.Links.Count.Equals(0) ? new Dictionary <string, Dictionary <string, string> >() : cdo.Links.ContainsKey(EncompassHelper.LastPersona) ? cdo.Links[EncompassHelper.LastPersona] : cdo.Links["Default"]; }
private void btnSave_Click(object sender, EventArgs e) { if (dgvFolders.SelectedRows.Count.Equals(0)) { return; } string folder = dgvFolders.SelectedRows[0].Cells[0].Value.ToString(); if (!string.IsNullOrEmpty(folder)) { LoanFolderRule current = CDO.Rules.Where(x => x.FolderName.Equals(folder)).FirstOrDefault(); if (current == null) { current = new LoanFolderRule(); current.FolderName = folder; CDO.Rules.Add(current); } current.Expression = txtCalculation.Text; current.Milestone = cmbMilestone.Text; current.Order = Convert.ToInt32(txtOrder.Value); current.Active = chkActive.Checked; } CustomDataObject.Save <LoanFolderRules>(LoanFolderRules.Key, CDO); ClearFields(); }
public async Task BaseApiClient_CreateGetAppendAndDeleteCustomDataObject() { var client = await GetTestClientAsync(); var baseApiClient = client.BaseApiClient; var existingCdos = await baseApiClient.GetAsync <List <string> >("https://api.elliemae.com/encompass/v1/company/customObjects"); const string firstText = "Hello World!"; var cdo = new CustomDataObject(Guid.NewGuid().ToString().Substring(0, 8) + ".txt", Encoding.UTF8.GetBytes(firstText)); await baseApiClient.PutAsync($"https://api.elliemae.com/encompass/v1/company/customObjects/{cdo.Name}", cdo); await Task.Delay(10000); var cdo2 = await baseApiClient.GetAsync <CustomDataObject>($"https://api.elliemae.com/encompass/v1/company/customObjects/{cdo.Name}"); Assert.AreEqual(firstText, Encoding.UTF8.GetString(cdo.DataObject)); await Task.Delay(10000); const string secondText = "Goodbye World!"; cdo2.DataObject = Encoding.UTF8.GetBytes(secondText); cdo2 = await baseApiClient.PatchAsync <CustomDataObject>($"https://api.elliemae.com/encompass/v1/company/customObjects/{cdo.Name}?view=entity", cdo2); Assert.AreEqual($"{firstText}{secondText}", Encoding.UTF8.GetString(cdo2.DataObject)); await baseApiClient.DeleteAsync($"https://api.elliemae.com/encompass/v1/company/customObjects/{cdo.Name}"); }
public ExportServicePlugin_Config() { InitializeComponent(); Config = CustomDataObject.Get <ExportServiceConfigs>(ExportServiceConfigs.Key); cmbService.Items.AddRange(Enum.GetNames(typeof(GSEServiceType))); Forms = Session.FormManager.GetFormInfos(InputFormType.Custom); chkForms.Items.AddRange(Forms.OrderBy(x => x.Name).Select(x => x.Name).ToArray()); }
public LoanInformation() { InitializeComponent(); CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key); Fields = cdo.LoanInformation == null || cdo.LoanInformation.Count.Equals(0) ? new Dictionary <string, string>() : cdo.LoanInformation.ContainsKey(EncompassHelper.LastPersona) ? cdo.LoanInformation[EncompassHelper.LastPersona] : cdo.LoanInformation["Default"]; RefreshInfo(); }
public HardwareList() { this.InitializeComponent(); // Ensure that the MainPage is only created once, and cached during navigation. this.NavigationCacheMode = NavigationCacheMode.Enabled; collection.ItemsSource = CustomDataObject.GetDataObjects(); }
public override void NativeFormLoaded(object sender, FormOpenedArgs e) { openedForm = e.OpenForm; if (openedForm == null || (openedForm.IsDisposed || !openedForm.Text.Contains("Trigger"))) { return; } RuleLockCDO cdo = CustomDataObject.Get <RuleLockCDO>(RuleLockCDO.Key); int id = ((EllieMae.EMLite.Setup.TriggerEditor)openedForm.ActiveControl.TopLevelControl).Trigger.RuleID; RuleLockInfo locked = cdo.Rules?.FirstOrDefault(x => x.RuleID.Equals(id)) ?? (RuleLockInfo)null; TextBox comments = openedForm.AllControls <TextBox>().FirstOrDefault(x => x.Name.Equals("commentsTxt")); if (comments == null) { return; } Button ok = openedForm.AllControls <Button>().FirstOrDefault(x => x.Name.Equals("okBtn")); if (ok == null) { return; } ok.Click += Ok_Click; FlowLayoutPanel p = new FlowLayoutPanel(); openedForm.Controls.Add(p); p.Left = comments.Left; p.Top = comments.Bottom + 20; p.Size = comments.Size; p.FlowDirection = FlowDirection.LeftToRight; Locked = new CheckBox(); p.Controls.Add(Locked); Locked.Text = "Lock Rule"; TextBox lockedBy = new TextBox(); p.Controls.Add(lockedBy); Button diff = new Button(); p.Controls.Add(diff); diff.Text = "Diff"; diff.Click += Diff_Click; if (locked != null) { lockedBy.Text = $"Locked By {locked.ID}"; Locked.Checked = locked.Locked; ok.Enabled = locked.Locked && locked.ID.Equals(EncompassHelper.User.ID) ? false : true; } }
public PluginManagement_Form() { InitializeComponent(); CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key); chkAdmin.Checked = cdo.SuperAdminRun; chkSide.Checked = cdo.SideMenuOpenByDefault.Contains("True"); txtTest.Text = cdo.TestServer; flwPlugins.Controls.Add(new AccessControl()); }
private void btnSave_Click(object sender, System.EventArgs e) { CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key); cdo.SideMenuOpenByDefault = chkSide.Checked ? "True" : "False"; cdo.SuperAdminRun = chkAdmin.Checked; cdo.TestServer = txtTest.Text; CustomDataObject.Save <CommunitySettings>(CommunitySettings.Key, cdo); MessageBox.Show($" Saved"); }
private void InitControls() { CDO = CustomDataObject.Get <LoanFolderRules>(LoanFolderRules.Key); dgvFolders.Columns.Add("Loan Folder", "Loan Folder"); foreach (string folder in EncompassHelper.GetFolders()) { dgvFolders.Rows.Add(folder); } cmbMilestone.Items.AddRange(EncompassHelper.GetAllMilestones()); }
private void BtnDuplicate_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(TriggerName)) { MailTrigger trigger = CDO.Triggers.Where(x => x.Name.Equals(TriggerName)).FirstOrDefault(); MailTrigger newTrigger = trigger.Clone(trigger); CDO.Triggers.Add(newTrigger); CustomDataObject.Save <AutoMailerCDO>(AutoMailerCDO.Key, CDO); SetupControls(); } }
private void BtnDelete_Click(object sender, EventArgs e) { bool update = !string.IsNullOrEmpty(TriggerName); if (update) { MailTrigger trigger = CDO.Triggers.Where(x => x.Name.Equals(TriggerName)).FirstOrDefault(); CDO.Triggers.Remove(trigger); CustomDataObject.Save <AutoMailerCDO>(AutoMailerCDO.Key, CDO); SetupControls(); } }
public GridViewPage() { InitializeComponent(); this.DataContext = this; // Get data objects and place them into an ObservableCollection List <CustomDataObject> tempList = CustomDataObject.GetDataObjects(); ObservableCollection <CustomDataObject> Items = new ObservableCollection <CustomDataObject>(tempList); ObservableCollection <CustomDataObject> Items2 = new ObservableCollection <CustomDataObject>(tempList); BasicGridView.ItemsSource = Items2; ContentGridView.ItemsSource = Items; StyledGrid.ItemsSource = Items; }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); // Store the item to be used in binding to UI DetailedObject = e.Parameter as CustomDataObject; ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("ForwardConnectedAnimation"); if (imageAnimation != null) { // Connected animation + coordinated animation imageAnimation.TryStart(detailedImage, new UIElement[] { coordinatedPanel }); } }
private void ContextMenuStrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) { ContextMenuStrip menu = sender as ContextMenuStrip; ToolStripItem vip = menu.Items.Cast <ToolStripItem>().Where(x => x.Text.Contains(nameof(VIP))).FirstOrDefault(); if (vip != null) { VIPCDO cdo = CustomDataObject.Get <VIPCDO>(VIPCDO.Key); GVItem selected = FormWrapper.GetPipeline().SelectedItems.FirstOrDefault(); vip.Text = "Mark As VIP"; if (cdo.Loans.Contains((selected?.Tag as PipelineInfo).GUID)) { vip.Text = "Marked VIP"; } } }
private void btnSave_Click(object sender, EventArgs e) { ExportServiceConfig config = Config.Configs.FirstOrDefault(x => x.Service.Equals(cmbService.Text)); bool add = config == null; if (add) { config = new ExportServiceConfig(); Config.Configs.Add(config); } config.Forms = chkForms.CheckedItems.Cast <string>().ToList(); config.ExportControlID = txtFieldID.Text; config.Service = cmbService.Text; CustomDataObject.Save <ExportServiceConfigs>(ExportServiceConfigs.Key, Config); MessageBox.Show("Changes Saved."); this.Close(); }
private void Item_Click(object sender, EventArgs e) { GridView gridView = FormWrapper.GetPipeline(); VIPCDO cdo = CustomDataObject.Get <VIPCDO>(VIPCDO.Key); string guid = (gridView.SelectedItems.FirstOrDefault().Tag as PipelineInfo).GUID; if (cdo.Loans.Contains(guid)) { cdo.Loans.Remove(guid); } else { cdo.Loans.Add(guid); } CustomDataObject.Save <VIPCDO>(VIPCDO.Key, cdo); }
private void collection_ItemClick(object sender, ItemClickEventArgs e) { // Get the collection item corresponding to the clicked item. if (collection.ContainerFromItem(e.ClickedItem) is ListViewItem container) { // Stash the clicked item for use later. We'll need it when we connect back from the detailpage. _storeditem = container.Content as CustomDataObject; // Prepare the connected animation. // Notice that the stored item is passed in, as well as the name of the connected element. // The animation will actually start on the Detailed info page. var animation = collection.PrepareConnectedAnimation("ForwardConnectedAnimation", _storeditem, "connectedElement"); } // Navigate to the DetailedInfoPage. // Note that we suppress the default animation. Frame.Navigate(typeof(DetailedInfoPage), _storeditem, new SuppressNavigationTransitionInfo()); }
private void BtnSave_Click(object sender, EventArgs e) { using (StringWriter writer = new StringWriter()) { CustomDataObject data = new CustomDataObject { ClientName = txtClientName.Text, FullScreenWhenAuto = chkFullScreen.Checked, ScreenResolution = new ScreenResolution(txtScreenResolutionX.Text, txtScreenResolutionY.Text), Profiles = GetTabsData() }; JsonSerializer serializer = new JsonSerializer(); serializer.Serialize(writer, data); File.WriteAllText(_dataFilename, writer.ToString()); } UpdateStatusStripLabel("Data is saved!"); }
private void Save_Click(object sender, EventArgs e) { PipelineScreen mainScreen = FormWrapper.EncompassForm.Controls.Find("pipelineScreen", true)[0] as PipelineScreen; FieldFilterList filter = mainScreen.GetCurrentFilter(); cdo.Filters.Add(new PipelineFilter() { Name = Filter.Text, Filter = filter, Public = false, Owner = EncompassHelper.User.ID, Folder = GetSelectedFolderList(), PipelineView = View.Text }); CustomDataObject.Save <PipelineFilterCDO>(PipelineFilterCDO.Key, cdo); LoadFilters(Filter); Filter.Text = string.Empty; }
private void btnSave_Click(object sender, EventArgs e) { string Name = comboBox1.Text; PluginAccessRight right = CDO.Rights.FirstOrDefault(x => x.PluginName.Equals(Name)); if (right == null) { right = new PluginAccessRight(); right.PluginName = Name; CDO.Rights.Add(right); } right.AllAccess = chkAllAccess.Checked; right.Personas = cbPersonas.CheckedItems.OfType <string>().ToList(); right.UserIDs = cbUsers.CheckedItems.OfType <string>().ToList(); CustomDataObject.Save <CommunitySettings>(CommunitySettings.Key, CDO); MessageBox.Show($"{CommunitySettings.Key} Saved"); }
public override void DataExchangeReceived(object sender, DataExchangeEventArgs e) { if (!ConcurrentUser) { return; } RuleLockInfo info = JsonConvert.DeserializeObject <RuleLockInfo>(e.Data.ToString(), new Newtonsoft.Json.JsonSerializerSettings { TypeNameHandling = Newtonsoft.Json.TypeNameHandling.Auto, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore }); RuleLockCDO cdo = CustomDataObject.Get <RuleLockCDO>(RuleLockCDO.Key); cdo.Rules.Add(info); CustomDataObject.Save <RuleLockCDO>(RuleLockCDO.Key, cdo); }
public override void PipelineTabChanged(object sender, EventArgs e) { cdo = CustomDataObject.Get <PipelineFilterCDO>(PipelineFilterCDO.Key); if (cdo == null) { return; } TabControl tab = sender as TabControl; TabPage tabPage = tab.TabPages[tab.SelectedIndex]; Folder = tabPage.Controls.Find("cboFolder", true)[0] as CheckedComboBox; View = tabPage.Controls.Find("cboView", true)[0] as ComboBox; View.SelectedIndexChanged += View_SelectedIndexChanged; Control c = tabPage.Controls.Find("gradientPanel1", true).FirstOrDefault(); if (c != null && c.Controls.Find("save", true).Count().Equals(0)) { Filter = new ComboBox(); Label label = new Label(); Button save = new Button(); Button delete = new Button(); c.Controls.Add(label); c.Controls.Add(Filter); c.Controls.Add(save); c.Controls.Add(delete); Point p = c.Controls.Find("btnManageViews", true).FirstOrDefault().Location; label.Location = new Point(p.X + 20, p.Y); label.Text = "Filters"; label.Size = new Size(label.Size.Width / 2, label.Size.Height); Filter.Location = new Point(label.Location.X + label.Width + 5, label.Location.Y); Filter.SelectedValueChanged += Filter_SelectedValueChanged; save.Location = new Point(Filter.Location.X + Filter.Width + 5, Filter.Location.Y); save.Click += Save_Click; save.Text = "Save"; delete.Location = new Point(save.Location.X + save.Width + 5, save.Location.Y); delete.Click += Delete_Click; delete.Text = "Delete"; LoadFilters(Filter); } }
private void GridView_ItemDoubleClick(object source, GVItemEventArgs e) { VIPCDO cdo = CustomDataObject.Get <VIPCDO>(VIPCDO.Key); if (cdo.Loans.Contains(EncompassApplication.CurrentLoan.Guid)) { UserGroup group = EncompassApplication.Session.Users.Groups.GetGroupByName("VIP"); if (group == null) { return; } UserList users = group.GetUsers(); if (!users.Contains(EncompassApplication.CurrentUser)) { Session.Application.GetService <ILoanConsole>().CloseLoanWithoutPrompts(false); EncompassHelper.ShowOnTop("VIP", "You do not have access to this loan."); } } }
public override void Committed(object sender, EventArgs e) { Loan l = EncompassHelper.CurrentLoan; string folder = l.LoanFolder; LoanFolderRules rules = CustomDataObject.Get <LoanFolderRules>(LoanFolderRules.Key); foreach (LoanFolderRule rule in rules.Rules.Where(x => x.Active && !x.FolderName.Equals(folder)).OrderBy(x => x.Order)) { if (rule.Calculate()) { Request = new FolderMoveRequest() { LoanFolder = rule.FolderName, GUID = l.Guid, LoanName = l.LoanName }; FormWrapper.TabControl.ControlRemoved += TabControl_ControlRemoved; } } }
private void BtnSave_Click(object sender, EventArgs e) { bool update = !string.IsNullOrEmpty(TriggerName); if (CDO.Triggers.Any(x => x.Name.Equals(txtName.Text)) && !update) { MessageBox.Show("There is already a Trigger with this name."); return; } if (string.IsNullOrEmpty(txtName.Text)) { MessageBox.Show("Name cannot be blank."); return; } MailTrigger trigger = update ? CDO.Triggers.Where(x => x.Name.Equals(TriggerName)).FirstOrDefault() : new MailTrigger(); trigger.Name = txtName.Text; trigger.ReportFilter = cmbReports.SelectedItem.ToString(); trigger.Frequency = (FrequencyType)Enum.Parse(typeof(FrequencyType), cmbFrequency.SelectedItem.ToString()); trigger.Time = dtpTime.Value; trigger.Date = dtpDate.Value; trigger.Days = chkDays.CheckedIndices.Cast <int>().ToArray(); trigger.To = txtTo.Text; trigger.CC = txtCC.Text; trigger.BCC = txtBcc.Text; trigger.Subject = txtSubject.Text; trigger.Body = txtHtml.Text; trigger.Active = chkTriggerActive.Checked; if (!update) { CDO.Triggers.Add(trigger); } CustomDataObject.Save <AutoMailerCDO>(AutoMailerCDO.Key, CDO); SetupControls(); }
public static bool CheckAccess(string pluginName) { CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key); List <PluginAccessRight> rights = cdo.Rights; if (rights.Count.Equals(0)) { rights.Add(new PluginAccessRight() { PluginName = nameof(TopMenuBase), AllAccess = true }); rights.Add(new PluginAccessRight() { PluginName = nameof(PluginManagement), AllAccess = true }); CustomDataObject.Save <CommunitySettings>(CommunitySettings.Key, cdo); } PluginAccessRight right = rights.Where(x => x.PluginName.Equals(pluginName)).FirstOrDefault(); if (right == null) { return(false); } bool isAllowedToRun = right.AllAccess; if (!isAllowedToRun && right.Personas != null) { isAllowedToRun = EncompassHelper.ContainsPersona(right.Personas); } if (!isAllowedToRun && right.UserIDs != null) { isAllowedToRun = right.UserIDs.Contains(EncompassHelper.User.ID); } return(isAllowedToRun); }
private async void OnLoaded(object sender, RoutedEventArgs e) { //Items = ControlInfoDataSource.Instance.Groups.Take(3).SelectMany(g => g.Items).ToList(); BaseExample.ItemsSource = await ListViewPage.Contact.GetContactsAsync(); Control2.ItemsSource = await ListViewPage.Contact.GetContactsAsync(); contacts1 = await ListViewPage.Contact.GetContactsAsync(); contacts2.Add(new ListViewPage.Contact("John", "Doe", "ABC Printers")); contacts2.Add(new ListViewPage.Contact("Jane", "Doe", "XYZ Refridgerators")); contacts2.Add(new ListViewPage.Contact("Santa", "Claus", "North Pole Toy Factory Inc.")); Control4.ItemsSource = CustomDataObject.GetDataObjects(); ContactsCVS.Source = await ListViewPage.Contact.GetContactsAsync(); // Initialize list of contacts to be filtered contacts3 = await ListViewPage.Contact.GetContactsAsync(); contacts3Filtered = new ObservableCollection <ListViewPage.Contact>(contacts3); FilteredListView.ItemsSource = contacts3Filtered; }