Exemplo n.º 1
0
        internal void AddMethods(
            MethodViewModel addMethodViewModel,
            MethodViewModel removeMethodViewModel,
            MethodViewModel invokeMethodViewModel)
        {
            if (addMethodViewModel != null)
            {
                _addMethodViewModel = addMethodViewModel;
            }

            if (removeMethodViewModel != null)
            {
                _removeMethodViewModel = removeMethodViewModel;
            }

            if (invokeMethodViewModel != null)
            {
                _invokeMethodViewModel = invokeMethodViewModel;
            }

            // Set image
            if (_addMethodViewModel != null)
            {
                Image = ProjectUtils.GetEventImage(_addMethodViewModel.Method);
            }
            else if (_removeMethodViewModel != null)
            {
                Image = ProjectUtils.GetEventImage(_removeMethodViewModel.Method);
            }
            else if (_invokeMethodViewModel != null)
            {
                Image = ProjectUtils.GetEventImage(_invokeMethodViewModel.Method);
            }
        }
Exemplo n.º 2
0
        internal MethodViewModel(MethodDeclaration method, AD.ProjectMethod projectMethod, ViewModel parent)
            : base(parent)
        {
            _method        = method;
            _projectMethod = projectMethod;

            Caption = NodePrinter.Print(method);
            Image   = ProjectUtils.GetMethodImage(method);
        }
        public TypeViewModel(TypeDeclaration type, AD.ProjectType projectType, ViewModel parent)
            : base(parent)
        {
            _type        = type;
            _projectType = projectType;
            _typeKind    = ProjectUtils.GetTypeKind(type);

            Caption = NodePrinter.Print(type, true, true);
            Image   = ProjectUtils.GetTypeImage(type, _typeKind);
        }
        public FieldViewModel(FieldDeclaration field, AD.ProjectField projectField, ViewModel parent)
            : base(parent)
        {
            _field        = field;
            _projectField = projectField;

            var typeViewModel = FindParent <TypeViewModel>();

            _fieldKind = ProjectUtils.GetFieldKind(field, typeViewModel.Type, typeViewModel.TypeKind);

            Caption = NodePrinter.Print(field, _fieldKind);
            Image   = ProjectUtils.GetFieldImage(field, _fieldKind);
        }
Exemplo n.º 5
0
        private void Load()
        {
            _outputFilePath = ProjectUtils.GetAssemblyOutputFilePath(_projectAssembly);

            if (File.Exists(_filePath))
            {
                var fileInfo = new FileInfo(_filePath);
                _createdDate      = fileInfo.CreationTime;
                _lastModifiedDate = fileInfo.LastWriteTime;
                _fileSize         = fileInfo.Length;
            }

            OnPropertyChanged("OutputFilePath");
            OnPropertyChanged("CreatedDate");
            OnPropertyChanged("LastModifiedDate");
            OnPropertyChanged("FileSize");
        }
Exemplo n.º 6
0
        internal void AddMethods(MethodViewModel getMethodViewModel, MethodViewModel setMethodViewModel)
        {
            if (getMethodViewModel != null)
            {
                _getMethodViewModel = getMethodViewModel;
            }

            if (setMethodViewModel != null)
            {
                _setMethodViewModel = setMethodViewModel;
            }

            // Set image
            if (_getMethodViewModel != null)
            {
                Image = ProjectUtils.GetPropertyImage(_getMethodViewModel.Method);
            }
            else if (_setMethodViewModel != null)
            {
                Image = ProjectUtils.GetPropertyImage(_setMethodViewModel.Method);
            }
        }
 protected override void LoadImage()
 {
     _image = ProjectUtils.GetTypeImage(_type);
 }
 private void UpdateOutputFilePath()
 {
     _outputFilePath = ProjectUtils.GetAssemblyOutputFilePath(_projectAssembly);
     OnPropertyChanged("OutputFilePath");
 }