This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Main() | |
{ | |
DoubleLinkedList list = new DoubleLinkedList(); | |
list.Insert("1"); | |
list.Insert("2"); | |
list.Insert("3"); | |
DoubleLink link4 = list.Insert("4"); | |
list.Insert("5"); | |
Console.WriteLine("List: " + list); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// ---------------------------------------------------------------------------- | |
/// <summary>Convert from String^ to std::string</summary> | |
System::Void TestClass::MarshalString(String ^ strIn, string& strOut) | |
{ | |
using namespace Runtime::InteropServices; | |
const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(strIn)).ToPointer(); | |
strOut = chars; | |
Marshal::FreeHGlobal(IntPtr((void*)chars)); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
// ... | |
Stopwatch sw = new Stopwatch(); | |
sw.Start(); | |
// ... | |
sw.Stop(); | |
Console.WriteLine("Elapsed={0}", sw.Elapsed); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Reflection; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
namespace Xeno.Tools | |
{ | |
class IniFile | |
{ | |
private const string INI_EXT = ".ini"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Used to create a Combined GUID for database Primary Keys | |
// | |
public Guid GenerateComb() | |
{ | |
// T-SQL Equivalent | |
// DECLARE @guid UNIQUEIDENTIFIER; | |
// SET @guid = CAST(CAST(NEWID() AS BINARY(10)) + CAST(GETDATE() AS BINARY(6)) AS UNIQUEIDENTIFIER); | |
// SELECT @guid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace XI.Template | |
{ | |
using System.ComponentModel; | |
class ThreadTest | |
{ | |
#region Constructor and attributes | |
private System.ComponentModel.BackgroundWorker _thread; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requires the following permission in your AndroidManifest.xml | |
// <uses-permission android:name="android.permission.READ_PHONE_STATE" /> | |
using System.Collections.Generic; | |
using Android.Telephony; | |
// ... | |
protected override void OnCreate(Bundle bundle) | |
{ | |
base.OnCreate(bundle); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Source: | |
https://forums.xamarin.com/discussion/30055/connecting-to-a-bluetooth-scanner-with-xamarin-android#Comment_94845 | |
The problem relates to device.GetUuids. You are assuming the Uuid is what you | |
want with ElementAt(0). What you need is a loop inside your foreach, like in | |
the following testing, that the device supports the Bluetooth Serial Port Profile | |
*/ | |
ParcelUuid[] uuids = device.GetUuids(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace TestApp.Droid | |
{ | |
[Activity(Label = "TestApp", | |
Icon = "@drawable/icon", | |
Theme = "@style/MyTheme", | |
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, | |
NoHistory = true)] | |
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity | |
{ | |
protected override void OnCreate(Bundle bundle) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace TestApp.Droid | |
{ | |
[Activity(Label = "myApp", | |
MainLauncher = true, | |
Icon = "@drawable/Icon", | |
ScreenOrientation = ScreenOrientation.Landscape)] | |
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity | |
{ | |
protected override void OnCreate(Bundle bundle) | |
{ |