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


C# Categories.ToString方法代码示例

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


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

示例1: Track

        public void Track(Categories category, string action, string label = null, int value = 0)
        {
            if (!_disabled)
                _tracker.TrackEventAsync(category.ToString(), action, label, value);

                System.Diagnostics.Debug.WriteLine("Analytics: {0}/{1}/{2}/{3}", category.ToString(), action, label, value);
        }
开发者ID:amoikevin,项目名称:Windows-Phone-Power-Tools,代码行数:7,代码来源:Analytics.cs

示例2: TrackAsync

        public async Task TrackAsync(Categories category, string action, string label = null, int value = 0) 
        {
            System.Diagnostics.Debug.WriteLine("Analytics: Async: {0}/{1}/{2}/{3}", category.ToString(), action, label, value);
            
            if (!_disabled)
                await _tracker.TrackEventAsync(category.ToString(), action, label, value);

        }
开发者ID:amoikevin,项目名称:Windows-Phone-Power-Tools,代码行数:8,代码来源:Analytics.cs

示例3: addChildToCategory

 /// <summary>
 /// This method adds a child to a specific category.
 /// </summary>
 /// <param name="category">MUSIC or IMAGES or VIDEOS or EBOOKS or OTHERS</param>
 /// <param name="childValue">string-value</param>
 public void addChildToCategory(Categories category,String childValue)
 {
     XmlNode node = root.SelectSingleNode(category.ToString());
     int childAmount = node.ChildNodes.Count;
     XmlNode nChild = this.xmldoc.CreateElement("value"+childAmount);
     nChild.InnerText = childValue;
     //nChild.
     node.AppendChild(nChild);
 }
开发者ID:apolol92,项目名称:SmartTransfer,代码行数:14,代码来源:XmlManager.cs

示例4: GetWord

        protected string GetWord(Categories category)
        {
            var allWords = this.FakeWordCollection
                                            .Where(x => x.Contains(category.ToString())).ToArray();

            if (allWords.Length <= 0)
            {
                throw new ArgumentException("No word found.");
            }

            var randomIndex = this.random.Next(0, allWords.Count());
            var separator = allWords[randomIndex].IndexOf(" ", StringComparison.Ordinal) + 1;
            var word = allWords[randomIndex].Substring(separator);

            return word.Trim();
        }
开发者ID:HQC-Team-Hangman-4,项目名称:Hangman-4,代码行数:16,代码来源:WordDataBaseMock.cs

示例5: GetRandomWordByCategory

        /// <summary>
        /// Gets a random word by a category.
        /// </summary>
        /// <param name="category">Category of words.</param>
        /// <returns>String representation of word.</returns>
        public string GetRandomWordByCategory(Categories category)
        {
            var allWords = this.DataSerialization.ReadFromFile(FileNames.words)
                                            .Where(x => x.Contains(category.ToString())).ToArray();

            if (allWords.Length <= 0)
            {
                throw new ArgumentException("No word found.");
            }

            var randomIndex = this.random.Next(0, allWords.Count());
            var separator = allWords[randomIndex].IndexOf(" ", StringComparison.Ordinal) + 1;
            var word = allWords[randomIndex].Substring(separator);

            return word.Trim();
        }
开发者ID:HQC-Team-Hangman-4,项目名称:Hangman-4,代码行数:21,代码来源:WordDatabase.cs

示例6: CreateTimedEvent

        public IDisposable CreateTimedEvent(Categories category, string variable, string description, int? value)
        {
            if (!ReportingAnalytics) return Disposable;

            var e = new TimedEvent()
            {
                Category = category.ToString(),
                VariableName = variable,
                Description = description,
                Value = value
            };
            //Timed event does not need startup tracking.
            return e;
        }
开发者ID:sm6srw,项目名称:Dynamo,代码行数:14,代码来源:DynamoAnalyticsClient.cs

示例7: TrackTimedEvent

        public void TrackTimedEvent(Categories category, string variable, TimeSpan time, string description = "")
        {
            if (!ReportingAnalytics) return;

            var e = new TimedEvent(time)
            {
                Category = category.ToString(),
                VariableName = variable,
                Description = description
            };
            e.Track();
        }
开发者ID:sm6srw,项目名称:Dynamo,代码行数:12,代码来源:DynamoAnalyticsClient.cs

示例8: TrackEvent

        public void TrackEvent(Actions action, Categories category, string description, int? value)
        {
            if (!ReportingAnalytics) return;

            var e = AnalyticsEvent.Create(category.ToString(), action.ToString(), description, value);
            e.Track();
        }
开发者ID:sm6srw,项目名称:Dynamo,代码行数:7,代码来源:DynamoAnalyticsClient.cs

示例9: getAllChildsFrom

 /// <summary>
 /// Get all childs of a category
 /// </summary>
 /// <param name="category">From which category?</param>
 /// <returns>A string-list of childs</returns>
 public List<String> getAllChildsFrom(Categories category)
 {
     List<String> allChilds = new List<string>();
     XmlNode node = root.SelectSingleNode(category.ToString());
     foreach (XmlNode n in node.ChildNodes)
     {
         allChilds.Add(n.InnerText);
     }
     return allChilds;
 }
开发者ID:apolol92,项目名称:SmartTransfer,代码行数:15,代码来源:XmlManager.cs

示例10: deleteChildFromCategory

 /// <summary>
 /// Deletes a child from a category..
 /// </summary>
 /// <param name="category">From which category?</param>
 /// <param name="childValue">Which child?</param>
 public void deleteChildFromCategory(Categories category, String childValue)
 {
     XmlNode node = root.SelectSingleNode(category.ToString());
     for (int i = 0; i < node.ChildNodes.Count; i++)
     {
         if (node.ChildNodes[i].InnerText == childValue)
         {
             node.RemoveChild(node.ChildNodes[i]);
             break;
         }
     }
 }
开发者ID:apolol92,项目名称:SmartTransfer,代码行数:17,代码来源:XmlManager.cs

示例11: GetCategoryName

 private static string GetCategoryName(Categories cat)
 {
     // Get the type
     Type type = cat.GetType();
     // Get fieldinfo for this type
     System.Reflection.FieldInfo fieldInfo = type.GetField(cat.ToString());
     // Get the stringvalue attributes
     CategoryNameAttribute[] attribs = fieldInfo.GetCustomAttributes(typeof(CategoryNameAttribute), false) as CategoryNameAttribute[];
     // Return the first if there was a match.
     return attribs.Length > 0 ? attribs[0].Name : null;
 }
开发者ID:Yvand,项目名称:AzureCP,代码行数:11,代码来源:AzureCPLogging.cs

示例12: GetCategoryDefaultTraceSeverity

 private static TraceSeverity GetCategoryDefaultTraceSeverity(Categories cat)
 {
     // Get the type
     Type type = cat.GetType();
     // Get fieldinfo for this type
     System.Reflection.FieldInfo fieldInfo = type.GetField(cat.ToString());
     // Get the stringvalue attributes
     DefaultTraceSeverityAttribute[] attribs = fieldInfo.GetCustomAttributes(typeof(DefaultTraceSeverityAttribute), false) as DefaultTraceSeverityAttribute[];
     // Return the first if there was a match.
     return attribs.Length > 0 ? attribs[0].Severity : TraceSeverity.Unexpected;
 }
开发者ID:Yvand,项目名称:AzureCP,代码行数:11,代码来源:AzureCPLogging.cs

示例13:

 public SPDiagnosticsCategory this[Categories id]
 {
     get { return Areas[DiagnosticsAreaName].Categories[id.ToString()]; }
 }
开发者ID:Yvand,项目名称:AzureCP,代码行数:4,代码来源:AzureCPLogging.cs


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