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

C# SetType类代码示例

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

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



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

示例1: IsFlagsSet

 public static bool IsFlagsSet(ObjectAccessId accessObject, RightsFlags[] flags,SetType setType=SetType.Any)
 {
     if (LoggedUser == null)
         throw new Exception("Invalid user!");
     if (LoggedUser.IsAdmin)
         return true;
     switch (setType)
     {
         case SetType.All:
             if (flags.Select(flag => IsFlagSet(accessObject, flag)).All(result => result))
             {
                 return true;
             }
             break;
         case SetType.Any:
             if (flags.Select(flag => IsFlagSet(accessObject, flag)).Any(result => result))
             {
                 return true;
             }
             break;
         default:
             throw new ArgumentOutOfRangeException("setType");
     }
     return false;
 }
开发者ID:Winsor,项目名称:ITInfra,代码行数:25,代码来源:SharedData.cs


示例2: CreateTrainingAndTestSets

        /* LOGIC
         * 1. Randomly select one node in the graph.
         * 2. Randonly select the second node from the first node's connections.
         * 3. Compute all the features for this pair of connected nodes.
         * 4. Randomly select one node from the nodes that are not connected to
         *    the first node.
         * 5. Compute all the features for the selected pair of disconnected nodes.
         * 6. Repeat 5000 times.
         * Note: when selecting a pair, make sure that it is not already in the training set.
         */
        public static void CreateTrainingAndTestSets(string pathDataDir, SetType trainingSetType, SetType testingSetType,
                                                     int trainingSetSize, int testingSetSize, int testingDataAmount)
        {
            Console.WriteLine("Starting creation of training and testing subsets . . .");
            FeaturesExtractor featuresExtractor = new FeaturesExtractor(pathDataDir);
            featuresExtractor.LoadCharacterCharactersData();
            featuresExtractor.LoadCharacterComicsData();
            featuresExtractor.LoadCharacterSeriesData();
            HashSet<string> usedExamples = new HashSet<string>();
            HashSet<string> usedNodes = new HashSet<string>();

            // Training data
            Console.WriteLine("Creating training subset . . .");
            Console.WriteLine(String.Format("Training set type: {0}", trainingSetType));
            switch (trainingSetType)
            {
                case SetType.Balanced:
                    CreateAndSaveRandomBalancedSubset(FileManager.GetPathResultTrainingSet(pathDataDir, trainingSetType),
                                                      featuresExtractor, usedExamples, usedNodes, trainingSetSize);
                    break;
                case SetType.Proportional:
                    CreateAndSaveRandomProportionalSubset(FileManager.GetPathResultTrainingSet(pathDataDir, trainingSetType),
                                                          featuresExtractor, usedExamples, usedNodes, trainingSetSize);
                    break;
            }

            // Testing data
            Console.WriteLine("Creating testing subset . . .");
            Console.WriteLine(String.Format("Testing set type: {0}", testingSetType));
            switch (testingSetType)
            {
                case SetType.Balanced:
                    CreateAndSaveRandomBalancedSubset(FileManager.GetPathResultTestSet(pathDataDir, testingSetType),
                                                      featuresExtractor, usedExamples, usedNodes, testingSetSize);
                    break;
                case SetType.Proportional:
                    CreateAndSaveRandomProportionalSubset(FileManager.GetPathResultTestSet(pathDataDir, testingSetType),
                                                          featuresExtractor, usedExamples, usedNodes, testingSetSize);
                    break;
                case SetType.Nodes:
                    CreateAndSaveRandomNodesSubset(FileManager.GetPathResultTestSet(pathDataDir, testingSetType),
                                                   featuresExtractor, usedNodes, testingSetSize, testingDataAmount);
                    break;

            }

            Console.WriteLine("Finished creation of training and testing subsets.");
        }
开发者ID:NikolaiSamteladze,项目名称:Marvel_Research_Tool,代码行数:58,代码来源:DataSampler.cs


示例3: I

        public void I(IEnumerable<int> series, SetType type)
        {
            StringBuilder sb = new StringBuilder();

            foreach(int ion in series)
            {
                if(type == SetType.ArgLine)
                {
                    UserAction = true;

                    UserAction = false;
                }
                sb.Append(ion);
                sb.Append(',');
            }
            if(sb.Length > 1)
            {
                sb.Remove(sb.Length - 1, 1);
            }
            ArgumentLine.IonSeries = sb.ToString();
        }
开发者ID:dbaileychess,项目名称:Compass,代码行数:21,代码来源:MainForm.cs


示例4: ConvertSetTypeToString

 public virtual string ConvertSetTypeToString(SetType set_type)
 {
     if(set_type == SetType.UPDATE_ONLY)
         return "updateonly";
     else if(set_type == SetType.INSERT_ONLY)
         return "insertonly";
     else
         return "full";
 }
开发者ID:drawcode,项目名称:bom,代码行数:9,代码来源:BasePlatformAPI.cs


示例5: SetVideoByUrl

 public virtual bool SetVideoByUrl(SetType set_type, Video obj)
 {
     return act.SetVideoByUrl(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例6: SetSiteByCode

 public virtual bool SetSiteByCode(SetType set_type, Site obj)
 {
     return act.SetSiteByCode(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例7: SetQuestionByUuid

 public virtual bool SetQuestionByUuid(SetType set_type, Question obj)
 {
     return act.SetQuestionByUuid(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例8: SetProfileQuestionByQuestionIdByProfileId

 public virtual bool SetProfileQuestionByQuestionIdByProfileId(SetType set_type, ProfileQuestion obj)
 {
     return act.SetProfileQuestionByQuestionIdByProfileId(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例9: SetEventCategoryAssocByUuid

 public virtual bool SetEventCategoryAssocByUuid(SetType set_type, EventCategoryAssoc obj)
 {
     return act.SetEventCategoryAssocByUuid(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例10: SetContentItemTypeByUuid

 public virtual bool SetContentItemTypeByUuid(SetType set_type, ContentItemType obj)
 {
     return act.SetContentItemTypeByUuid(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例11: SetChannelByUuid

 public virtual bool SetChannelByUuid(SetType set_type, Channel obj)
 {
     return act.SetChannelByUuid(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例12: SetAppByUuid

 public virtual bool SetAppByUuid(SetType set_type, App obj)
 {
     return act.SetAppByUuid(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例13: AuthorizationSetDefinition

 internal AuthorizationSetDefinition(SetType setType)
 {
     _setType = setType;
 }
开发者ID:marteaga,项目名称:healthvault-azurestorage,代码行数:4,代码来源:AuthorizationSetDefinition.cs


示例14: SetRewardConditionTypeByUuid

 public virtual bool SetRewardConditionTypeByUuid(SetType set_type, RewardConditionType obj)
 {
     return act.SetRewardConditionTypeByUuid(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BaseGamingAPI.cs


示例15: SetProfileRewardPointsByUuid

 public virtual bool SetProfileRewardPointsByUuid(SetType set_type, ProfileRewardPoints obj)
 {
     return act.SetProfileRewardPointsByUuid(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BaseGamingAPI.cs


示例16: SetProfileChannelByChannelIdByProfileId

 public virtual bool SetProfileChannelByChannelIdByProfileId(SetType set_type, ProfileChannel obj)
 {
     return act.SetProfileChannelByChannelIdByProfileId(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例17: SetProfileOrgByUuid

 public virtual bool SetProfileOrgByUuid(SetType set_type, ProfileOrg obj)
 {
     return act.SetProfileOrgByUuid(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例18: SetEventInfoByUuid

 public virtual bool SetEventInfoByUuid(SetType set_type, EventInfo obj)
 {
     return act.SetEventInfoByUuid(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例19: SetQuestionByChannelIdByCode

 public virtual bool SetQuestionByChannelIdByCode(SetType set_type, Question obj)
 {
     return act.SetQuestionByChannelIdByCode(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs


示例20: SetMessageByUuid

 public virtual bool SetMessageByUuid(SetType set_type, Message obj)
 {
     return act.SetMessageByUuid(ConvertSetTypeToString(set_type), obj);
 }
开发者ID:drawcode,项目名称:bom,代码行数:4,代码来源:BasePlatformAPI.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# SetWindowPosFlags类代码示例发布时间:2022-05-24
下一篇:
C# SetTextCallback类代码示例发布时间: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