public virtual void Start() { // First thing we should do is perform an entitlement check to make sure // we successfully connected to the Oculus Platform Service. Entitlements.IsUserEntitledToApplication().OnComplete(IsEntitledCallback); Oculus.Platform.Request.RunCallbacks(); }
private void Button_Delete_Click(object sender, RoutedEventArgs e) { if ((baseControl as MainPage).UserRole == "USER") { MessageBox.Show("You are not allowed to delete data!", "Access Denied", MessageBoxButton.OK, MessageBoxImage.Error); } else if (MessageBox.Show("Are you want to delete the selected data?", "Confirm", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { StringBuilder rowConstraints = new StringBuilder(); for (int i = 0; i < dataGrid.SelectedItems.Count; i++) { if (i > 0) { rowConstraints.Append(" OR "); } rowConstraints.Append("(EmployeeID = " + (dataGrid.SelectedItems[i] as DataRowView)[0] + " AND LeaveType = '" + (dataGrid.SelectedItems[i] as DataRowView)[2] + "')"); } try { Entitlements.DeleteEntitlementInfo(rowConstraints.ToString()); } catch (System.Data.SqlClient.SqlException exception) { MessageBox.Show("Data could not be deleted!", "Failure", MessageBoxButton.OK, MessageBoxImage.Asterisk); } } Button_View_Click(btn_View, new RoutedEventArgs()); }
/// <summary> /// Creates an Instance of the TwitchAPI Class. /// </summary> /// <param name="logger">Instance Of Logger, otherwise no logging is used, </param> /// <param name="rateLimiter">Instance Of RateLimiter, otherwise no ratelimiter is used. </param> public TwitchAPI(ILoggerFactory loggerFactory = null, IRateLimiter rateLimiter = null, IHttpCallHandler http = null) { _logger = loggerFactory?.CreateLogger <TwitchAPI>(); _http = http ?? new TwitchHttpClient(loggerFactory?.CreateLogger <TwitchHttpClient>()); _rateLimiter = rateLimiter ?? BypassLimiter.CreateLimiterBypassInstance(); Analytics = new Analytics(this); Auth = new Auth(this); Badges = new Badges(this); Bits = new Bits(this); ChannelFeeds = new ChannelFeeds(this); Channels = new Channels(this); Chat = new Chat(this); Clips = new Clips(this); Collections = new Collections(this); Communities = new Communities(this); Entitlements = new Entitlements(this); Games = new Games(this); Ingests = new Ingests(this); Root = new Root(this); Search = new Search(this); Streams = new Streams(this); Teams = new Teams(this); ThirdParty = new ThirdParty(this); Undocumented = new Undocumented(this); Users = new Users(this); Videos = new Videos(this); Webhooks = new Webhooks(this); Debugging = new Debugging(); Settings = new ApiSettings(this); _jsonSerializer = new TwitchLibJsonSerializer(); }
public override int CalculateVersion() { return(new { Base = base.CalculateVersion(), Active, Locale, Name = Name == null ? 0 : Name.CalculateVersion(), NickName, DisplayName, Password, PreferredLanguage, ProfileUrl, Timezone, Title, UserName, UserType, Addresses = Addresses.GetMultiValuedAttributeCollectionVersion(), Emails = Emails.GetMultiValuedAttributeCollectionVersion(), Entitlements = Entitlements.GetMultiValuedAttributeCollectionVersion(), Groups = Groups.GetMultiValuedAttributeCollectionVersion(), Ims = Ims.GetMultiValuedAttributeCollectionVersion(), PhoneNumbers = PhoneNumbers.GetMultiValuedAttributeCollectionVersion(), Photos = Photos.GetMultiValuedAttributeCollectionVersion(), Roles = Roles.GetMultiValuedAttributeCollectionVersion(), X509Certificates = X509Certificates.GetMultiValuedAttributeCollectionVersion() }.GetHashCode()); }
private object GetBalance( ) { if (lb_message.Visibility == System.Windows.Visibility.Visible || icb_leaveTypes.Text.Length == 0 || dp_leavingDate.SelectedDate == null || dp_joiningDate.SelectedDate == null || icb_employeeID.Text.Length == 0) { return(""); } object balance = null; DataTable data = Entitlements.GetSpecificEntitlementInfo("Balance, ValidFrom, ValidTo", "EmployeeID = " + icb_employeeID.Text + " AND LeaveType = '" + icb_leaveTypes.Text + "'"); DateTime leavingDate = dp_leavingDate.SelectedDate.Value; DateTime joiningDate = dp_joiningDate.SelectedDate.Value; if (leavingDate < new DateString(data.Rows[0][1].ToString( )) || joiningDate.AddDays(-1) > new DateString(data.Rows[0][2].ToString( ))) { return("!!"); } balance = data.Rows[0][0]; lostBalance = 0; DataTable holidays = WorkHolidays.GetAllHolidayInfo( ); DataTable workingDays = WorkDays.GetWorkDayInfo("WorkDayType NOT LIKE 'Non%'"); for (DateTime date = leavingDate; date < joiningDate; date = date.AddDays(1)) { bool dayIsHoliday = false; foreach (DataRow row in holidays.Rows) { if (date == ( DateTime )row[1] && row[2].ToString( ) == "Half Day") { lostBalance += .5; dayIsHoliday = true; break; } } if (dayIsHoliday) { continue; } foreach (DataRow row in workingDays.Rows) { if (row[1].ToString( ) == date.DayOfWeek.ToString( )) { if (row[2].ToString( ) == "Half Day") { lostBalance += .5; } else { lostBalance++; } break; } } } lostBalance = (lostBalance * (cb_to.SelectedIndex - cb_from.SelectedIndex + 1) * .25) / 8; // It was a tiresome balance calculation // Alhamdu Lillaah! return((double.Parse("0" + balance) - lostBalance).ToString( )); }
/// <summary> /// Use this for initialization /// </summary> void Start() { AssignSceneComponents(); user = AccelBytePlugin.GetUser(); entitlements = AccelBytePlugin.GetEntitlements(); entitlementList = new List <PagedEntitlements>(); pageNow = 0; pageSize = 18; entitlements.GetUserEntitlements(pageNow, pageSize, OnGetUserEntitlements); }
private void Element_Text_Changed(object sender, TextChangedEventArgs e) { MainPage mainPage = baseControl as MainPage; if (sender is IntelComboBox) { (sender as IntelComboBox).ViewMatches(); if (sender == icb_employees) { icb_employeeID.Data = Entitlements.GetSpecificDistributedEntitlementInfo("DISTINCT Entitlements.EmployeeID", "EmployeeName = '" + icb_employees.Text + "'"); if (icb_employeeID.Items.Count > 0) { icb_employeeID.SelectedIndex = 0; } if (icb_employeeID.Items.Count > 1) { lb_employeeID.Visibility = System.Windows.Visibility.Visible; icb_employeeID.Visibility = System.Windows.Visibility.Visible; } else { lb_employeeID.Visibility = System.Windows.Visibility.Collapsed; icb_employeeID.Visibility = System.Windows.Visibility.Collapsed; } } } else if (sender == tb_balance) { if (tb_balance.Text.Length == 0) { if (lb_message.Visibility == System.Windows.Visibility.Visible) { lb_message.Visibility = System.Windows.Visibility.Collapsed; } return; } double num; if (double.TryParse(tb_balance.Text, out num)) { num *= 100; if (( int )num == num) { if (lb_message.Visibility == System.Windows.Visibility.Visible) { lb_message.Visibility = System.Windows.Visibility.Collapsed; } } else if (lb_message.Visibility == System.Windows.Visibility.Collapsed) { lb_message.Visibility = System.Windows.Visibility.Visible; } } } }
public bool Equals(DataPacket?other) { return(other != null && ( (Entitlements == null && other.Entitlements == null) || (Entitlements != null && Entitlements.SetEquals(other.Entitlements)) ) && ( (Data == null && other.Data == null) || (Data != null && Data.SequenceEqual(other.Data)) )); }
private void Button_View_Click(object sender, RoutedEventArgs e) { if (lb_message.Visibility == System.Windows.Visibility.Visible) { MessageBox.Show(lb_message.Content.ToString( ), "Invalid Balance"); return; } StringBuilder rowConstraints = new StringBuilder( ); if (icb_employeeID.Text.Length > 0) { rowConstraints.Append("Entitlements.EmployeeID = " + icb_employeeID.Text); } else if (icb_employees.Text.Length > 0) { rowConstraints.Append("Entitlements.EmployeeID IS NULL"); } else { rowConstraints.Append("Entitlements.EmployeeID IS NOT NULL"); } if (icb_leaveTypes.Text.Length > 0) { rowConstraints.Append(" AND LeaveType = '" + icb_leaveTypes.Text + "'"); } if (icb_entitlementType.Text.Length > 0) { rowConstraints.Append(" AND EntitlementType = '" + icb_entitlementType.Text + "'"); } if (icb_validFrom.Text.Length > 0 && icb_validTo.Text.Length > 0) { rowConstraints.Append(" AND (ValidFrom = '" + icb_validFrom.Text + "' OR ValidTo = '" + icb_validTo.Text + "')"); } else if (icb_validFrom.Text.Length > 0) { rowConstraints.Append(" AND ValidFrom = '" + icb_validFrom.Text + "'"); } else if (icb_validTo.Text.Length > 0) { rowConstraints.Append(" AND ValidTo = '" + icb_validTo.Text + "'"); } if (tb_balance.Text.Length > 0) { rowConstraints.Append(" AND Balance = " + tb_balance.Text); } FillDataGrid(dataManager.Data = Entitlements.GetAllDistributedEntitlementInfo(rowConstraints.ToString( ))); }
void Awake() { try { Core.AsyncInitialize(); Entitlements.IsUserEntitledToApplication().OnComplete(GetEntitlementCallback); } catch (UnityException e) { Debug.LogError("Platform failed to initialize due to exception"); Debug.LogException(e); UnityEngine.Application.Quit(); } }
protected override void CheckEntitlement() { Entitlements.IsUserEntitledToApplication().OnComplete((Message msg) => { if (msg.IsError) { Debug.LogError(msg.GetError()); EvalEntitlement(false); } else { EvalEntitlement(true); } }); }
void Awake() { try { Core.AsyncInitialize(); Entitlements.IsUserEntitledToApplication().OnComplete(EntitlementCallback); } catch (UnityException e) { Debug.LogError("Oculus Platform failed to initialize due to exception."); Debug.LogException(e); // Immediately quit the application UnityEngine.Application.Quit(); } }
public bool MatchesBundleIdentifier(string bundleIdentifier) { PString identifier; string id; int dot; if (bundleIdentifier == null) { throw new ArgumentNullException(nameof(bundleIdentifier)); } if (Entitlements.TryGetValue("com.apple.application-identifier", out identifier)) { id = identifier.Value; } else if (Entitlements.TryGetValue("application-identifier", out identifier)) { id = identifier.Value; } else { return(false); } // Note: the identifier will be in the form "7V723M9SQ5.com.xamarin.app-name", so we'll need to trim the leading TeamIdentifierPrefix if ((dot = id.IndexOf('.')) != -1) { id = id.Substring(dot + 1); } if (id.Length > 0 && id[id.Length - 1] == '*') { // Note: this is a wildcard provisioning profile, which means we need to use a substring match id = id.TrimEnd('*'); if (!bundleIdentifier.StartsWith(id, StringComparison.Ordinal)) { return(false); } } else if (id != bundleIdentifier) { // the CFBundleIdentifier provided by our caller does not match this provisioning profile return(false); } return(true); }
private void BeginOculusSetup() { Core.AsyncInitialize().OnComplete(message => { if (message.IsError) { Debug.Log("Oculus Sdk failed to initialize!"); OVRManager.instance.ReturnToLauncher(); } else { Debug.Log("Oculus Sdk initialized."); Entitlements.IsUserEntitledToApplication().OnComplete(EntitlementCallback); } }); }
void InitCallback(Message <PlatformInitialize> msg) { if (msg.IsError) { TerminateWithError(msg); return; } LaunchDetails launchDetails = ApplicationLifecycle.GetLaunchDetails(); SocialPlatformManager.LogOutput("App launched with LaunchType " + launchDetails.LaunchType); // First thing we should do is perform an entitlement check to make sure // we successfully connected to the Oculus Platform Service. Entitlements.IsUserEntitledToApplication().OnComplete(IsEntitledCallback); }
void Start() { playerController = GameObject.FindWithTag("OVRPlayerController").GetComponent <PlayerController>(); errorMessage.SetActive(false); if (!DoEntitlementCheck) { return; } try { Core.AsyncInitialize(); Entitlements.IsUserEntitledToApplication().OnComplete(entitlementCallback); } catch (UnityException e) { showErrorAndQuit(); } }
/// <summary> /// Entitlement Check 用のスクリプト /// </summary> void Awake() { Core.AsyncInitialize(); Entitlements.IsUserEntitledToApplication().OnComplete( (Message msg) => { if (msg.IsError) { print("Not Entitled"); UnityEngine.Application.Quit(); } else { print("EntilementCheck Passed"); } } ); }
void Start() { try { // Init the Oculust Platform SDK and send an entitlement check request. if (!Oculus.Platform.Core.IsInitialized()) { Oculus.Platform.Core.Initialize(); } Entitlements.IsUserEntitledToApplication().OnComplete(EntitlementCheckCallback); } catch { // Treat any potential initialization exceptions as an entitlement check failure. HandleEntitlementCheckResult(false); } }
/// <summary> /// Validates this Person as an IPersonHealthcareProvider /// </summary> /// <param name="path">The path to this object as a string</param> /// <param IPersonHealthcareProvider="messages">The validation messages, these may be added to within this method</param> /// <param name="messages">The validation messages, these may be added to within this method</param> void IPersonHealthcareProvider.Validate(string path, List <ValidationMessage> messages) { var vb = new ValidationBuilder(path, messages); // Differs from Spec User may have not have HPI-I if (Identifiers != null) { for (var x = 0; x < Identifiers.Count; x++) { Identifiers[x].Validate( vb.Path + string.Format("Identifiers[{0}]", x), vb.Messages); } } if (vb.ArgumentRequiredCheck("PersonName", PersonNames)) { if (PersonNames != null) { for (var x = 0; x < PersonNames.Count; x++) { PersonNames[x].Validate(vb.Path + string.Format("PersonName[{0}]", x), vb.Messages); } } } if (Entitlements != null && Entitlements.Any()) { if (Entitlements != null) { for (var x = 0; x < Entitlements.Count; x++) { Entitlements[x].Validate ( vb.Path + string.Format("Entitlements[{0}]", x), vb.Messages ); } } } if (Organisation != null) { Organisation.Validate(vb.Path + "Organisation", vb.Messages); } }
private void Button_Click(object sender, RoutedEventArgs e) { string values = ""; string rowConstraints = ""; if (id.Text.Length != 0) { values += id.Text; rowConstraints += "EntitlementID"; } if (leaveType.Text.Length != 0) { values += ", '" + leaveType.Text + "'"; rowConstraints += ", " + "LeaveType"; } if (entitlementType.Text.Length != 0) { values += ", '" + entitlementType.Text + "'"; rowConstraints += ", " + "EntitlementType"; } if (validFrom.Text.Length != 0) { values += ", '" + validFrom.Text + "'"; rowConstraints += ", " + "ValidFrom"; } if (validTo.Text.Length != 0) { values += ", '" + validTo.Text + "'"; rowConstraints += ", " + "ValidTo"; } if (balance.Text.Length != 0) { values += ", " + balance.Text; rowConstraints += ", " + "Balance"; } try { Entitlements.AddEntitlements(values, rowConstraints); MessageBox.Show("Entitlements added successfully!"); } catch (SqlException exception) { MessageBox.Show(exception.Message + values + rowConstraints); } }
private void Page_Loaded(object sender, RoutedEventArgs e) { // if user is not logged // return to the login page // else load required data // and continue with the current view MainPage mainPage = baseControl as MainPage; if (!mainPage.UserIsLoggedIn) { MainWindow mainWindow = mainPage.BaseControl as MainWindow; mainWindow.Frame.Navigate(new LoginPage(mainPage.BaseControl)); return; } Stack <Page> jobStack = mainPage.JobStack; if (jobStack.Count != 0 && jobStack.Peek( ) != mainPage.LeaveAssignmentPage) { jobStack.Clear( ); } string rowConstraints = ""; if (mainPage.UserRole == "USER") { rowConstraints = "Entitlements.EmployeeID = " + mainPage.EmployeeID; icb_employees.IsEnabled = false; icb_employees.Text = Employees.GetSpecificEmployeeInfo("EmployeeName", "EmployeeID = " + mainPage.EmployeeID).Rows[0][0].ToString( ); icb_employeeID.Text = mainPage.EmployeeID; if (icb_employeeID.Visibility == Visibility.Visible) { icb_employeeID.Visibility = Visibility.Collapsed; } } else { icb_employees.Data = Entitlements.GetSpecificDistributedEntitlementInfo("DISTINCT Employees.EmployeeName", rowConstraints); } icb_leaveTypes.Data = Entitlements.GetSpecificEntitlementInfo("DISTINCT LeaveType", rowConstraints); icb_entitlementType.Data = Entitlements.GetSpecificEntitlementInfo("DISTINCT EntitlementType", rowConstraints); icb_validFrom.Data = Entitlements.GetSpecificEntitlementInfo("DISTINCT ValidFrom", rowConstraints); icb_validTo.Data = Entitlements.GetSpecificEntitlementInfo(" DISTINCT ValidTo", rowConstraints); }
private void ComboBox_Text_Changed(object sender, TextChangedEventArgs e) { (sender as IntelComboBox).ViewMatches( ); icb_employeeID.Data = Entitlements.GetSpecificDistributedEntitlementInfo("Entitlements.EmployeeID", "EmployeeName = '" + icb_employees.Text + "' AND LeaveType = '" + icb_leaveTypes.Text + "'"); if (icb_employeeID.Data.Rows.Count > 0) { icb_employeeID.SelectedIndex = 0; } if (icb_employeeID.Data.Rows.Count > 1) { lb_employeeID.Visibility = System.Windows.Visibility.Visible; icb_employeeID.Visibility = System.Windows.Visibility.Visible; } else { lb_employeeID.Visibility = System.Windows.Visibility.Collapsed; icb_employeeID.Visibility = System.Windows.Visibility.Collapsed; } lb_balance.Content = GetBalance( ); }
static void Main(string[] args) { bool userExited = false; do { Console.Clear(); try { switch (GetUserChoice("Add Entitlements", "Employee Entitlements", "Exit")) { case 1: /* * * * * */ Console.WriteLine("Process Under Construction."); Console.Write("Press any key to continue ..."); Console.ReadKey(); break; case 2: PrintTable(Entitlements.Select()); Console.Write("Press any key to continue ..."); Console.ReadKey(); break; case 3: userExited = true; break; default: Console.WriteLine("Error: Invalid Option!"); break; } } catch (Exception e) { Console.WriteLine(e.Message); } } while(!userExited); }
static void OnBeforeSceneLoadRuntimeMethod() { //Core.Initialize("1143046855744783"); // CalcFlow app ID Core.Initialize(); // CalcFlow app ID Debug.Log("Checking of user has valid entitlement.."); Entitlements.IsUserEntitledToApplication().OnComplete( (Message msg) => { if (msg.IsError) { // User is NOT entitled. Debug.Log("Error: User is NOT entitled."); UnityEngine.Application.Quit(); } else { // User IS entitled Debug.Log("User is entitled. Proceeding as normal.."); } } ); }
private void DataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e) { try { DataRowView rowView = dataGrid.SelectedItems[0] as DataRowView; TextBox textBox = e.EditingElement as TextBox; string column = e.Column.Header.ToString(); string value = textBox.Text; string changes = column + " = " + value; string rowConstraints = "EmployeeID = " + rowView[0] + " AND LeaveType = '" + rowView[2] + "'"; Entitlements.UpdateEntitlementInfo(changes, rowConstraints); MessageBox.Show("Changes saved!", "", MessageBoxButton.OK, MessageBoxImage.Information); } catch (System.Data.SqlClient.SqlException exception) { MessageBox.Show("Invalid Data!", "", MessageBoxButton.OK, MessageBoxImage.Error); } MainPage mainPage = baseControl as MainPage; Stack <Page> jobStack = mainPage.JobStack; if (jobStack.Count > 0) { mainPage.Container.Navigate(jobStack.Pop( )); } }
// Use this for initialization void Start() { Core.Initialize("1556971604391491"); Entitlements.IsUserEntitledToApplication().OnComplete( (Message msg) => { if (msg.IsError) { print("fired oculus platform, is not entitled"); // User is NOT entitled. UnityEngine.Application.Quit(); //showMessageThatTheUserDoesntOwnThis(); } else { print("Oculus platform enetitlement check passed"); // User IS entitled //proceedAsNormal(); } } ); }
/// <summary> /// Validates this Person as an IPersonPrescriber /// </summary> /// <param name="path">The path to this object as a string</param> /// <param name="messages">the validation messages, these may be added to within this method</param> void IPersonPrescriber.Validate(string path, List <ValidationMessage> messages) { var vb = new ValidationBuilder(path, messages); if (vb.ArgumentRequiredCheck("Identifiers", Identifiers)) { for (var x = 0; x < Identifiers.Count; x++) { Identifiers[x].Validate( vb.Path + string.Format("Identifiers[{0}]", x), vb.Messages); } } if (vb.ArgumentRequiredCheck("PersonName", PersonNames)) { if (PersonNames != null) { for (var x = 0; x < PersonNames.Count; x++) { PersonNames[x].Validate(vb.Path + string.Format("PersonName[{0}]", x), vb.Messages); } } } if (Entitlements != null && Entitlements.Any()) { if (Entitlements != null) { for (var x = 0; x < Entitlements.Count; x++) { Entitlements[x].Validate ( vb.Path + string.Format("Entitlements[{0}]", x), vb.Messages ); } } } }
private void Page_Loaded(object sender, RoutedEventArgs e) { // if user is not logged // return to the login page // else load required data // and continue with the current view MainPage mainPage = baseControl as MainPage; if (!mainPage.UserIsLoggedIn) { (mainPage.BaseControl as MainWindow).Frame.Navigate(new LoginPage(mainPage.BaseControl)); return; } Stack <Page> jobStack = mainPage.JobStack; if (jobStack.Count != 0 && jobStack.Peek( ) != mainPage.ViewApplication) { jobStack.Clear( ); } icb_employees.Data = Entitlements.GetSpecificDistributedEntitlementInfo("DISTINCT Employees.EmployeeName"); icb_leaveTypes.Data = Entitlements.GetSpecificEntitlementInfo("DISTINCT LeaveType"); lb_balance.Content = GetBalance( ); }
void Start() { //check if the game is pirated by the user if so close it Core.AsyncInitialize(); Entitlements.IsUserEntitledToApplication().OnComplete(OnUserIsEntitledToApplication); }
protected void InitializePlatformSDK( Oculus.Platform.Message.Callback callback ) { Core.Initialize(); Entitlements.IsUserEntitledToApplication().OnComplete( callback ); }
public static Entitlements CreateEntitlements(int entitlementID_pk) { Entitlements entitlements = new Entitlements(); entitlements.entitlementID_pk = entitlementID_pk; return entitlements; }
public void AddToEntitlements(Entitlements entitlements) { base.AddObject("Entitlements", entitlements); }