示例#1
0
        /// <summary>Get Ibus keyboard at given index</summary>
        public string GetKeyboardName(int index)
        {
            if (Connection == null)
            {
                return(String.Empty);
            }
            var ibusWrapper = new IBusDotNet.InputBusWrapper(Connection);

            object[]       engines    = ibusWrapper.InputBus.ListActiveEngines();
            IBusEngineDesc engineDesc = IBusEngineDesc.GetEngineDesc(engines[index]);

            return(FormatKeyboardIdentifier(engineDesc));
        }
示例#2
0
        public void CanGetEngineDesc()
        {
            Connection = IBusConnectionFactory.Create();
            if (Connection == null)
            {
                Assert.Ignore("Can't run this test without ibus running.");
                return;
            }

            var ibusWrapper = new IBusDotNet.InputBusWrapper(Connection);

            object[] engines = ibusWrapper.InputBus.ListActiveEngines();
            if (engines.Length == 0)
            {
                Assert.Ignore("Can't run this test without any ibus keyboards installed.");
                return;
            }

            Assert.IsNotNull(IBusEngineDesc.GetEngineDesc(engines[0]));
        }