Beispiel #1
0
        /// <summary>
        /// Add a media file chooser with given name. If name is null pick a name automatically avoiding duplicates.
        /// </summary>
        /// <param name="name">Name.</param>
        void AddMediaFileChooser(String name)
        {
            if (name == null)
            {
                int i = fileChoosers.Count;

                if (i == 0)
                {
                    name = Catalog.GetString("Main camera angle");
                }
                else
                {
                    name = String.Format("{0} {1}", Catalog.GetString("Angle"), i);
                    while (fileChoosers.Any(c => c.MediaFile.Name == name))
                    {
                        name = String.Format("{0} {1}", Catalog.GetString("Angle"), ++i);
                    }
                }
            }

            MediaFileChooser chooser = new MediaFileChooser(name);

            chooser.ChangedEvent += HandleFileChangedEvent;
            // When the chooser is allocated we scroll to the bottom of the window.
            chooser.SizeAllocated += HandleChooserAllocated;

            chooser.ShowAll();

            mfss_vbox.PackStart(chooser, true, true, 0);

            fileChoosers.Add(chooser);
        }
        /// <summary>
        /// Add a media file chooser with given name. If name is null pick a name automatically avoiding duplicates.
        /// </summary>
        /// <param name="name">Name.</param>
        void AddMediaFileChooser(String name)
        {
            if (name == null) {
                int i = fileChoosers.Count;

                if (i == 0) {
                    name = Catalog.GetString ("Main camera angle");
                } else {
                    name = String.Format ("{0} {1}", Catalog.GetString ("Angle"), i);
                    while (fileChoosers.Any (c => c.MediaFile.Name == name)) {
                        name = String.Format ("{0} {1}", Catalog.GetString ("Angle"), ++i);
                    }
                }
            }

            MediaFileChooser chooser = new MediaFileChooser (name);

            chooser.ChangedEvent += HandleFileChangedEvent;
            // When the chooser is allocated we scroll to the bottom of the window.
            chooser.SizeAllocated += HandleChooserAllocated;

            chooser.ShowAll ();

            mfss_vbox.PackStart (chooser, true, true, 0);

            fileChoosers.Add (chooser);
        }