public void VerifyProjectType()
        {
            IProjectType projectType = BusinessObjectInitializer.CreateProjectType();

            Random random = new Random();

            projectType.Type = DATestUtils.GenerateString(20, true, false);
            projectType.Rank = random.Next(100000, 200000);

            int newId = InsertProjectTypeTest(projectType);

            Assert.Greater(newId, 0);

            int rowsAffected = UpdateProjectTypeTest(projectType);

            Assert.AreEqual(1, rowsAffected);

            DataTable resultTable = SelectProjectTypeTest(projectType).Tables[0];

            //Verifies that the table contains the correct column names and order
            StringCollection columns = new StringCollection();

            columns.AddRange(new string[] { "Type",
                                            "Rank",
                                            "Id" });

            DATestUtils.CheckTableStructure(resultTable, columns);

            int rowCount = DeleteProjectTypeTest(projectType);

            Assert.AreEqual(1, rowCount);
        }
        public DataSet SelectProjectTypeTest(IProjectType ProjectType)
        {
            DataSet tableVerify = new DataSet();

            tableVerify = dbEntity.SelectObject(ProjectType) as DataSet;
            return(tableVerify);
        }
Example #3
0
        protected override void InitializeObject(IGenericEntity ent)
        {
            if (ent is IProjectType)
            {
                IProjectType      ProjectType = (IProjectType)ent;
                DBStoredProcedure spInsert    = new DBStoredProcedure();
                spInsert.ProcedureName = "catInsertProjectType";
                spInsert.AddParameter(new DBParameter("@Type", DbType.String, ParameterDirection.Input, ProjectType.Type));
                spInsert.AddParameter(new DBParameter("@Rank", DbType.Int32, ParameterDirection.Input, ProjectType.Rank));

                DBStoredProcedure spUpdate = new DBStoredProcedure();
                spUpdate.ProcedureName = "catUpdateProjectType";
                spUpdate.AddParameter(new DBParameter("@Id", DbType.Int32, ParameterDirection.Input, ProjectType.Id));
                spUpdate.AddParameter(new DBParameter("@Type", DbType.String, ParameterDirection.Input, ProjectType.Type));
                spUpdate.AddParameter(new DBParameter("@Rank", DbType.Int32, ParameterDirection.Input, ProjectType.Rank));

                DBStoredProcedure spDelete = new DBStoredProcedure();
                spDelete.ProcedureName = "catDeleteProjectType";
                spDelete.AddParameter(new DBParameter("@Id", DbType.Int32, ParameterDirection.Input, ProjectType.Id));

                this.AddStoredProcedure("InsertObject", spInsert);
                this.AddStoredProcedure("UpdateObject", spUpdate);
                this.AddStoredProcedure("DeleteObject", spDelete);

                DBStoredProcedure spSelect = new DBStoredProcedure();
                spSelect.ProcedureName = "catSelectProjectType";
                spSelect.AddParameter(new DBParameter("@Id", DbType.Int32, ParameterDirection.Input, ProjectType.Id));
                this.AddStoredProcedure("SelectObject", spSelect);
            }
        }
 public OfficeController()
 {
     off       = new MOffice();
     proType   = new MProjectType();
     phaseType = new MPhaseType();
     speedType = new MSpeedConnectionType();
     offScop   = new MOfficeScope();
 }
Example #5
0
 public LabController()
 {
     lab       = new MLab();
     proType   = new MProjectType();
     phaseType = new MPhaseType();
     speedType = new MSpeedConnectionType();
     labScop   = new MLabScope();
 }
 public FactoryController()
 {
     fac       = new MFactory();
     proType   = new MProjectType();
     phaseType = new MPhaseType();
     speedType = new MSpeedConnectionType();
     fabScop   = new MFabScope();
 }
Example #7
0
 public void Register(IProjectType projectType)
 {
     if (projectType == null)
     {
         throw new ArgumentNullException("projectType");
     }
     this.projectTypes.Add(projectType);
 }
 public DataCenterController()
 {
     dc        = new MDataCenter();
     proType   = new MProjectType();
     phaseType = new MPhaseType();
     speedType = new MSpeedConnectionType();
     dcScope   = new MDcScope();
 }
Example #9
0
 public HomeController()
 {
     dc      = new MDataCenter();
     off     = new MOffice();
     lab     = new MLab();
     fac     = new MFactory();
     other   = new MOtherProject();
     phaType = new MPhaseType();
     proType = new MProjectType();
     speed   = new MSpeedConnectionType();
 }
        public void SaveProject(IProject project, IProjectType type, string location)
        {
            if (type == null)
                throw new ArgumentNullException("type");

            var gmFileType = type as IGmFileProjectType;

            if (gmFileType == null)
                throw new ApplicationException($"The type of project \"{type.Description}\" cannot be saved as a Game Maker File.");

            gmFileType.SaveProject(project, location);
        }
        public void SaveProject(IProject project, IProjectType type, string location)
        {
            if (type == null)
                throw new ArgumentNullException("type");

            var gmJsonType = type as JsonProjectType;

            if (gmJsonType == null)
                throw new ApplicationException($"The type of project \"{type.Description}\" cannot be saved as a Game Creator JSON project.");

            gmJsonType.SaveProject(project, location);
        }
Example #12
0
 protected XamlProject(IProjectStore projectStore, ICodeDocumentType codeDocumentType, IProjectType projectType, IServiceProvider serviceProvider)
     : base(projectStore, codeDocumentType, projectType, serviceProvider)
 {
 }
Example #13
0
        public void Load(IServices services)
        {
            this.services = services;
            ICommandService service = (ICommandService)this.services.GetService(typeof(ICommandService));
            IExpressionMefHostingService expressionMefHostingService = this.services.GetService <IExpressionMefHostingService>();
            IDocumentTypeManager         documentTypeManager         = new DocumentTypeManager(new UnknownDocumentType());

            this.services.AddService(typeof(IDocumentTypeManager), documentTypeManager);
            IProjectTypeManager projectTypeManager = new ProjectTypeManager();

            this.services.AddService(typeof(IProjectTypeManager), projectTypeManager);
            IConfigurationService configurationService = this.services.GetService <IConfigurationService>();
            ProjectManager        projectManager       = new ProjectManager(this.services, configurationService["ProjectManager"]);

            this.services.AddService(typeof(IProjectManager), projectManager);
            service.AddTarget(projectManager);
            this.services.AddService(typeof(IExternalChanges), projectManager);
            this.solutionService = new SolutionService(projectManager);
            this.services.AddService(typeof(ISolutionService), this.solutionService);
            this.assemblyLoggingService = new AssemblyLoggingService(configurationService.ConfigurationDirectoryPath);
            this.services.AddService(typeof(IAssemblyLoggingService), this.assemblyLoggingService);
            IProjectAdapterService projectAdapterService = new ProjectAdapterService(this.services);

            this.services.AddService(typeof(IProjectAdapterService), projectAdapterService);
            if (expressionMefHostingService != null)
            {
                expressionMefHostingService.AddInternalPart(projectAdapterService);
                expressionMefHostingService.AddInternalPart(this.solutionService);
            }
            IOptionsDialogService optionsDialogService = this.services.GetService <IOptionsDialogService>();

            this.projectSystemOptionsPage = new ProjectSystemOptionsPage(projectManager, this.assemblyLoggingService);
            optionsDialogService.OptionsPages.Add(this.projectSystemOptionsPage);
            this.assemblyDocumentType = new AssemblyDocumentType();
            documentTypeManager.Register(this.assemblyDocumentType);
            this.projectReferenceDocumentType = new ProjectReferenceDocumentType();
            documentTypeManager.Register(this.projectReferenceDocumentType);
            this.folderDocumentType = new FolderDocumentType();
            documentTypeManager.Register(this.folderDocumentType);
            this.comReferenceDocumentType = new ComReferenceDocumentType();
            documentTypeManager.Register(this.comReferenceDocumentType);
            this.cursorDocumentType = new CursorDocumentType();
            documentTypeManager.Register(this.cursorDocumentType);
            this.deepZoomDocumentType = new DeepZoomDocumentType();
            documentTypeManager.Register(this.deepZoomDocumentType);
            this.websiteProjectType = new WebsiteProjectType();
            projectTypeManager.Register(this.websiteProjectType);
            this.webApplicationProjectType = new WebApplicationProjectType();
            projectTypeManager.Register(this.webApplicationProjectType);
            this.assemblyService = new AssemblyService(this.services);
            this.services.AddService(typeof(IAssemblyService), this.assemblyService);
            this.services.AddService(typeof(ISatelliteAssemblyResolver), this.assemblyService);
            this.blendSdkAssemblyResolver = new BlendSdkAssemblyResolver();
            this.assemblyService.RegisterLibraryResolver(this.blendSdkAssemblyResolver);
            this.blendAssemblyResolver = new BlendAssemblyResolver();
            this.assemblyService.RegisterLibraryResolver(this.blendAssemblyResolver);
            Microsoft.Expression.Framework.UserInterface.IWindowService windowService = this.services.GetService <Microsoft.Expression.Framework.UserInterface.IWindowService>();
            windowService.Closing += new CancelEventHandler(this.WindowManager_Closing);
            Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Send, new DispatcherOperationCallback((object o) => {
                Application.Current.SessionEnding += new SessionEndingCancelEventHandler(this.Current_SessionEnding);
                return(null);
            }), null);
            UIThreadDispatcher.Instance.BeginInvoke(DispatcherPriority.SystemIdle, new Action(this.assemblyService.AssemblyCache.Clean));
        }
Example #14
0
        // GET: Project

        public ProjectController()
        {
            pro   = new MProject();
            ptype = new MProjectType();
        }
Example #15
0
 protected WindowsExecutableProject(IProjectStore projectStore, ICodeDocumentType codeDocumentType, IProjectType projectType, IServiceProvider serviceProvider) : base(projectStore, codeDocumentType, projectType, serviceProvider)
 {
 }
Example #16
0
 public void Add(IProjectType value)
 {
     this.list.Add(value);
 }
 protected ExecutableProjectBase(Microsoft.Expression.Project.IProjectStore projectStore, ICodeDocumentType codeDocumentType, IProjectType projectType, IServiceProvider serviceProvider) : base(projectStore, codeDocumentType, projectType, serviceProvider)
 {
 }
Example #18
0
 public bool Contains(IProjectType value)
 {
     return(this.list.Contains(value));
 }
        public int DeleteProjectTypeTest(IProjectType ProjectType)
        {
            int rowCount = dbEntity.DeleteObject(ProjectType);

            return(rowCount);
        }
 public int InsertProjectTypeTest(IProjectType ProjectType)
 {
     ProjectType.Id = dbEntity.InsertObject(ProjectType);
     return(ProjectType.Id);
 }
Example #21
0
 public new static IProject Create(IProjectStore projectStore, ICodeDocumentType codeDocumentType, IProjectType projectType, IServiceProvider serviceProvider)
 {
     return((IProject)KnownProjectBase.TryCreate((Func <KnownProjectBase>)(() => (KnownProjectBase) new WpfProject(projectStore, codeDocumentType, projectType, serviceProvider))));
 }
Example #22
0
 private SilverlightProject(IProjectStore projectStore, ICodeDocumentType codeDocumentType, IProjectType projectType, IServiceProvider serviceProvider)
     : base(projectStore, codeDocumentType, projectType, serviceProvider)
 {
     this.webServerService = serviceProvider.GetService <IWebServerService>();
 }
Example #23
0
 public void Remove(IProjectType value)
 {
     this.list.Remove(value);
 }
Example #24
0
 public void Unregister(IProjectType projectType)
 {
     this.projectTypes.Remove(projectType);
 }
Example #25
0
 public static IProject Create(IProjectStore projectStore, ICodeDocumentType codeDocumentType, IProjectType projectType, IServiceProvider serviceProvider)
 {
     return(KnownProjectBase.TryCreate(() => new WebApplicationProject(projectStore, codeDocumentType, projectType, serviceProvider)));
 }
Example #26
0
        protected INamedProject InitializeProject(IProjectStore projectStore)
        {
            INamedProject namedProject;
            INamedProject unlicensedProject = null;

            try
            {
                IProjectType projectTypeForProject = this.Services.ProjectTypeManager().GetProjectTypeForProject(projectStore);
                if (projectTypeForProject != null)
                {
                    IProjectCreateError projectCreateError = projectTypeForProject.CanCreateProject(projectStore);
                    if (projectCreateError != null)
                    {
                        projectTypeForProject = this.Services.ProjectTypeManager().UnknownProjectType;
                    }
                    if (projectTypeForProject is UnknownProjectType && SolutionBase.IsReloadPromptEnabled())
                    {
                        InvalidProjectStore invalidProjectStore = projectStore as InvalidProjectStore;
                        if (invalidProjectStore == null || string.IsNullOrEmpty(invalidProjectStore.InvalidStateDescription))
                        {
                            this.PromptWithUnsupportedProjectDetails(projectStore, projectCreateError);
                        }
                        else
                        {
                            IMessageDisplayService messageDisplayService = this.Services.MessageDisplayService();
                            ErrorArgs   errorArg         = new ErrorArgs();
                            CultureInfo currentUICulture = CultureInfo.CurrentUICulture;
                            string      unsupportedProjectWithDescription = StringTable.UnsupportedProjectWithDescription;
                            object[]    displayName = new object[] { projectStore.DocumentReference.DisplayName, invalidProjectStore.InvalidStateDescription };
                            errorArg.Message      = string.Format(currentUICulture, unsupportedProjectWithDescription, displayName);
                            errorArg.AutomationId = "OpenProjectErrorDialog";
                            messageDisplayService.ShowError(errorArg);
                        }
                    }
                    LicenseState licenseState = LicensingHelper.IsProjectLicensed(projectStore, this.serviceProvider);
                    if (!licenseState.IsExpired)
                    {
                        if (!licenseState.FullyLicensed)
                        {
                            LicensingHelper.UnlicensedProjectLoadAttempted();
                        }
                        unlicensedProject = projectTypeForProject.CreateProject(projectStore, this.GetCodeDocumentTypeFromProject(projectStore), this.serviceProvider);
                    }
                    else
                    {
                        LicensingHelper.UnlicensedProjectLoadAttempted();
                        unlicensedProject = new UnlicensedProject(projectStore, this.serviceProvider);
                    }
                    return(unlicensedProject);
                }
                else
                {
                    namedProject = null;
                }
            }
            catch (Exception exception)
            {
                if (unlicensedProject != null)
                {
                    projectStore.Dispose();
                    unlicensedProject.Dispose();
                    unlicensedProject = null;
                }
                throw;
            }
            return(namedProject);
        }
Example #27
0
 public static new IProject Create(IProjectStore projectStore, ICodeDocumentType codeDocumentType, IProjectType projectType, IServiceProvider serviceProvider)
 {
     return(KnownProjectBase.TryCreate(() => new SilverlightProject(projectStore, codeDocumentType, projectType, serviceProvider)));
 }
Example #28
0
 private WpfProject(IProjectStore projectStore, ICodeDocumentType codeDocumentType, IProjectType projectType, IServiceProvider serviceProvider)
     : base(projectStore, codeDocumentType, projectType, serviceProvider)
 {
 }