Ejemplo n.º 1
0
        /// <summary>
        /// Default ctor
        /// </summary>
        public BarRunner(IIde ide, string barPath, string packageName, string activity, bool debuggable, int launchFlags)
        {
            this.ide                = ide;
            this.barPath            = barPath;
            this.packageName        = packageName;
            this.activity           = activity;
            this.debuggable         = debuggable;
            this.launchFlags        = launchFlags;
            cancellationTokenSource = new CancellationTokenSource();
            outputPane              = ide.CreateDebugOutputPane();

            // Load package

            /*try
             * {
             *  var apk = new ApkFile(barPath);
             *  if (!apk.Manifest.TryGetMinSdkVersion(out minSdkVersion))
             *      minSdkVersion = -1;
             * }
             * catch (Exception ex)
             * {
             *  minSdkVersion = -1;
             *  ErrorLog.DumpError(ex);
             * }*/
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Make sure this log is registered.
        /// </summary>
        internal static void EnsureLoaded(IIde ide, bool vsDebugPane)
        {
            if (log != null)
            {
                return;
            }

            var outputPane = !vsDebugPane?ide.CreateDot42OutputPane() : ide.CreateDebugOutputPane();

            var add = false;

            lock (logLock)
            {
                if (log == null)
                {
                    log = new OutputPaneLog(outputPane, vsDebugPane?Levels.Info : Levels.Error, vsDebugPane?DContext.VSDebuggerMessage:(DContext?)null);
                    add = true;
                }
            }
            if (add)
            {
                AddAdditionalLogger(log);
                if (vsDebugPane)
                {
                    AddToContext(DContext.VSDebuggerMessage, log);
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Default ctor
        /// </summary>
        public ApkRunner(IIde ide, string apkPath, string packageName, string activity, bool debuggable, int launchFlags)
        {
            this.ide                = ide;
            this.apkPath            = apkPath;
            this.packageName        = packageName;
            this.activity           = activity;
            this.debuggable         = debuggable;
            this.launchFlags        = launchFlags;
            cancellationTokenSource = new CancellationTokenSource();
            outputPane              = ide.CreateDebugOutputPane();

            // Load package
            try
            {
                var apk = new ApkFile(apkPath);
                if (!apk.Manifest.TryGetMinSdkVersion(out minSdkVersion))
                {
                    minSdkVersion = -1;
                }
            }
            catch (Exception ex)
            {
                minSdkVersion = -1;
                ErrorLog.DumpError(ex);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public LaunchMonitor(IIde ide, IDevice device, string apkPath, string packageName, int apiLevel, int launchFlags, Action <LauncherStates, string> stateUpdate, CancellationToken token)
 {
     this.ide         = ide;
     this.device      = device;
     this.apkPath     = apkPath;
     this.packageName = packageName;
     this.apiLevel    = apiLevel;
     this.launchFlags = launchFlags;
     this.stateUpdate = stateUpdate;
     this.token       = token;
     outputPane       = ide.CreateDebugOutputPane();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Make sure this log is registered.
 /// </summary>
 internal static void EnsureLoaded(IIde ide)
 {
     if (log != null)
         return;
     var outputPane = ide.CreateDebugOutputPane();
     var add = false;
     lock (logLock)
     {
         if (log == null)
         {
             log = new OutputPaneLog(outputPane);
             add = true;
         }
     }
     if (add)
     {
         DLog.AddAdditionalLogger(log);                
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Make sure this log is registered.
        /// </summary>
        internal static void EnsureLoaded(IIde ide)
        {
            if (log != null)
            {
                return;
            }
            var outputPane = ide.CreateDebugOutputPane();
            var add        = false;

            lock (logLock)
            {
                if (log == null)
                {
                    log = new OutputPaneLog(outputPane);
                    add = true;
                }
            }
            if (add)
            {
                DLog.AddAdditionalLogger(log);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Make sure this log is registered.
        /// </summary>
        internal static void EnsureLoaded(IIde ide, bool vsDebugPane)
        {
            if (log != null)
                return;

            var outputPane = !vsDebugPane ? ide.CreateDot42OutputPane() : ide.CreateDebugOutputPane();

            var add = false;
            lock (logLock)
            {
                if (log == null)
                {
                    log = new OutputPaneLog(outputPane, vsDebugPane?Levels.Info : Levels.Error, vsDebugPane?DContext.VSDebuggerMessage:(DContext?) null);
                    add = true;
                }
            }
            if (add)
            {
                AddAdditionalLogger(log);
                if(vsDebugPane)
                    AddToContext(DContext.VSDebuggerMessage, log);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Default ctor
        /// </summary>
        public ApkRunner(IIde ide, string apkPath, string packageName, string activity, bool debuggable, int launchFlags)
        {
            this.ide = ide;
            this.apkPath = apkPath;
            this.packageName = packageName;
            this.activity = activity;
            this.debuggable = debuggable;
            this.launchFlags = launchFlags;
            cancellationTokenSource = new CancellationTokenSource();
            outputPane = ide.CreateDebugOutputPane();

            // Load package
            try
            {
                var apk = new ApkFile(apkPath);
                if (!apk.Manifest.TryGetMinSdkVersion(out minSdkVersion))
                    minSdkVersion = -1;
            }
            catch (Exception ex)
            {
                minSdkVersion = -1;
                ErrorLog.DumpError(ex);
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public LaunchMonitor(IIde ide, IDevice device, string apkPath, string packageName, int apiLevel, int launchFlags, Action<LauncherStates, string> stateUpdate, CancellationToken token)
 {
     this.ide = ide;
     this.device = device;
     this.apkPath = apkPath;
     this.packageName = packageName;
     this.apiLevel = apiLevel;
     this.launchFlags = launchFlags;
     this.stateUpdate = stateUpdate;
     this.token = token;
     outputPane = ide.CreateDebugOutputPane();
 }