public Java.Lang.ICharSequence FilterFormatted(Java.Lang.ICharSequence source, int start, int end, global::Android.Text.ISpanned dest, int dstart, int dend) { var s = source.ToString(); var d = dest.ToString(); var proposal = d.Remove(dstart, dend - dstart).Insert(dstart, s.Substring(start, end - start)); if (_onChangeDelegate(proposal)) return null; else { var r = new Java.Lang.String(d.Substring(dstart, dend - dstart)); if (source is ISpanned) { // This spannable thing here, is needed to copy information about which part of // the string is being under composition by the keyboard (or other spans). A // spannable string has support for extra information to the string, besides // its characters and that information must not be lost! var ssb = new SpannableString(r); var spannableEnd = (end <= ssb.Length()) ? end : ssb.Length(); global::Android.Text.TextUtils.CopySpansFrom((ISpanned)source, start, spannableEnd, null, ssb, 0); return ssb; } else return r; } }
public override void OnChange(bool selfChange, global::Android.Net.Uri uri) { // for some reason, we get multiple calls to OnChange for the same outgoing text. ignore repeats. if (_mostRecentlyObservedSmsURI != null && uri.ToString() == _mostRecentlyObservedSmsURI) return; // TODO: Fix issue #75 -- need to handle MMS. they are structured differently than SMS, and the code below does not work. if (uri.ToString() == "content://sms/raw") return; ICursor cursor = _context.ContentResolver.Query(uri, null, null, null, null); if (cursor.MoveToNext()) { string protocol = cursor.GetString(cursor.GetColumnIndex("protocol")); int type = cursor.GetInt(cursor.GetColumnIndex("type")); int sentMessageType; #if __ANDROID_19__ if (Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat) sentMessageType = (int)SmsMessageType.Sent; // API level 19 else #endif sentMessageType = 2; if (protocol != null || type != sentMessageType) return; string to = cursor.GetString(cursor.GetColumnIndex("address")); long unixTimeMS = cursor.GetLong(cursor.GetColumnIndex("date")); DateTimeOffset dotNetDateTime = new DateTimeOffset(1970, 1, 1, 0, 0, 0, new TimeSpan()).AddMilliseconds(unixTimeMS); string message = cursor.GetString(cursor.GetColumnIndex("body")); cursor.Close(); _outgoingSMS(new SmsDatum(dotNetDateTime, null, to, message)); _mostRecentlyObservedSmsURI = uri.ToString(); } }
// tag0005 /// <summary> /// There are no comments for CalendarView in the schema. /// </summary> public IEventCollection GetCalendarView(global::System.DateTimeOffset startDateTime, global::System.DateTimeOffset endDateTime) { var cvPath = GetPath("CalendarView"); if (cvPath == null) { throw new global::System.Exception("cannot find entity"); } var query = Context.CreateQuery<Event>(cvPath, true); query = query.AddQueryOption("startDateTime", startDateTime.ToString(DateTimeOffsetZuluFormat)); query = query.AddQueryOption("endDateTime", endDateTime.ToString(DateTimeOffsetZuluFormat)); return new EventCollection(query, Context, this, cvPath); }
public virtual string ToString(global::System.Guid value, string format, global::System.IFormatProvider formatProvider) { if (string.IsNullOrEmpty(format)) return global::System.Xml.XmlConvert.ToString(value); return value.ToString(format, formatProvider); }
// This method is explicitly implemented as a member of an instantiated Com.Nostra13.Universalimageloader.Cache.Memory.IMemoryCacheAware global::Java.Lang.Object global::Com.Nostra13.Universalimageloader.Cache.Memory.IMemoryCacheAware.Get (global::Java.Lang.Object p0) { return global::Java.Interop.JavaObjectExtensions.JavaCast<Java.Lang.Object>(Get (p0.ToString ())); }
public override global::NHibernate.SqlCommand.SqlString OnPrepareStatement(global::NHibernate.SqlCommand.SqlString sql) { Trace.WriteLine(sql.ToString()); return sql; }
/// <summary> /// Handles exceptions that occurred during binding. /// </summary> /// <param name="exception">The exception that occured</param> /// <returns>A flag indicating whether the exception was handled or not.</returns> /// <remarks>If the exception is not handled (i.e. the method returns false), it will be re-thrown /// by the calling method. /// This method will be called for all types of exception.</remarks> protected virtual bool HandleBindingFailure(global::System.Exception exception) { // Log and suppress all binding failure exceptions. string errorMessage = string.Format(global::System.Globalization.CultureInfo.CurrentCulture, global::Microsoft.Practices.ServiceFactory.DataContracts.DataContractDslDomainModel.SingletonResourceManager.GetString("BindingErrorOccurred"), exception.ToString()); this.AddErrorListItem(new DslShell::SimpleErrorListItem(errorMessage, this.FileName, global::Microsoft.VisualStudio.Shell.TaskPriority.Normal, global::Microsoft.VisualStudio.Shell.TaskErrorCategory.Warning)); return true; }
/// <summary> /// Add a warning for missing "Id" property. /// </summary> /// <param name="serializationContext">SerializationContext to add the warning message to.</param> /// <param name="reader">The reader pointing to where the message is raised.</param> /// <param name="newId">Auto-generated new Id.</param> public static void MissingId(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, global::System.Guid newId) { #region Check Parameters global::System.Diagnostics.Debug.Assert(serializationContext != null); if (serializationContext == null) throw new global::System.ArgumentNullException("serializationContext"); global::System.Diagnostics.Debug.Assert(reader != null); if (reader == null) throw new global::System.ArgumentNullException("reader"); #endregion DslModeling::SerializationUtilities.AddMessage( serializationContext, DslModeling::SerializationMessageKind.Warning, string.Format( global::System.Globalization.CultureInfo.CurrentCulture, ResourceManager.GetString("MissingId"), newId.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture) ), reader as global::System.Xml.IXmlLineInfo ); }
public override void OnChange(bool selfChange, global::Android.Net.Uri uri) { // for some reason, we get multiple calls to OnChange for the same outgoing text. ignore repeats. if (_mostRecentlyObservedSmsURI != null && uri.ToString() == _mostRecentlyObservedSmsURI) return; // TODO: Fix issue #75 -- need to handle MMS. they are structured differently than SMS, and the code below does not work. if (uri.ToString() == "content://sms/raw") return; ICursor cursor = _context.ContentResolver.Query(uri, null, null, null, null); if (cursor.MoveToNext()) { // we've been seeing some issues with missing fields: https://insights.xamarin.com/app/Sensus-Production/issues/23 // catch any exceptions that occur here and report them. try { string protocol = cursor.GetString(cursor.GetColumnIndexOrThrow("protocol")); int type = cursor.GetInt(cursor.GetColumnIndexOrThrow("type")); int sentMessageType; // https://github.com/predictive-technology-laboratory/sensus/wiki/Backwards-Compatibility #if __ANDROID_19__ if (Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat) sentMessageType = (int)SmsMessageType.Sent; // API level 19 else #endif sentMessageType = 2; if (protocol != null || type != sentMessageType) return; string toNumber = cursor.GetString(cursor.GetColumnIndexOrThrow("address")); long unixTimeMS = cursor.GetLong(cursor.GetColumnIndexOrThrow("date")); DateTimeOffset dotNetDateTime = new DateTimeOffset(1970, 1, 1, 0, 0, 0, new TimeSpan()).AddMilliseconds(unixTimeMS); string message = cursor.GetString(cursor.GetColumnIndexOrThrow("body")); _outgoingSMS(new SmsDatum(dotNetDateTime, null, toNumber, message)); _mostRecentlyObservedSmsURI = uri.ToString(); } catch(Exception ex) { // if anything goes wrong, report exception to Insights try { Insights.Report(ex, Insights.Severity.Error); } catch { } } finally { // always close cursor try { cursor.Close(); } catch { } } } }
public static java.lang.String nativeTypeToJavaTypeName(global::System.Type nativeType) { string result; _nTIB tib; if(!tibTable.TryGetValue(nativeType, out tib)) { // if it is not already in the table, // then the native type name is the same as the java counterpart result = nativeType.ToString(); tib = new _nTIB(nativeType, result); tibTable.Add(nativeType, tib); jNameTable.Add(result, tib); bootstrapSetClass(tib); } else { result = tib.getJavaName(); } return org.xmlvm._nUtil.toJavaString(result); }
public static java.lang.Class getClass(global::System.Type aType) { _nTIB aTIB = getTIB(aType, aType.ToString()); java.lang.Class result = aTIB.getClass(); if (result==null) { // need to initialize with java.lang.Class instant bootstrapSetClass(aTIB); result = aTIB.getClass(); } return result; }
private static MvxGeoLocation CreateLocation(global::Android.Locations.Location androidLocation) { var position = new MvxGeoLocation {Timestamp = androidLocation.Time.FromMillisecondsUnixTimeToUtc()}; var coords = position.Coordinates; if (androidLocation.HasAltitude) coords.Altitude = androidLocation.Altitude; // note that we use a HackReadValue method from a string here // - as MONODROID didn't seem to be correctly returning the Latitude and Longitude values var testString = androidLocation.ToString(); coords.Latitude = HackReadValue(testString, "mLatitude="); coords.Longitude = HackReadValue(testString, "mLongitude="); return position; /* coords.Latitude = androidLocation.Latitude; coords.Longitude = androidLocation.Longitude; if (androidLocation.HasSpeed) coords.Speed = androidLocation.Speed; if (androidLocation.HasAccuracy) { coords.Accuracy = androidLocation.Accuracy; } #warning what to do with coords.AltitudeAccuracy ?S //coords.AltitudeAccuracy = androidLocation.Accuracy; return position; */ }
private ReadDirection GetReadDirection(global::EventStore.ClientAPI.ReadDirection readDirection) { return (ReadDirection) Enum.Parse(typeof(ReadDirection), readDirection.ToString()); }
// This method is explicitly implemented as a member of an instantiated Com.Nostra13.Universalimageloader.Cache.Memory.IMemoryCacheAware void global::Com.Nostra13.Universalimageloader.Cache.Memory.IMemoryCacheAware.Remove (global::Java.Lang.Object p0) { Remove (p0.ToString ()); }
// This method is explicitly implemented as a member of an instantiated Com.Nostra13.Universalimageloader.Cache.Memory.IMemoryCacheAware bool global::Com.Nostra13.Universalimageloader.Cache.Memory.IMemoryCacheAware.Put (global::Java.Lang.Object p0, global::Java.Lang.Object p1) { return Put (p0.ToString (), global::Java.Interop.JavaObjectExtensions.JavaCast<Android.Graphics.Bitmap>(p1)); }
public virtual string ToString(global::System.DateTime value, string format, global::System.IFormatProvider formatProvider) { if (string.IsNullOrEmpty(format)) return global::System.Xml.XmlConvert.ToString(value, global::System.Xml.XmlDateTimeSerializationMode.RoundtripKind); return value.ToString(format, formatProvider); }
protected override void InternalSetBackgroundColor(global::System.Drawing.Color value) { this.InternalGetTextField().style.backgroundColor = value.ToString(); }
private void Update_Key(global::System.Object obj, int phase) { if((phase & ((1 << 0) | NOT_PHASED )) != 0) { XamlBindingSetters.Set_Windows_UI_Xaml_Controls_TextBlock_Text(this.obj8.Target as global::Windows.UI.Xaml.Controls.TextBlock, obj != null ? obj.ToString() : null, null); } }
private void Update_Girl_Age(global::System.Int32 obj, int phase) { if((phase & ((1 << 0) | NOT_PHASED )) != 0) { XamlBindingSetters.Set_Windows_UI_Xaml_Controls_TextBlock_Text(this.obj4, obj.ToString(), null); } }
public override global::NHibernate.SqlCommand.SqlString OnPrepareStatement(global::NHibernate.SqlCommand.SqlString sql) { Debug.WriteLine(sql.ToString()); return base.OnPrepareStatement(sql); }
private void Update_SymbolAsChar(global::System.Char obj, int phase) { if((phase & ((1 << 0) | NOT_PHASED )) != 0) { XamlBindingSetters.Set_Windows_UI_Xaml_Controls_FontIcon_Glyph(this.obj3, obj.ToString(), null); } }
public void send(global::ProtoBuf.IExtensible base_msg) { mCachedMsg = base_msg; String name = base_msg.ToString(); byte[] byteArray = System.Text.Encoding.Default.GetBytes(name); UInt32 name_length = (UInt32)byteArray.Length; System.IO.MemoryStream mem = new System.IO.MemoryStream(); ProtoBuf.Serializer.Serialize<global::ProtoBuf.IExtensible>(mem, base_msg); UInt32 length = (UInt32)mem.Length; byte[] bytes = new byte[length]; Array.Copy(mem.GetBuffer(), bytes, length); UInt32 pb_flag = 0; UInt16 mask = 0; mask = 1 << 2; UInt32 crc32 = 0; //crc32 = (UInt32)CRC32.GetCRC32(bytes); UInt32 source_base64_length = sizeof(UInt32) + sizeof(UInt32) + name_length + length; UInt32 head_length = sizeof(UInt16) + sizeof(UInt32); UInt32 max_length = 0;//= sizeof(UInt16) + sizeof(UInt32) + source_base64_length; UInt32 body_length = 0; byte[] base64_buff = new byte[source_base64_length]; ////////// UInt32 write_pos = 0; UInt32 write_length = sizeof(UInt32); Array.Copy(BitConverter.GetBytes(pb_flag), 0, base64_buff, write_pos, write_length); write_pos += write_length; write_length = sizeof(UInt32); Array.Copy(BitConverter.GetBytes(name_length), 0, base64_buff, write_pos, write_length); write_pos += write_length; write_length = name_length; Array.Copy(System.Text.Encoding.UTF8.GetBytes(name), 0, base64_buff, write_pos, write_length); write_pos += write_length; write_length = length; Array.Copy(bytes, 0, base64_buff, write_pos, write_length); write_pos += write_length; UInt32 char_base64_out_length = write_pos * 2; char[] base64_out = new char[char_base64_out_length]; int base64_length = Convert.ToBase64CharArray(base64_buff, 0, (int)write_pos, base64_out, 0); string base64_str = new string(base64_out, 0, base64_length); //Debug.Log("base64[" + base64_str + "]"); byte[] body_bytes = System.Text.Encoding.UTF8.GetBytes(base64_out, 0, base64_length); body_length = (UInt32)body_bytes.Length; max_length = head_length + body_length; byte[] sendbuff = new byte[max_length]; //// write_length = sizeof(UInt16); write_pos = 0; Array.Copy(BitConverter.GetBytes(mask), sendbuff, write_length); write_pos += write_length; write_length = sizeof(UInt32); crc32 = (UInt32)CRC32.GetCRC32(body_bytes); Array.Copy(BitConverter.GetBytes(crc32), 0, sendbuff, write_pos, write_length); write_pos += write_length; write_length = body_length; Array.Copy(body_bytes, 0, sendbuff, write_pos, write_length); socket_client.Send(sendbuff); }
/// <summary> /// Add an error for Version mismatch. /// </summary> /// <param name="serializationContext">SerializationContext to add the error message to.</param> /// <param name="reader">The reader pointing to where the message is raised.</param> /// <param name="expectedVersion">The version that's expected.</param> /// <param name="actualVersion">Actual version from the file.</param> public static void VersionMismatch(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, global::System.Version expectedVersion, global::System.Version actualVersion) { #region Check Parameters global::System.Diagnostics.Debug.Assert(serializationContext != null); if (serializationContext == null) throw new global::System.ArgumentNullException("serializationContext"); global::System.Diagnostics.Debug.Assert(reader != null); if (reader == null) throw new global::System.ArgumentNullException("reader"); global::System.Diagnostics.Debug.Assert(expectedVersion != null); if (expectedVersion == null) throw new global::System.ArgumentNullException("expectedVersion"); global::System.Diagnostics.Debug.Assert(actualVersion != null); if (actualVersion == null) throw new global::System.ArgumentNullException("actualVersion"); #endregion DslModeling::SerializationUtilities.AddMessage( serializationContext, DslModeling::SerializationMessageKind.Error, string.Format( global::System.Globalization.CultureInfo.CurrentCulture, ResourceManager.GetString("VersionMismatch"), actualVersion.ToString(4), expectedVersion.ToString(4) ), reader as global::System.Xml.IXmlLineInfo ); }
private void Update_Date(global::System.DateTime obj, int phase) { if((phase & ((1 << 1) | NOT_PHASED )) != 0) { XamlBindingSetters.Set_Windows_UI_Xaml_Controls_TextBlock_Text(this.obj3, obj.ToString(), null); } }
private void Update_ViewModel_LastUpdated(global::System.Nullable<global::System.DateTime> obj, int phase) { if((phase & ((1 << 0) | NOT_PHASED | DATA_CHANGED)) != 0) { XamlBindingSetters.Set_UnitSocial_Layouts_Controls_DataUpdateInformationControl_LastUpdateDateTime(this.obj5, obj.ToString(), null); } }
private void Update_IsActive(global::System.Boolean obj, int phase) { if((phase & ((1 << 0) | NOT_PHASED )) != 0) { XamlBindingSetters.Set_Windows_UI_Xaml_Controls_TextBlock_Text(this.obj16, obj.ToString(), null); } }
private void Update_PrecioInsumo(global::System.Double obj, int phase) { if((phase & ((1 << 0) | NOT_PHASED )) != 0) { XamlBindingSetters.Set_Windows_UI_Xaml_Controls_TextBlock_Text(this.obj8, obj.ToString(), null); } }
public Channel(global::Ubiquitous.MainForm.EndPoint endpoint) { Title = endpoint.ToString(); EndPoint = endpoint; }