Пример #1
0
        public RoutineBuilder(Routine routine)
        {
            //View initialization
            InitializeComponent();
            LivePreview = false;
            //Initialize Routine
            _routine = routine;
            _routine.RoutineBuilder = this;
            tbxRoutineName.Text     = _routine.Name;
            this.Title = _routine.Name;
            //Build Canvas toolbar - drawing shapes icons
            toolbarButtons = new List <ToggleButton>();
            toolbarButtons.Add(btnToolbarMove);
            toolbarButtons.Add(btnToolbarArc);
            toolbarButtons.Add(btnToolbarCircle);
            toolbarButtons.Add(btnToolbarDot);
            toolbarButtons.Add(btnToolbarLine);
            toolbarButtons.Add(btnToolbarPolyline);
            toolbarButtons.Add(btnToolbarRectangle);
            toolbarButtons.Add(btnToolbarReferencePoint);
            toolbarButtons.Add(btnToolbarAttrPoint);
            _activeTool           = null;
            _drawing              = false;
            _movingShape          = false;
            _movingReferencePoint = false;
            _movingAttributePoint = false;
            _makingPath           = false;
            _makingPathStep2      = false;
            attributePointPopup   = new AttributePointPopup();
            //Build "Add Fixture" popup
            addFixturePop = new AddFixturePopup();
            addFixturePop.AddSelectedClick += new RoutedEventHandler(SubroutineBuilder_AddSelectedClick);

            //Initialize Timeline
            CollectionContainer items = new CollectionContainer();

            items.Collection = _routine.RoutineFixtures;
            CollectionContainer  newFixtureLineCollection = new CollectionContainer();
            BindingList <string> newFixtureLine           = new BindingList <string>();

            newFixtureLine.Add("Click here to add a fixture...");
            newFixtureLineCollection.Collection = newFixtureLine;

            CompositeCollection cmpc = new CompositeCollection();

            cmpc.Add(items);
            cmpc.Add(newFixtureLineCollection);

            lbxTimeline.ItemsSource = cmpc;
            //lbxTimeline.ItemsSource = _routine.RoutineFixtures;
            _lastSelectedFixture = null;

            //Step items list. necessary?
            lbxSteps.ItemsSource = null;

            //Reference Point list.
            lbxReferencePoints.ItemsSource = null;
        }
Пример #2
0
        private void Window_Closing(object sender, CancelEventArgs e)
        {
            addFixturePop.Hide();
            addFixturePop = null;
            attributePointPopup.Hide();
            attributePointPopup = null;

            _routine.RoutineBuilder = null;
            _routine.DetachStepsFromCanvas(Canvas);
        }
        public RoutineBuilder(Routine routine)
        {
            //View initialization
            InitializeComponent();
            LivePreview = false;
            //Initialize Routine
            _routine = routine;
            _routine.RoutineBuilder = this;
            tbxRoutineName.Text = _routine.Name;
            this.Title = _routine.Name;
            //Build Canvas toolbar - drawing shapes icons
            toolbarButtons = new List<ToggleButton>();
            toolbarButtons.Add(btnToolbarMove);
            toolbarButtons.Add(btnToolbarArc);
            toolbarButtons.Add(btnToolbarCircle);
            toolbarButtons.Add(btnToolbarDot);
            toolbarButtons.Add(btnToolbarLine);
            toolbarButtons.Add(btnToolbarPolyline);
            toolbarButtons.Add(btnToolbarRectangle);
            toolbarButtons.Add(btnToolbarReferencePoint);
            toolbarButtons.Add(btnToolbarAttrPoint);
            _activeTool = null;
            _drawing = false;
            _movingShape = false;
            _movingReferencePoint = false;
            _movingAttributePoint = false;
            _makingPath = false;
            _makingPathStep2 = false;
            attributePointPopup = new AttributePointPopup();
            //Build "Add Fixture" popup
            addFixturePop = new AddFixturePopup();
            addFixturePop.AddSelectedClick += new RoutedEventHandler(SubroutineBuilder_AddSelectedClick);

            //Initialize Timeline
            CollectionContainer items = new CollectionContainer();
            items.Collection = _routine.RoutineFixtures;
            CollectionContainer newFixtureLineCollection = new CollectionContainer();
            BindingList<string> newFixtureLine = new BindingList<string>();
            newFixtureLine.Add("Click here to add a fixture...");
            newFixtureLineCollection.Collection = newFixtureLine;

            CompositeCollection cmpc = new CompositeCollection();
            cmpc.Add(items);
            cmpc.Add(newFixtureLineCollection);

            lbxTimeline.ItemsSource = cmpc;
            //lbxTimeline.ItemsSource = _routine.RoutineFixtures;
            _lastSelectedFixture = null;

            //Step items list. necessary?
            lbxSteps.ItemsSource = null;

            //Reference Point list.
            lbxReferencePoints.ItemsSource = null;
        }
        private void Window_Closing(object sender, CancelEventArgs e)
        {
            addFixturePop.Hide();
            addFixturePop = null;
            attributePointPopup.Hide();
            attributePointPopup = null;

            _routine.RoutineBuilder = null;
            _routine.DetachStepsFromCanvas(Canvas);
        }