public DashboardDataHubPanel()
 {
     ddh = new DashboardDataHub();
     ddh.StartSources = "zomb://0.0.0.0/DBPkt";
     ddh.InvalidPacketAction = InvalidPacketActions.Ignore;
     this.DoubleBuffered = true;
 }
 public DashboardDataPanel()
 {
     DashboardDataHub = new DashboardDataHub();
     AutoStart = true;
     this.Loaded += delegate
     {
         ReloadControls();
         if (AutoStart)
             Start();
     };
 }
 protected DashboardDataCanvas(bool init)
 {
     if (init)
         DashboardDataHub = new DashboardDataHub();
     this.Loaded += delegate
     {
         ReloadControls();
         if (AutoStart)
             Start();
     };
 }
 void ZomBGLControl_ControlAdded(object sender, ZomBControlAddedEventArgs e)
 {
     localDDH = e.Controller.GetDashboardDataHub();
 }
 public SmartDataSource(ZomBUrl info, IZomBController ddh)
 {
     if (ddh != null)
         this.ddh = ddh.GetDashboardDataHub();
 }
 public SmartDataSource(IZomBController ddh)
 {
     this.ddh = ddh.GetDashboardDataHub();
 }
        protected void Init(bool newddh)
        {
            //Check Singleton
            bool createdNew = true;
            try
            {
                if ((int)Registry.LocalMachine.OpenSubKey(@"Software\ZomB").GetValue("Singleton", 0) == 1)
                    mutex = new Mutex(true, "ZomBGLSingletonMutex", out createdNew);
            }
            catch { }

            if ((!createdNew))
            {
                Process current = Process.GetCurrentProcess();
                //Don't kill designer
                if ((!current.MainModule.FileName.Contains("Microsoft Visual Studio")) && (!current.MainModule.FileName.Contains("devenv")) && (!current.MainModule.FileName.Contains("MonoDevelop")) && (!current.MainModule.FileName.Contains("VCSExpress.exe")))
                {
                    foreach (Process process in Process.GetProcessesByName(current.ProcessName))
                    {
                        if (process.Id != current.Id)
                        {
                            SetForegroundWindow(process.MainWindowHandle);
                            current.Kill();
                            return;
                        }
                    }
                }
            }

            if (newddh)
            {
                this.dashboardDataHub1 = new DashboardDataHub();
                dashboardDataHub1.StartSources = "zomb://0.0.0.0/DBPkt";//default, will always work
                dashboardDataHub1.InvalidPacketAction = InvalidPacketActions.Ignore;
            }

            this.Title = "ZomB Dashboard";
            this.Icon = BitmapFrame.Create(new Uri("pack://*****:*****@"Software\ZomB").GetValue("DriverDisable", 0) == 1;
            }
            catch { }

            if (Environment.UserName == "Driver" && !driveroveride)
            {
                this.WindowStyle = WindowStyle.None;
                this.WindowStartupLocation = WindowStartupLocation.Manual;
                this.Left = 0;
                this.Top = 0;
            }
            GC.KeepAlive(mutex);
            this.Closing += delegate
            {
                try
                {
                    GC.KeepAlive(mutex);
                    mutex.Close();
                }
                catch { }
                try
                {
                    dashboardDataHub1.Stop();
                    GC.Collect();
                }
                catch { }
            };
        }
 void IZomBControl.ControlAdded(object sender, ZomBControlAddedEventArgs e)
 {
     ddh = e.Controller.GetDashboardDataHub();
     //we only want the controller, now remove ourselves
     ddh.Remove(this);
 }
 void ZomBGLControl_ControlAdded(object sender, ZomBControlAddedEventArgs e)
 {
     localDDH = e.Controller.GetDashboardDataHub();
     if (this.Content == null)
     {
         this.Content = GroupDescriptor.InflateControls();
         Sizeify();
     }
     ResetControls();
 }