当前位置: 首页>>代码示例>>C#>>正文


C# IObjectSpace.GetObject方法代码示例

本文整理汇总了C#中IObjectSpace.GetObject方法的典型用法代码示例。如果您正苦于以下问题:C# IObjectSpace.GetObject方法的具体用法?C# IObjectSpace.GetObject怎么用?C# IObjectSpace.GetObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IObjectSpace的用法示例。


在下文中一共展示了IObjectSpace.GetObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateActionArtifacsts

 private void CreateActionArtifacsts(IObjectSpace objectSpace, RuntimeSetupInfo setupInfo) {
     if (!objectSpace.Contains<ModuleArtifact>(artifact => artifact.Type == ModuleArtifactType.Action)) {
         var moduleTypes = GetModuleTypes(setupInfo);
         var controllers = moduleTypes.SelectMany(type => type.Assembly.GetTypes())
                 .Where(type => !type.IsAbstract && typeof(Controller).IsAssignableFrom(type))
                 .Select(type => type.CreateInstance())
                 .Cast<Controller>();
         foreach (var controller in controllers) {
             var controllerArtifact = objectSpace.GetModuleArtifact(controller.GetType());
             foreach (var action in controller.Actions) {
                 var name = action.Id;
                 var actionArtifact = objectSpace.GetObject<ModuleArtifact>(artifact => artifact.Name == name && artifact.Type == ModuleArtifactType.Action);
                 actionArtifact.Name = name;
                 actionArtifact.Type = ModuleArtifactType.Action;
                 actionArtifact.Text = action.ToolTip;
                 actionArtifact.ModuleChilds.AddRange(controllerArtifact.ModuleChilds);
                 actionArtifact.Artifacts.Add(controllerArtifact);
                 controllerArtifact.Artifacts.Add(actionArtifact);
             }
         }
     }
 }
开发者ID:aries544,项目名称:eXpand,代码行数:22,代码来源:Updater.cs

示例2: GetExtendedInterface

 private static ExtendedInterface GetExtendedInterface(IObjectSpace objectSpace,Type extendedInterface) {
     var extendedInterface1 = objectSpace.GetObject<ExtendedInterface>(@interface => @interface.Name == extendedInterface.Name) ;
     extendedInterface1.Name = extendedInterface.Name;
     return extendedInterface1;
 }
开发者ID:aries544,项目名称:eXpand,代码行数:5,代码来源:ParsingExtensions.cs

示例3: CreateNewExamination

        /// <summary>
        /// Метод создает в БД новое обследование
        /// </summary>
        private IExamination CreateNewExamination(IObjectSpace os, IPatient patient, Guid id, ExaminationType type = null, bool allowEmptyFile = false)
        {
            IExamination examination = os.CreateObject<IExamination>();
            examination.ExaminationSoftType = os.FindObject<ExaminationSoftType>(CriteriaOperator.Parse("ExaminationSoftTypeId = ?", id));
            examination.Patient = os.GetObject<IPatient>(patient);

            examination.AllowEmptyOrNotExistsFile = allowEmptyFile;
            examination.TimeStart = DateTime.Now;
            // Создается новое обследование поэтому файла еще нет
            if (examination.ExaminationFile == null)
            {
                // заводим в базе файл
                //examination.ExaminationFile = os.CreateObject<FileSystemStoreObject>();
                examination.ExaminationFile = os.CreateObject<ExaminationFile>();
                examination.ExaminationFile.OwnerId = (examination as DevExpress.ExpressApp.DC.DCBaseObject).Oid;
                if (type != null)
                {
                    examination.ExaminationType = os.GetObjectByKey<ExaminationType>(type.Oid); //FindObject<ExaminationType>(CriteriaOperator.Parse("ExaminationTypeId = ?", type.));
                }

                // Применяем изменения
                os.CommitChanges();

                if (String.IsNullOrEmpty(examination.ObjectCode) == false)
                {
                    string fileName = examination.ObjectCode;
                    string fileExtension = examination.ExaminationSoftType.ExaminationFileExtension;

                    examination.ExaminationFile.FileName = Converters.GetFileNameWithoutInvalidChars(fileName, fileExtension);
                }
                else
                    throw new Exception("Examination invalid params");
            }

            os.CommitChanges(); // здесь создается пустой файл обследования

            while (os.IsCommitting) { Thread.Sleep(1000); } // ждем пока применятся изменения, не знаю зачем...

            //// Заполняем созданный файл заключения
            //// !!! ЗАПОЛНЯТЬ ЗАКЛЮЧЕНИЕ ПРИ СОЗДАНИИ НЕ НАДО !!!
            //ConclusionViewController conclusionController = Frame.GetController<ConclusionViewController>();
            //if (conclusionController != null)
            //{
            //    conclusionController.PopulateConclusionFile(examination);
            //}

            return examination;
        }
开发者ID:Rukhlov,项目名称:DataStudio,代码行数:51,代码来源:RunDynamicModuleController.cs

示例4: Authenticate

        public override object Authenticate(IObjectSpace objectSpace)
        {
            var customLogonParameters = logonParameters as CustomLogonParameters;

            if (customLogonParameters.Employee == null)
            {
                var message = CaptionHelper.GetLocalizedText("Exceptions", "CustomAuthenticationExceptionEmployeeNull");
                throw new UserFriendlyException(message);
            }
            if (customLogonParameters.Employee.ComparePassword(customLogonParameters.Password) == false)
            {
                var message = CaptionHelper.GetLocalizedText("Exceptions", "CustomAuthenticationExceptionPasswordMismatch");
                throw new AuthenticationException(customLogonParameters.Employee.UserName, message);
            }
            return objectSpace.GetObject(customLogonParameters.Employee);
        }
开发者ID:Rukhlov,项目名称:DataStudio,代码行数:16,代码来源:CustomAuthentication.cs


注:本文中的IObjectSpace.GetObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。