Example #1
0
        private static void Initialize(IEnumerable <Service> services)
        {
            var allServices = new [] { new UnifiedService() }.Concat(services);

            PlatformManager.InitializePlatform(new WindowsUnix());

            // Initialize the PhoneBook
            var locale = Platform.GetCurrentLocale();

            PhoneBook.Mcc      = "000"; //TODO
            PhoneBook.Mnc      = "000"; //TODO
            PhoneBook.Language = locale.Substring(0, 2);
            PhoneBook.Country  = locale.Substring(3, locale.Length - 3);

            // Uncomment if you want to get information from the Framework
            Utils.Logging = true;

            PlatformManager.InitializeMain(allServices.ToArray());

            Settings = MutableSettingsManager.Load <TerminalSettings>();

            BubbleGroupEvents.OnBubbleInserted += (bubble, bubbleGroup) =>
            {
                var textBubble = bubble as TextBubble;
                if (textBubble != null)
                {
                    Console.WriteLine("Message " + (textBubble.Direction == Bubble.BubbleDirection.Incoming ? "from" : "to") + ": " + bubbleGroup.Title + " (" + bubbleGroup.Address + "): " + textBubble.Message);
                }
            };
        }
Example #2
0
 private static void LoadSettingsIfNeeded()
 {
     if (_settings != null)
     {
         return;
     }
     _settings = MutableSettingsManager.Load <TelegramSetupSettings>();
 }