public static void WriteFrameworkEntry(Stream stream, FrameworkEntry frameworkEntry)
    {
        var document = new XDocument();
        var root     = new XElement("framework", new XAttribute("name", frameworkEntry.FrameworkName));

        document.Add(root);

        var dictionary = new HashSet <Guid>();

        foreach (var assembly in frameworkEntry.Assemblies)
        {
            foreach (var api in assembly.AllApis())
            {
                if (dictionary.Add(api.Fingerprint))
                {
                    AddApi(root, api);
                }
            }
        }

        foreach (var assembly in frameworkEntry.Assemblies)
        {
            AddAssembly(root, assembly);
        }

        document.Save(stream);
    }
Exemple #2
0
        private List <XmlElement> UpdateXml(string XmlNodeName, MemberReference mi)
        {
            List <XmlElement> returnValue = new List <XmlElement>();

            List <FrameworkEntry> entries     = new List <FrameworkEntry>();
            FrameworkEntry        singleEntry = new FrameworkEntry(entries, entries);

            singleEntry.Name = "dotnet-plat-ext-2.2";
            FrameworkTypeEntry enttyType = new FrameworkTypeEntry(singleEntry);

            var type             = GetType(typeof(mdoc.Test2.EiiImplementClass));
            var ieeImplementList = MDocUpdater.GetTypeEiiMembers(type);
            var typeInterfaces   = GetClassInterface(type);

            var doc = new XmlDocument();

            doc.LoadXml(XmlConsts.EiiErrorImplement);

            var node = doc.SelectSingleNode($"/Type/Members/Member[@MemberName='{XmlNodeName}']");

            if (node != null)
            {
                MDocUpdater.AddImplementedMembers(enttyType, mi, typeInterfaces, (XmlElement)node, ieeImplementList);
                returnValue = node.SelectNodes("Implements/InterfaceMember").Cast <XmlElement>().ToList();
            }

            return(returnValue);
        }
Exemple #3
0
 // Start is called before the first frame update
 void Start()
 {
     FrameworkEntry.RegisterComponent(new WindyFramework.Data.DataManager());
     FrameworkEntry.RegisterComponent(new WindyFramework.Event.EventManager());
     FrameworkEntry.RegisterComponent(new WindyFramework.Player.PlayerManager());
     UnityEngine.SceneManagement.SceneManager.LoadScene("Main", UnityEngine.SceneManagement.LoadSceneMode.Additive);
 }
    public static FrameworkEntry Index(string frameworkName, IEnumerable <string> assemblyPaths)
    {
        var references = new List <MetadataReference>();

        foreach (var path in assemblyPaths)
        {
            var metadata = MetadataReference.CreateFromFile(path);
            references.Add(metadata);
        }

        var metadataContext = MetadataContext.Create(references);

        var assemblyEntries = new List <AssemblyEntry>();

        foreach (var assembly in metadataContext.Assemblies)
        {
            var entry = AssemblyEntry.Create(assembly);
            if (entry.Apis.Any())
            {
                assemblyEntries.Add(entry);
            }
        }

        return(FrameworkEntry.Create(frameworkName, assemblyEntries));
    }
Exemple #5
0
 private void TestDataManager()
 {
     WindyFramework.Data.DataManager dataManager;
     dataManager = FrameworkEntry.GetComponent(typeof(WindyFramework.Data.DataManager)) as WindyFramework.Data.DataManager;
     WindyFramework.Data.ADataSheet <WindyFramework.Data.CardDataRow> aDataSheet;
     aDataSheet = dataManager.LoadDataSheet <WindyFramework.Data.CardDataRow>("Card");
     Debug.LogError(aDataSheet.GetDataRowById(1).Num);
 }
Exemple #6
0
 private void TestEventManager()
 {
     WindyFramework.Event.EventManager eventManager;
     eventManager = FrameworkEntry.GetComponent(typeof(WindyFramework.Event.EventManager)) as WindyFramework.Event.EventManager;
     eventManager.Subscribe(WindyFramework.Event.EventsId.TestEvent1, Ob2);
     eventManager.Subscribe(WindyFramework.Event.EventsId.TestEvent1, Ob1);
     eventManager.Subscribe(WindyFramework.Event.EventsId.TestEvent1, Ob2);
     eventManager.Fire(WindyFramework.Event.EventsId.TestEvent1, this, EventArgs.Empty);
 }
Exemple #7
0
        public Equip(int equipId)
        {
            ADataSheet <EquipDataRow> equipDataSheet;
            EquipDataRow equipDataRow;

            equipDataSheet = FrameworkEntry.GetComponent <DataManager>().GetDataSheet <EquipDataRow>("Equip");
            equipDataRow   = equipDataSheet.GetDataRowById(equipId);
            Id             = equipId;
            LevelLimit     = equipDataRow.LevelLimit;
            Postion        = equipDataRow.Postion;
            Rarity         = equipDataRow.Rarity;
            Name           = equipDataRow.Name;
            Strength       = equipDataRow.Strength;
        }
        private void BindLuaScript()
        {
            LuaManager luaMgr    = FrameworkEntry.GetModule <LuaManager>();
            LuaTable   scriptEnv = luaMgr.luaEnv.NewTable();
            LuaTable   meta      = luaMgr.luaEnv.NewTable();

            meta.Set("__index", luaMgr.luaEnv.Global);
            scriptEnv.SetMetaTable(meta);
            meta.Dispose();
            string luaFileName = string.Concat(UIName + "Logic");
            string cmd         = string.Concat("require 'ui/", luaFileName, "'");

            luaMgr.luaEnv.DoString(cmd, luaFileName, scriptEnv);
            logicEnv = scriptEnv.Get <LuaTable>(UIName);
            //string bindMethodName = string.Concat(UIName, ".", BindMethod);
            //scriptEnv.GetInPath<Action<LuaTable, UIWnd>>(bindMethodName)?.Invoke(logicEnv, this);
            logicEnv.Get <Action <LuaTable, UIWnd> >(BindMethod)?.Invoke(logicEnv, this);
        }
Exemple #9
0
        void DrawFrameworkEntry(FrameworkEntry entry, float labelWidth, float indentWidth, bool isChild = false)
        {
            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(indentWidth);
            var label = new GUIContent(entry.FileName, entry.Path);

            EditorGUILayout.LabelField(label, GUILayout.Width(labelWidth));

            if (FileAndFolderEntryFactory.Exists(entry.Path))
            {
                GUILayout.Space(SQUARE_BUTTON_SPACE_WIDTH);
            }
            else
            {
                Style.WarningIcon("File is missing");
            }

            if (isChild)
            {
                GUILayout.Space(ENUM_POPUP_WIDTH);
            }
            else
            {
                var add = entry.Embedded ? AddMethod.Copy : entry.Add;

                EditorGUILayout.LabelField(add.ToString(), GUILayout.Width(ENUM_POPUP_WIDTH));
            }

            var link = entry.Embedded ? LinkType.Required : entry.Link;

            EditorGUILayout.LabelField(link.ToString(), GUILayout.Width(ENUM_POPUP_WIDTH));

            if (entry.Embedded)
            {
                EditorGUILayout.LabelField("Embedded", GUILayout.Width(ENUM_POPUP_WIDTH));
            }

            EditorGUILayout.EndHorizontal();
            GUILayout.Space(2);
        }
        public override void Init()
        {
            LuaManager luaMgr = FrameworkEntry.GetModule <LuaManager>();

            luaMgr.luaEnv.AddLoader(CustomLuaLoad);
        }
Exemple #11
0
 public PlayerStageInfoManager()
 {
     stageDataTable = FrameworkEntry.GetComponent <DataManager>().GetDataSheet <StageDataRow>("Stage");
     eventManager   = FrameworkEntry.GetComponent <EventManager>();
     UnlockStage    = 40;
 }
Exemple #12
0
        public static void AddFrameworkToElement(this XmlElement element, FrameworkEntry framework)
        {
            var fxaValue = FXUtils.AddFXToList(element.GetAttribute(Consts.FrameworkAlternate), framework.Name);

            element.SetAttribute(Consts.FrameworkAlternate, fxaValue);
        }
Exemple #13
0
 // Start is called before the first frame update
 void Start()
 {
     FrameworkEntry.RegisterComponent(new WindyFramework.Data.DataManager());
     FrameworkEntry.RegisterComponent(new WindyFramework.Event.EventManager());
     TestEventManager();
 }
 private void Start()
 {
     //框架初始化
     FrameworkEntry.FrameworkInit(this);
 }
 public FrameworkEntry(FrameworkEntry other)
     : base(other)
 {
     Link     = other.Link;
     Embedded = other.Embedded;
 }
    public async Task <PackageEntry> Index(string id, string version)
    {
        var dependencies     = new Dictionary <string, PackageArchiveReader>();
        var frameworkEntries = new List <FrameworkEntry>();

        try
        {
            using (var root = await _store.GetPackageAsync(id, version))
            {
                var targetNames = new HashSet <string>(StringComparer.OrdinalIgnoreCase);

                foreach (var item in GetReferenceItems(root))
                {
                    targetNames.Add(item.TargetFramework.GetShortFolderName());
                }

                var targets = targetNames.Select(NuGetFramework.Parse).ToArray();

                if (!targets.Any())
                {
                    return(null);
                }

                foreach (var target in targets)
                {
                    var referenceGroup = GetReferenceItems(root, target);

                    Debug.Assert(referenceGroup != null);

                    await GetDependenciesAsync(dependencies, root, target);

                    // Add references

                    var referenceMetadata = new List <MetadataReference>();

                    foreach (var path in referenceGroup.Items)
                    {
                        var metadata = await AssemblyStream.CreateAsync(root.GetStream(path), path);

                        referenceMetadata.Add(metadata);
                    }

                    // Add dependencies

                    var dependencyMetadata = new List <MetadataReference>();

                    foreach (var dependency in dependencies.Values)
                    {
                        var dependencyReferences = GetReferenceItems(dependency, target);
                        if (dependencyReferences != null)
                        {
                            foreach (var path in dependencyReferences.Items)
                            {
                                var metadata = await AssemblyStream.CreateAsync(dependency.GetStream(path), path);

                                dependencyMetadata.Add(metadata);
                            }
                        }
                    }

                    // Add framework

                    var platformPaths = GetPlatformSet(target);

                    if (platformPaths == null)
                    {
                        if (!IsKnownUnsupportedPlatform(target))
                        {
                            Console.WriteLine($"error: can't resolve platform references for {target}");
                        }
                        continue;
                    }

                    foreach (var path in platformPaths)
                    {
                        var metadata = MetadataReference.CreateFromFile(path);
                        dependencyMetadata.Add(metadata);
                    }

                    var metadataContext = MetadataContext.Create(referenceMetadata, dependencyMetadata);

                    var assemblyEntries = new List <AssemblyEntry>();

                    foreach (var reference in metadataContext.Assemblies)
                    {
                        var entry = AssemblyEntry.Create(reference);
                        assemblyEntries.Add(entry);
                    }

                    frameworkEntries.Add(FrameworkEntry.Create(target.GetShortFolderName(), assemblyEntries));
                }
            }

            return(PackageEntry.Create(id, version, frameworkEntries));
        }
        finally
        {
            foreach (var package in dependencies.Values)
            {
                package.Dispose();
            }
        }
    }