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


C# SetType类代码示例

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


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


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