Esempio n. 1
0
        /// <summary> Initializing constructor. </summary>
        /// <param name="appResourceName"> The ressource name of the application. <see cref="System.String"/> </param>
        /// <param name="shellResourceName"> The ressource name of the root shell. <see cref="System.String"/> </param>
        /// <param name="fallbackResources"> The fallback ressources to apply. <see cref="Xt.XtFallbackRessources"/> </param>
        public XtApplicationShell(string appResourceName, string shellResourceName, Xt.XtFallbackRessources fallbackResources)
        {
            if (_instance != null)
            {
                Console.WriteLine(CLASS_NAME + "::ctr () ERROR: Already an instance created.");
            }

            _appResourceName = appResourceName;

            IntPtr argv = (string.IsNullOrEmpty(shellResourceName) ? IntPtr.Zero : (new XtStringArray(shellResourceName, '|')).Data);
            TInt   argc = (TInt)(argv != IntPtr.Zero ? 1 : 0);

            _shell = Xtlib.XtAppInitialize(ref _appContext, _appResourceName, IntPtr.Zero, 0, ref argc,
                                           argv, fallbackResources.Marshal(), IntPtr.Zero, 0);
            _instance = this;
        }