• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IObjectSpace类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: CreateDashBoard

        public static DevExpress.DashboardCommon.Dashboard CreateDashBoard(this IDashboardDefinition template, IObjectSpace objectSpace, bool filter)
        {
            var dashboard = new DevExpress.DashboardCommon.Dashboard();
            try {
                LoadFromXml(template.Xml, dashboard);

                foreach (ITypeWrapper typeWrapper in template.DashboardTypes) {
                    ITypeWrapper wrapper = typeWrapper;
                    if (dashboard.DataSources.Contains(ds => ds.Name.Equals(wrapper.Caption))) {
                        Type dashBoardObjectType = DashBoardObjectType(template, dashboard, typeWrapper);
                        if (dashBoardObjectType != null) {
                            ITypeWrapper wrapper1 = typeWrapper;
                            var dataSource = dashboard.DataSources.First(ds => ds.Name.Equals(wrapper1.Caption));
                            dataSource.Data = GetObjects(objectSpace, dashBoardObjectType);
                        }
                    }
                    else if (!dashboard.DataSources.Contains(ds => ds.Name.Equals(wrapper.Caption)))
                        dashboard.DataSources.Add(new DashboardObjectDataSource(typeWrapper.Caption, GetObjects(objectSpace, typeWrapper.Type)));
                }
                if (filter)
                    Filter(template, dashboard);
            }
            catch (Exception e) {
                dashboard.Dispose();
                Tracing.Tracer.LogError(e);
            }
            return dashboard;
        }
开发者ID:ZixiangBoy,项目名称:CIIP,代码行数:28,代码来源:TemplateHelper.cs


示例2: InitializeDefaultSolution

 public static void InitializeDefaultSolution(IObjectSpace os)
 {
     var enumerable = ReflectionHelper.FindTypeDescendants(ReflectionHelper.FindTypeInfoByName(typeof(I单据编号).FullName));
     var dictionary = os.GetObjects<单据编号方案>(null, true).ToDictionary(p => p.应用单据);
     foreach (ITypeInfo info2 in enumerable)
     {
         if (!info2.IsAbstract && info2.IsPersistent)
         {
             var key = info2.Type;
             单据编号方案 i单据编号方案 = null;
             if (dictionary.ContainsKey(key))
             {
                 i单据编号方案 = dictionary[key];
             }
             else
             {
                 i单据编号方案 = os.CreateObject<单据编号方案>();
                 i单据编号方案.名称 = key.FullName;
                 i单据编号方案.应用单据 = info2.Type;
                 var item = os.CreateObject<单据编号自动编号规则>();
                 item.格式化字符串 = "00000";
                 i单据编号方案.编号规则.Add(item);
                 dictionary.Add(key, i单据编号方案);
             }
         }
     }
     os.CommitChanges();
 }
开发者ID:ZixiangBoy,项目名称:CIIP,代码行数:28,代码来源:SequenceGeneratorInitializer.cs


示例3: Authenticate

 public override object Authenticate(IObjectSpace objectSpace)
 {
     string systemUserName = WindowsIdentity.GetCurrent().Name;
     string enteredUserName = ((AuthenticationStandardLogonParameters)LogonParameters).UserName;
     if (string.IsNullOrEmpty(enteredUserName))
     {
         throw new ArgumentException(SecurityExceptionLocalizer.GetExceptionMessage(SecurityExceptionId.UserNameIsEmpty));
     }
     if (!String.Equals(systemUserName, enteredUserName))
     {
         throw new AuthenticationException(enteredUserName, "Invalid user name");
     }
     object user = objectSpace.FindObject(UserType, new BinaryOperator("UserName", systemUserName));
     if (user == null)
     {
         user = objectSpace.CreateObject(UserType);
         ((IAuthenticationActiveDirectoryUser)user).UserName = systemUserName;
         bool strictSecurityStrategyBehavior = SecurityModule.StrictSecurityStrategyBehavior;
         SecurityModule.StrictSecurityStrategyBehavior = false;
         objectSpace.CommitChanges();
         SecurityModule.StrictSecurityStrategyBehavior = strictSecurityStrategyBehavior;
     }
     if (!((IAuthenticationStandardUser)user).ComparePassword(((AuthenticationStandardLogonParameters)LogonParameters).Password))
     {
         throw new AuthenticationException(systemUserName, SecurityExceptionLocalizer.GetExceptionMessage(SecurityExceptionId.RetypeTheInformation));
     }
     return user;
 }
开发者ID:shukla2009,项目名称:Personal,代码行数:28,代码来源:AuthenticateUser.cs


示例4: Authenticate

 public override object Authenticate(IObjectSpace objectSpace) {
     object user = objectSpace.FindObject(UserType, findUserCriteria);
     if (user == null) {
         throw new AuthenticationException(findUserCriteria.ToString());
     }
     return user;
 }
开发者ID:aries544,项目名称:eXpand,代码行数:7,代码来源:WorkflowServerAuthentication.cs


示例5: AuthenticateActiveDirectory

 private object AuthenticateActiveDirectory(IObjectSpace objectSpace) {
     var windowsIdentity = WindowsIdentity.GetCurrent();
     if (windowsIdentity != null) {
         string userName = windowsIdentity.Name;
         var user = (IAuthenticationActiveDirectoryUser)objectSpace.FindObject(UserType, new BinaryOperator("UserName", userName));
         if (user == null) {
             if (_createUserAutomatically) {
                 var args = new CustomCreateUserEventArgs(objectSpace, userName);
                 if (!args.Handled) {
                     user = (IAuthenticationActiveDirectoryUser)objectSpace.CreateObject(UserType);
                     user.UserName = userName;
                     if (Security != null) {
                         //Security.InitializeNewUser(objectSpace, user);
                         Security.CallMethod("InitializeNewUser", new object[]{objectSpace, user});
                     }
                 }
                 objectSpace.CommitChanges();
             }
         }
         if (user == null) {
             throw new AuthenticationException(userName);
         }
         return user;
     }
     return null;
 }
开发者ID:kamchung322,项目名称:eXpand,代码行数:26,代码来源:AuthenticationCombined.cs


示例6: CreateListView

 public ListView CreateListView(XafApplication application, IObjectSpace objectSpace, ISupportSequenceObject supportSequenceObject) {
     var nestedObjectSpace = (XPNestedObjectSpace)objectSpace.CreateNestedObjectSpace();
     var objectType = XafTypesInfo.Instance.FindBussinessObjectType<ISequenceReleasedObject>();
     var collectionSource = application.CreateCollectionSource(nestedObjectSpace, objectType, application.FindListViewId(objectType));
     collectionSource.Criteria["ShowReleasedSequences"] = CriteriaOperator.Parse("TypeName=?", supportSequenceObject.Prefix + supportSequenceObject.ClassInfo.FullName);
     return application.CreateListView(nestedObjectSpace, objectType, true);
 }
开发者ID:aries544,项目名称:eXpand,代码行数:7,代码来源:ReleaseSequencePopupWindowHelper.cs


示例7: CreateArtifact

 private static ModuleArtifact CreateArtifact(ModuleChild moduleChild, ModuleArtifactType moduleArtifactType,IObjectSpace objectSpace, Type type){
     var moduleArtifact = objectSpace.CreateObject<ModuleArtifact>();
     moduleArtifact.Name = type.Name;
     moduleArtifact.Type = moduleArtifactType;
     moduleArtifact.ModuleChilds.Add(moduleChild);
     return moduleArtifact;
 }
开发者ID:aries544,项目名称:eXpand,代码行数:7,代码来源:ParsingExtensions.cs


示例8: Setup

 public void Setup(IObjectSpace objectSpace, XafApplication application) {
     if (helper == null) {
         helper = new ObjectEditorHelper(MemberInfo.MemberTypeInfo, Model);
     }
     _application = application;
     _objectSpace = objectSpace;
 }
开发者ID:kevin3274,项目名称:eXpand,代码行数:7,代码来源:ReleasedSequencePropertyEditor.cs


示例9: CreateDashBoard

 public static DevExpress.DashboardCommon.Dashboard CreateDashBoard(this IDashboardDefinition template, IObjectSpace objectSpace, FilterEnabled filterEnabled) {
     var dashboard = new DevExpress.DashboardCommon.Dashboard();
     try {
         if (!string.IsNullOrEmpty(template.Xml)) {
             dashboard = LoadFromXml(template);
             dashboard.ApplyModel(filterEnabled, template, objectSpace);
         }
         foreach (var typeWrapper in template.DashboardTypes.Select(wrapper => new { wrapper.Type, Caption = GetCaption(wrapper) })) {
             var wrapper = typeWrapper;
             var dsource = dashboard.DataSources.FirstOrDefault(source => source.Name.Equals(wrapper.Caption));
             var objects = objectSpace.CreateDashboardDataSource(wrapper.Type);
             if (dsource != null) {
                 dsource.Data = objects;
             }
             else if (!dashboard.DataSources.Contains(ds => ds.Name.Equals(wrapper.Caption))) {
                 dashboard.AddDataSource(typeWrapper.Caption, objects);
             }
         }
     }
     catch (Exception e) {
         dashboard.Dispose();
         Tracing.Tracer.LogError(e);
     }
     return dashboard;
 }
开发者ID:kamchung322,项目名称:eXpand,代码行数:25,代码来源:Extensions.cs


示例10: CreateWizardView

 public static void CreateWizardView(this ActionBaseEventArgs e, IObjectSpace objectSpace, object newObject, View sourceView){
     e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
     e.ShowViewParameters.Context = "WizardDetailViewForm";
     if (e.ShowViewParameters.CreatedView == null){
         e.ShowViewParameters.CreatedView = e.Action.Application.CreateDetailView(objectSpace, newObject, sourceView);
     }
 }
开发者ID:aries544,项目名称:eXpand,代码行数:7,代码来源:Extensions.cs


示例11: StateMachineCollectionSource

 public StateMachineCollectionSource(IObjectSpace objectSpace, IStateMachineRepository repository, Type type)
     : base(objectSpace) {
     _objectSpace = objectSpace;
     _repository = repository;
     _type = type;
     objectTypeInfoCore = XafTypesInfo.Instance.FindTypeInfo(typeof(IStateMachine));
 }
开发者ID:pitchalt,项目名称:IntecoAG.XAFExt,代码行数:7,代码来源:StateMachineCollectionSource.cs


示例12: FilterWindowView

 public FilterWindowView(IObjectSpace objectSpace, IModelView model, bool isRoot, List<FilterColumn> list)
     : base(isRoot)
 {
     this.objectSpace = objectSpace;
     base.model = model;
     control = new FilterWindowControl(list);
 }
开发者ID:LSTANCZYK,项目名称:devexpress_xaf_aurum,代码行数:7,代码来源:FilterWindowView.cs


示例13: CriteriaOperator_UserValueToString

        private static void CriteriaOperator_UserValueToString(Object sender, UserValueProcessingEventArgs e)
        {
            if (!e.Handled && (e.Value != null))
            {
                ITypeInfo typeInfo = typesInfo.FindTypeInfo(e.Value.GetType());
                if ((typeInfo != null) && typeInfo.IsPersistent)
                {

                    IObjectSpace objectSpace = null;
                    if (e.Value is IObjectSpaceLink)
                    {
                        objectSpace = ((IObjectSpaceLink)e.Value).ObjectSpace;
                    }
                    if (objectSpace == null)
                    {
                        objectSpace = ParseCriteriaScope.currentObjectSpace;
                    }
                    if (objectSpace != null)
                    {
                        e.Data = objectSpace.GetObjectHandle(e.Value);
                        e.Tag = objectTag;
                        e.Handled = true;
                    }
                    else
                    {
                        e.Data = ObjectHandleHelper.CreateObjectHandle(typesInfo, typeInfo.Type, NHObjectSpace.GetKeyValueAsString(typesInfo, e.Value));
                        e.Tag = objectTag;
                        e.Handled = true;
                    }
                }
            }
        }
开发者ID:derjabkin,项目名称:eXpand,代码行数:32,代码来源:ParseCriteriaScope.cs


示例14: XPObjectSpaceAwareControlInitializer

 public XPObjectSpaceAwareControlInitializer(IXPObjectSpaceAwareControl control, IObjectSpace objectSpace)
 {
     Guard.ArgumentNotNull(control, "control");
     Guard.ArgumentNotNull(objectSpace, "objectSpace");
     control.UpdateDataSource(objectSpace);
     objectSpace.Reloaded += (sender, args) => control.UpdateDataSource(objectSpace);
 }
开发者ID:ZixiangBoy,项目名称:CIIP,代码行数:7,代码来源:XPObjectSpaceAwareControlInitializer.cs


示例15: Download

        /// <summary>
        /// Downloads XafDelta messages into replication storage database.
        /// </summary>
        /// <param name="xafDeltaModule">The xaf delta module.</param>
        /// <param name="objectSpace">The object space.</param>
        /// <param name="worker">The worker.</param>
        public void Download(XafDeltaModule xafDeltaModule, IObjectSpace objectSpace, ActionWorker worker)
        {
            worker.ReportProgress(Localizer.DownloadStarted);

            var transportList = (from m in xafDeltaModule.ModuleManager.Modules
                                where m is IXafDeltaTransport && ((IXafDeltaTransport) m).UseForDownload
                                select m).Cast<IXafDeltaTransport>().ToList();

            worker.ReportProgress(string.Format(Localizer.TransportFound, transportList.Count()));
            foreach (var transport in transportList.TakeWhile(x => !worker.CancellationPending))
            {
                worker.ReportProgress(string.Format(Localizer.DownloadUsing, transport));
                try
                {
                    worker.ReportProgress(string.Format(Localizer.OpenTransport, transport));
                    transport.Open(TransportMode.Download, worker);

                    var existingReplicaNames = from c in objectSpace.GetObjects<Package>() select c.FileName;

                    var fileNames = transport.GetFileNames(worker,
                        @"(" + Ticket.FileMask + "|" + Package.FileMask + ")").ToList();

                    fileNames = fileNames.Except(existingReplicaNames).ToList();

                    worker.ReportProgress(string.Format(Localizer.FilesForDownload, fileNames.Count));
                    foreach (var fileName in fileNames.TakeWhile(x => !worker.CancellationPending))
                    {
                        // worker.ReportProgress(string.Format(Localizer.DownloadFile, fileName));
                        var fileData = transport.DownloadFile(fileName, worker);
                        if(fileData != null && fileData.Length > 0)
                        {
                            if (fileName.EndsWith(Package.PackageFileExtension))
                            {
                                var replica = Package.ImportFromBytes(objectSpace, fileName, fileData);
                                replica.Save();
                            }
                            else
                            {
                                var replicaTicket = Ticket.ImportTicket(objectSpace, fileData);
                                replicaTicket.Save();
                            }
                            if (!fileName.Contains(ReplicationNode.AllNodes))
                                transport.DeleteFile(fileName, worker);
                            objectSpace.CommitChanges();
                        }
                    }
                }
                catch (Exception exception)
                {
                    objectSpace.Rollback();
                    worker.ReportError(Localizer.DownloadError, exception.Message);
                }
                finally
                {
                    worker.ReportProgress(Localizer.CloseTransport, transport);
                    transport.Close();
                }
            }
            worker.ReportProgress(Color.Blue, Localizer.DownloadFinished);
        }
开发者ID:xafdelta,项目名称:xafdelta,代码行数:66,代码来源:DeliveryService.cs


示例16: CreateOutputPackage

        /// <summary>
        /// Creates the output package.
        /// </summary>
        /// <param name="objectSpace">The object space.</param>
        /// <param name="recipient">The recipient.</param>
        /// <param name="packageType">Type of the package.</param>
        /// <returns>Output package</returns>
        public Package CreateOutputPackage(IObjectSpace objectSpace, ReplicationNode recipient, PackageType packageType)
        {
            var result = objectSpace.CreateObject<Package>();

            result.ApplicationName = XafDeltaModule.XafApp.ApplicationName;
            result.SenderNodeId = Owner.CurrentNodeId;
            result.RecipientNodeId = recipient.NodeId;
            result.PackageType = packageType;

            // for broadcast package recipient node Id is "AllNodes"
            if (result.SenderNodeId == result.RecipientNodeId)
                result.RecipientNodeId = ReplicationNode.AllNodes;

            // assign package id
            if (packageType == PackageType.Snapshot)
            {
                recipient.SnapshotDateTime = DateTime.UtcNow;
                recipient.LastSavedSnapshotNumber++;
                result.PackageId = recipient.LastSavedSnapshotNumber;
            }
            else
            {
                recipient.LastSavedPackageNumber++;
                result.PackageId = recipient.LastSavedPackageNumber;
            }

            return result;
        }
开发者ID:xafdelta,项目名称:xafdelta,代码行数:35,代码来源:MessagingService.cs


示例17: SynchronizeModel

 public static void SynchronizeModel(this DevExpress.DashboardCommon.Dashboard dashboard, IObjectSpace objectSpace, IDashboardDefinition template) {
     var dataSources = GetDataSources(dashboard, FilterEnabled.Always, template, objectSpace);
     foreach (var dataSource in dataSources){
         var filter = dataSource.ModelDataSource as IModelDashboardDataSourceFilter;
         if (filter != null)
             dataSource.DataSource.Filter = filter.SynchronizeFilter(dataSource.DataSource.Filter);
     }
 }
开发者ID:kamchung322,项目名称:eXpand,代码行数:8,代码来源:Extensions.cs


示例18: ShowWizard

        public override void ShowWizard(IObjectSpace objectSpace) {
            var wiz = new ExcelImportWizard(
                            (ObjectSpace)objectSpace,
                            View.ObjectTypeInfo,
                            this.GetCurrentCollectionSource());

            wiz.ShowDialog();
        }
开发者ID:pitchalt,项目名称:IntecoAG.XAFExt,代码行数:8,代码来源:ImportWizViewController.cs


示例19: GetObjectKey

 object GetObjectKey(ViewShortcut shortcut, Type type, IObjectSpace objectSpace) {
     var objectKey = GetObjectKey(objectSpace, type, shortcut);
     if (objectKey != null)
         return objectKey;
     return shortcut.ObjectKey.StartsWith("@")
                     ? ParametersFactory.CreateParameter(shortcut.ObjectKey.Substring(1)).CurrentValue
                     : CriteriaWrapper.ParseCriteriaWithReadOnlyParameters(shortcut.ObjectKey, type);
 }
开发者ID:kevin3274,项目名称:eXpand,代码行数:8,代码来源:ViewShortCutProccesor.cs


示例20: LoadPackageContext

 /// <summary>
 /// Initializes a new instance of the <see cref="LoadPackageContext"/> class.
 /// </summary>
 /// <param name="package">The package.</param>
 /// <param name="worker">The worker.</param>
 /// <param name="objectSpace">The object space.</param>
 /// <param name="currentNodeId">The current node id.</param>
 public LoadPackageContext(Package package, ActionWorker worker, 
     IObjectSpace objectSpace, string currentNodeId)
 {
     CurrentNodeId = currentNodeId;
     Package = package;
     Worker = worker;
     ObjectSpace = objectSpace;
 }
开发者ID:xafdelta,项目名称:xafdelta,代码行数:15,代码来源:LoadPackageContext.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IObjectValueSource类代码示例发布时间:2022-05-24
下一篇:
C# IObjectSource类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap