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


C# ContextType.ToString方法代码示例

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


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

示例1: Create

 public Context Create(ContextType type)
 {
     switch (type)
     {
         case ContextType.Empty:
             return EmptyContext();
         case ContextType.Stub:
             return StubContext();
         case ContextType.PublishAndConsume:
             return PublishConsumeContext();
         default:
             throw new NotImplementedException(type.ToString());
     }
 }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:14,代码来源:ContextFactory.cs

示例2: Save

        public bool Save(string DestinationThemeDir,bool OverwriteFile, bool CreateSymlinks)
        {
            char Sep = Path.DirectorySeparatorChar;
            string newpath = DestinationThemeDir + Sep + GetSizeDir() + Sep + contextToStr(Context) + Sep ;
            string newfilename = newpath + FdoName + Path.GetExtension(Filename);
            try{
                if (Context == ContextType.cNone){
                    Context = guessContextFromStr(Path.GetFullPath(Filename));
                    Console.WriteLine("Guessing the icon "+Filename+", belongs probably to "+ Context.ToString());
                }
                if (!Directory.Exists(newpath))
                    Directory.CreateDirectory(Path.GetFullPath(newpath));
                //Console.WriteLine("Old: "+Filename+",New: "+ newfilename);
                if (Filename == "")
                    Pixbuf.Save(newfilename,CUtility.ImageTypeToStr(Type));
                else
                    File.Copy(Filename, newfilename,OverwriteFile);  //File.Move

                //Has to be included in the icon-class if this unit will be the base of a icon-generator-app
                //For now, it's ok to copy it while saving
                string IconFile = Path.ChangeExtension(Filename,"icon");
                if (File.Exists(IconFile))
                    File.Copy(IconFile, Path.ChangeExtension(newfilename,"icon"),OverwriteFile);  //File.Move

                //for max compatibility
                if (CreateSymlinks){
                    foreach (string link in LinkedNames)
                        CUtility.Execute("ln","-s "+newfilename+" "+newpath + link + Path.GetExtension(Filename));
                }
            } catch (Exception e) {
                Console.WriteLine("Warning: "+e.Message);
            }
            return true;
        }
开发者ID:BackupTheBerlios,项目名称:gnomeartng-svn,代码行数:34,代码来源:CIconThemeManager.cs

示例3: switchOn

        /// <summary>
        /// Switcher of used context.
        /// </summary>
        /// <param name="context">New context for using.</param>
        /// <returns>Self reference.</returns>
        public IManager switchOn(ContextType context)
        {
            if(this.Context != context) {
                Log.Trace("Config-Manager: switched context '{0}'", context.ToString());
            }
            this.Context = context;

            configure(UserConfig.Data);
            return this;
        }
开发者ID:3F,项目名称:vsCommandEvent,代码行数:15,代码来源:Manager.cs


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