Beispiel #1
0
        public List <SectionEnum> SectionDispo(SectionEnum section)
        {
            List <SectionEnum> list = new List <SectionEnum>();

            switch (section)
            {
            case SectionEnum.TODO:
                list = new List <SectionEnum> {
                    SectionEnum.DOING, SectionEnum.TODO
                };
                break;

            case SectionEnum.DOING:
                list = new List <SectionEnum> {
                    SectionEnum.DONE, SectionEnum.DOING
                };
                break;

            case SectionEnum.DONE:
                break;

            default:
                list = new List <SectionEnum> {
                    SectionEnum.DONE, SectionEnum.DOING
                };
                break;
            }
            return(list);
        }
        // The icon for the particular section in the editor.
        // Defaults to null.
        public static Texture GetIconForSection(SectionEnum section)
        {
            string  iconName = IconNameForSection(section);
            Texture texture  = GetIconForName(iconName);

            return(texture);
        }
Beispiel #3
0
        private SectionEnum ParseEnum()
        {
            SectionEnum ast       = new SectionEnum();
            Token       headToken = tape.Current;

            ast.KeyToken  = new Token("声明", TokenKind.Ident, headToken.Line, headToken.Col);
            ast.NameToken = new Token(headToken.GetText().Substring(2), TokenKind.Ident, headToken.Line, headToken.Col + 2);
            tape.MoveNext();
            tape.Match(TokenKind.Colon);
            //TokenTape tape = new TokenTape(sectionRaw.Content);
            while (tape.CurrentKind != TokenKind.EOF)
            {
                if (tape.CurrentKind == TokenKind.Ident)
                {
                    ast.AddValueToken(tape.Current);
                    tape.MoveNext();
                }
                else if (tape.CurrentKind == TokenKind.Comma)
                {
                    tape.MoveNext();
                }
                else
                {
                    tape.error(string.Format("定义的约定'{0}'不是正确的名称", tape.Current.GetText()));
                    tape.MoveNext();
                }
            }
            return(ast);
        }
Beispiel #4
0
    public static GameObject LoadSection(SectionEnum sectioEnum, ref float distanse)
    {
        //now section size is const.
        //we need build correct section prefab
        const float SIZE = 10;
        GameObject  go   = Instantiate(Resources.Load(EnumContoller.GetPath(sectioEnum)) as GameObject,
                                       new Vector3(distanse, 0, 0), Quaternion.identity);

        distanse += SIZE;
        return(go);
    }
Beispiel #5
0
        private SectionEnumBusiness VerifySection(SectionEnumBusiness section, SectionEnum dbTask)
        {
            if (dbTask == SectionEnum.TODO && section == SectionEnumBusiness.DOING)
            {
                return(section);
            }
            if (dbTask == SectionEnum.DOING && section == SectionEnumBusiness.DONE)
            {
                return(section);
            }

            return((SectionEnumBusiness)dbTask);
        }
Beispiel #6
0
        private SectionBase ParseSection()
        {
            string headText = tape.Current.GetText();

            if (headText.StartsWith("导入"))
            {
                SectionImport section = ParseImport();
                return(section);
            }
            else if (headText.StartsWith("使用"))
            {
                SectionUse section = ParseUse();
                return(section);
            }
            else if (headText.StartsWith("约定"))
            {
                SectionEnum section = ParseEnum();
                return(section);
            }
            else if (headText.StartsWith("声明"))
            {
                SectionDim section = ParseDim();
                return(section);
            }
            else if (headText.EndsWith("类型"))
            {
                SectionClassName section = ParseClass();
                return(section);
            }
            else if (headText.EndsWith("属性"))
            {
                SectionProperties section = ParseProperties();
                return(section);
            }
            else
            {
                SectionProc section = ParseProc();
                if (section.NamePart.IsConstructor())
                {
                    SectionConstructor constructor = new SectionConstructor(section);
                    return(constructor);
                }
                else
                {
                    return(section);
                }
                //tape.error("错误的段落");
                //tape.MoveNext();
                //return null;
            }
        }
Beispiel #7
0
        public static ISection CreateSection <T>(T buildSection, BuildPass <T> pass)
            where T : struct, IConvertible
        {
            ISection returnValue       = null;
            var      buildSectionValue = (eBuildSectionEnumeration)(object)buildSection;

            switch (buildSectionValue)
            {
            case eBuildSectionEnumeration.UsingStatements:
            {
                returnValue = new SectionEmpty <T>(pass);
                break;
            }

            case eBuildSectionEnumeration.Namespace:
            {
                returnValue = new SectionNamespace <T>(pass);
                break;
            }

            case eBuildSectionEnumeration.Enum:
            {
                returnValue = new SectionEnum <T>(pass);
                break;
            }

            case eBuildSectionEnumeration.Members:
            {
                returnValue = new SectionMembers <T>(pass);
                break;
            }

            case eBuildSectionEnumeration.EnumClose:
            {
                returnValue = new SectionEnumClose <T>(pass);
                break;
            }

            case eBuildSectionEnumeration.NamespaceClose:
            {
                returnValue = new SectionNamespaceClose <T>(pass);
                break;
            }
            }

            return(returnValue);
        }
Beispiel #8
0
        public async Task <List <OptionmetaResult> > GetOptionValuesBySectionAsync(SectionEnum section, SiteTypeEnum siteType)
        {
            var option = await _context.Options.SingleOrDefaultAsync(x => x.Section == section && x.Site.SiteType == siteType);

            var optionmetaResult = new List <OptionmetaResult>();

            foreach (var optionmeta in option.Optionmetas)
            {
                optionmetaResult.Add(new OptionmetaResult {
                    PublicKeyName    = optionmeta.PublicKeyName,
                    Key              = optionmeta.Key,
                    KeyDescription   = optionmeta.KeyDescription,
                    Value            = optionmeta.Value,
                    ValueDescription = optionmeta.ValueDescription,
                    AdditionalInfo   = optionmeta.AdditionalInfo
                });
            }

            return(optionmetaResult);
        }
        private static string IconNameForSection(SectionEnum section)
        {
            string iconName;

            if (!s_ImageNameCache.TryGetValue(section, out iconName))
            {
                switch (section)
                {
                case SectionEnum.Inspector:
                case SectionEnum.Scene:
                    iconName = "SoftlockInline.png";
                    break;

                case SectionEnum.ProjectBrowser:
                    iconName = String.Format("SoftlockProjectBrowser{0}", kIconMipSuffix);
                    break;

                default:
                    return(null);
                }
                s_ImageNameCache.Add(section, iconName);
            }
            return(iconName);
        }
Beispiel #10
0
 public ISectionItem Section(SectionEnum section)
 {
     return(Find(item => string.Equals(item.Title, section.ToString(), StringComparison.InvariantCultureIgnoreCase)));
 }
Beispiel #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConfigGetoemconfigbysectionReq" /> class.
 /// </summary>
 /// <param name="section">语言标签 (required).</param>
 public ConfigGetoemconfigbysectionReq(SectionEnum section = default(SectionEnum))
 {
     this.Section = section;
 }
Beispiel #12
0
 private void SetSection(SectionEnum section)
 {
     sections.Enqueue(ViewController.LoadSection(section, ref distanse));
 }