private void AddComputer_Load(object sender, EventArgs e)

        {
            this.BackColor = Color.FromArgb(240, 240, 240);



            List <DestinationListItem> list = null;

            if (this.isSubscription)

            {
                list = SubscriptionManager.GetListItems();



                this.Text = Properties.Resources.AddComputer_FormTitle_Subscriptions;
            }

            else

            {
                list = ForwardDestinationManager.GetListItems();
            }



            foreach (DestinationListItem dli in list)

            {
                dli.Selected += new EventHandler(dli_Selected);

                this.bonjourListBox1.AddItem(dli);
            }
        }
        public AddComputer(DestinationBase db)

            : this()

        {
            this.dbEdit = db;

            if (db is Subscription)
            {
                this.isSubscription = true;
            }



            IDestinationHandler handler = null;

            if (isSubscription)

            {
                handler = SubscriptionManager.GetHandler(db);
            }

            else

            {
                handler = ForwardDestinationManager.GetHandler(db);
            }

            ShowInputs(null, handler);
        }
Exemple #3
0
        internal void AlreadyRunning(int signalFlag, int signalValue)
        {
            ApplicationMain.Signal signal = (ApplicationMain.Signal)signalFlag;
            bool silent            = ((signal & ApplicationMain.Signal.Silent) == ApplicationMain.Signal.Silent);
            bool reloadDisplays    = ((signal & ApplicationMain.Signal.ReloadDisplays) == ApplicationMain.Signal.ReloadDisplays);
            bool updateLanguage    = ((signal & ApplicationMain.Signal.UpdateLanguage) == ApplicationMain.Signal.UpdateLanguage);
            bool handleListenUrl   = ((signal & ApplicationMain.Signal.HandleListenUrl) == ApplicationMain.Signal.HandleListenUrl);
            bool reloadForwarders  = ((signal & ApplicationMain.Signal.ReloadForwarders) == ApplicationMain.Signal.ReloadForwarders);
            bool reloadSubscribers = ((signal & ApplicationMain.Signal.ReloadSubscribers) == ApplicationMain.Signal.ReloadSubscribers);
            bool showSettings      = ((signal & ApplicationMain.Signal.ShowSettings) == ApplicationMain.Signal.ShowSettings);

            if (!silent && this.controller != null)
            {
                this.controller.SendSystemNotification(Properties.Resources.SystemNotification_Running_Title, Properties.Resources.SystemNotification_Running_Text, null);
            }

            if (reloadDisplays)
            {
                DisplayStyleManager.DiscoverNewDisplayPlugins();
                //if(this.mainForm != null) this.mainForm.BindDisplayList();
            }

            if (updateLanguage)
            {
                if (signalValue == 0)
                {
                    Properties.Settings.Default.CultureCode = "";
                }
                else
                {
                    // read each subfolder in the app folder and find the one with the matching hash
                    System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(Application.StartupPath);
                    foreach (System.IO.DirectoryInfo directory in di.GetDirectories())
                    {
                        if (directory.Name.GetHashCode() == signalValue)
                        {
                            Properties.Settings.Default.CultureCode = directory.Name;
                            break;
                        }
                    }
                }
            }

            if (handleListenUrl)
            {
                HandleListenUrls();
            }

            if (reloadForwarders)
            {
                ForwardDestinationManager.DiscoverNewPlugins();

                /* NOTE: the signalValue should be the hash of the plugin folder that was loaded,
                 * so we could loop through the folders looking for a matching has (similar to how
                 * the updateLanguage section works above), but the DiscoverNewPlugins already
                 * loops through the folders anyway, so we can just let it do its thing. */
            }

            if (reloadSubscribers)
            {
                SubscriptionManager.DiscoverNewPlugins();

                /* NOTE: the signalValue should be the hash of the plugin folder that was loaded,
                 * so we could loop through the folders looking for a matching has (similar to how
                 * the updateLanguage section works above), but the DiscoverNewPlugins already
                 * loops through the folders anyway, so we can just let it do its thing. */
            }

            if (showSettings)
            {
                this.ShowForm();
            }
        }