Esempio n. 1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            }

            if (service != null)
            {
                if (value is LinkBFBB[])
                {
                    LinkBFBB[] events = LinkEditor.GetEvents((LinkBFBB[])value, endianness, IsTimed, thisAssetID);

                    if (events != null)
                    {
                        value = events;
                    }
                }
                else if (value is LinkTSSM[])
                {
                    LinkTSSM[] events = LinkEditor.GetEvents((LinkTSSM[])value, endianness, IsTimed, thisAssetID);

                    if (events != null)
                    {
                        value = events;
                    }
                }
            }

            IsTimed = false;
            return(value);
        }
Esempio n. 2
0
        public static LinkTSSM[] GetEvents(LinkTSSM[] links, Endianness endianness, out bool success, bool isTimed, uint thisAssetID)
        {
            LinkEditor eventEditor = new LinkEditor(links, isTimed, endianness, thisAssetID);

            eventEditor.ShowDialog();

            success = eventEditor.OK;

            List <LinkTSSM> assetEventBFBBs = new List <LinkTSSM>();

            foreach (LinkTSSM assetEvent in eventEditor.listBoxLinks.Items)
            {
                assetEventBFBBs.Add(assetEvent);
            }

            return(assetEventBFBBs.ToArray());
        }
Esempio n. 3
0
        public static LinkIncredibles[] GetEvents(LinkIncredibles[] events, out bool success, bool isTimed)
        {
            LinkEditor eventEditor = new LinkEditor(events, isTimed);

            eventEditor.ShowDialog();

            success = eventEditor.OK;

            List <LinkIncredibles> assetEventBFBBs = new List <LinkIncredibles>();

            foreach (LinkIncredibles assetEvent in eventEditor.listBoxLinks.Items)
            {
                assetEventBFBBs.Add(assetEvent);
            }

            return(assetEventBFBBs.ToArray());
        }
Esempio n. 4
0
        public static Link[] GetLinks(Game game, Link[] links, LinkType linkType, uint thisAssetID)
        {
            LinkEditor linkEditor = new LinkEditor(game, links, linkType, thisAssetID);

            linkEditor.ShowDialog();

            if (linkEditor.OK)
            {
                List <Link> newLinks = new List <Link>();
                foreach (Link l in linkEditor.listBoxLinks.Items)
                {
                    newLinks.Add(l);
                }

                return(newLinks.ToArray());
            }

            return(null);
        }
Esempio n. 5
0
        public static LinkBFBB[] GetEvents(LinkBFBB[] links, Endianness endianness, bool isTimed, uint thisAssetID)
        {
            LinkEditor eventEditor = new LinkEditor(links, isTimed, endianness, thisAssetID);

            eventEditor.ShowDialog();

            if (eventEditor.OK)
            {
                List <LinkBFBB> assetEventBFBBs = new List <LinkBFBB>();
                foreach (LinkBFBB assetEvent in eventEditor.listBoxLinks.Items)
                {
                    assetEventBFBBs.Add(assetEvent);
                }

                return(assetEventBFBBs.ToArray());
            }

            return(null);
        }
Esempio n. 6
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            }

            if (service != null)
            {
                if (value is LinkBFBB[])
                {
                    LinkBFBB[] events = LinkEditor.GetEvents((LinkBFBB[])value, out bool success, IsTimed);

                    if (success)
                    {
                        value = events;
                    }
                }
                else if (value is LinkTSSM[])
                {
                    LinkTSSM[] events = LinkEditor.GetEvents((LinkTSSM[])value, out bool success, IsTimed);

                    if (success)
                    {
                        value = events;
                    }
                }
                else if (value is LinkIncredibles[])
                {
                    LinkIncredibles[] events = LinkEditor.GetEvents((LinkIncredibles[])value, out bool success, IsTimed);

                    if (success)
                    {
                        value = events;
                    }
                }
            }

            IsTimed = false;
            return(value);
        }
Esempio n. 7
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            }

            if (service != null)
            {
                if (value is Link[] links)
                {
                    var newLinks = LinkEditor.GetLinks(Game, links, LinkType, ThisAssetID);

                    if (newLinks != null)
                    {
                        value = newLinks;
                    }
                }
            }

            return(value);
        }