Пример #1
0
        double windowW = 0; // width of parent canvas/window

        #endregion Fields

        #region Constructors

        public TourAuthoringUI(ArtworkModeWindow artModeWinParam, TourSystem tourSystemParam)
        {
            artModeWin = artModeWinParam;
            tourSystem = tourSystemParam;
            canvasWrapper = artModeWin.tourAuthoringUICanvas;
            opacitySlider = new SurfaceSlider();

            w = artModeWin.Width;
            timelineHeight = 40; // 40 px is a good guideline to follow for touchability -- borrowed from Microsoft's touch guidelines

            windowW = w;
            centerX = w / 2;

            timelineLength = 0;
            timelineCount = 0;

            tourSeekBarTimerCount = new Label();
            tourSeekBarLength = new Label();
            backgroundMoved = false;
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        public ArtworkModeWindow(string currentArtworkFName)
        {
            InitializeComponent();
            String[] c = Environment.GetCommandLineArgs();

            if (c.Length != 1)
            {
                if (c[1].Contains("noauthoring"))
                {
                    Main.Children.Remove(tourAuthoringButton);
                    Main.Children.Remove(exitButton);

                }
            }
            // Add handlers for window availability events
            AddWindowAvailabilityHandlers();
            leftPanelVisible = true;
            bottomPanelVisible = true;
            scatteremoved = false;
            dockedItems = 0;
            DockedItems = new ArrayList();
            BarOffset = 0;
            _noHotspots = true;

            currentArtworkFileName = currentArtworkFName;
            newMeta = new metadata_lists(this, currentArtworkFileName);
            authToolsVisible = true;
            _searchedAssets = false;
            _searchedHotspots = false;

            DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty(ScatterViewItem.CenterProperty, typeof(ScatterViewItem));

            // Hotspots
            m_hotspotCollection = new HotspotCollection();

            tourSystem = new TourSystem(this);

            // event handlers for tour testing buttons

            // event handlers for tour playback/authoring
            tourExploreButton.Click += tourSystem.TourExploreButton_Click;
            tourControlButton.Click += tourSystem.TourControlButton_Click;
            tourStopButton.Click += tourSystem.TourStopButton_Click;
            tourAuthoringDoneButton.Click += tourSystem.TourAuthoringDoneButton_Click;
            tourAuthoringDeleteButton.Click += tourSystem.TourAuthoringDeleteButton_Click;
            //drawPaths.Click += tourSystem.drawPaths_Click;
            //metaData.Click += new RoutedEventHandler(metaData_Click);
            tourAuthoringSaveButton.Click += TourAuthoringSaveButton_Click;
            //addAudioButton.Click += tourSystem.grabSound;
            //addAudioButton.Visibility = Visibility.Collapsed;
            //Canvas.SetTop(downButton, 648);

            //Canvas.SetLeft(collapseButtonDown, (collapseBar.Width - msi_thumb.ActualWidth) / 2 + msi_thumb.ActualWidth);
            Canvas.SetTop(collapseButtonLeft, 400);
            Canvas.SetTop(collapseButtonRight, 400);

            _resetTimer.Interval = TimeSpan.FromSeconds(300);
            _resetTimer.Tick += new EventHandler(_resetTimer_Tick);
            _resetTimer.Start();
        }