Exemplo n.º 1
0
        public dynNoteViewModel(dynNoteModel model)
        {
            _model = model;
            model.PropertyChanged += note_PropertyChanged;

            dynSettings.Controller.DynamoViewModel.Model.PropertyChanged += Model_PropertyChanged;
            SelectCommand = new DelegateCommand(Select, CanSelect);
        }
Exemplo n.º 2
0
        public dynNoteViewModel(dynNoteModel model)
        {
            _model = model;
            model.PropertyChanged += note_PropertyChanged;

            dynSettings.Controller.DynamoViewModel.Model.PropertyChanged += Model_PropertyChanged;
            SelectCommand = new DelegateCommand(Select, CanSelect);
        }
Exemplo n.º 3
0
        public dynNoteViewModel(dynNoteModel model)
        {
            _model = model;
            model.PropertyChanged += note_PropertyChanged;

            dynSettings.Controller.DynamoViewModel.Model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Model_PropertyChanged);
            SelectCommand = new DelegateCommand(Select, CanSelect);
        }
Exemplo n.º 4
0
 public NoteEventArgs(dynNoteModel n, Dictionary<string, object> d)
 {
     Note = n;
     Data = d;
 }
Exemplo n.º 5
0
 private void DeleteNote(dynNoteModel note)
 {
     DynamoSelection.Instance.Selection.Remove(note);
     _model.CurrentSpace.Notes.Remove(note);
 }
Exemplo n.º 6
0
        private void AddNote(object parameters)
        {
            var inputs = parameters as Dictionary<string, object> ?? new Dictionary<string, object>();

            // by default place note at center
            var x = 0.0;
            var y = 0.0;

            if (inputs != null && inputs.ContainsKey("x"))
                x = (double)inputs["x"];

            if (inputs != null && inputs.ContainsKey("y"))
                y = (double)inputs["y"];

            var n = new dynNoteModel(x, y);

            //if we have null parameters, the note is being added
            //from the menu, center the view on the note
            if (parameters == null)
            {
                inputs.Add("transformFromOuterCanvasCoordinates", true);
                dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.OnRequestNodeCentered( this, new ModelEventArgs(n, inputs) );
            }

            object id;
            if (inputs.TryGetValue("guid", out id))
                n.GUID = (Guid)id;

            n.Text = (inputs == null || !inputs.ContainsKey("text")) ? "New Note" : inputs["text"].ToString();
            var ws = (inputs == null || !inputs.ContainsKey("workspace")) ? _model.CurrentSpace : (dynWorkspaceModel)inputs["workspace"];

            ws.Notes.Add(n);
        }
Exemplo n.º 7
0
        private void AddNote(object parameters)
        {
            var inputs = (Dictionary<string, object>)parameters;

            // by default place note at center
            var x = 0.0;
            var y = 0.0;

            if (inputs != null && inputs.ContainsKey("x"))
                x = (double)inputs["x"];

            if (inputs != null && inputs.ContainsKey("y"))
                y = (double)inputs["y"];

            var n = new dynNoteModel(x, y);

            n.Text = (inputs == null || !inputs.ContainsKey("text")) ? "New Note" : inputs["text"].ToString();
            var ws = (inputs == null || !inputs.ContainsKey("workspace")) ? _model.CurrentSpace : (dynWorkspaceModel)inputs["workspace"];

            ws.Notes.Add(n);

            if (!ViewingHomespace)
            {
                _model.CurrentSpace.Modified();
            }
        }
Exemplo n.º 8
0
        private void AddNote(object parameters)
        {
            var inputs = (Dictionary<string, object>)parameters;

            inputs = inputs ?? new Dictionary<string, object>();

            // by default place note at center
            var x = 0.0;
            var y = 0.0;

            if (inputs != null && inputs.ContainsKey("x"))
                x = (double)inputs["x"];

            if (inputs != null && inputs.ContainsKey("y"))
                y = (double)inputs["y"];

            var n = new dynNoteModel(x, y);

            dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.OnRequestNoteCentered( this, new NoteEventArgs(n, inputs) );

            n.Text = (inputs == null || !inputs.ContainsKey("text")) ? "New Note" : inputs["text"].ToString();
            var ws = (inputs == null || !inputs.ContainsKey("workspace")) ? _model.CurrentSpace : (dynWorkspaceModel)inputs["workspace"];

            ws.Notes.Add(n);
        }