public static void Serialize(this SerializingContainer2 sc, ref FragmentInfo info)
 {
     if (sc.IsLoading)
     {
         info = new FragmentInfo();
     }
     sc.Serialize(ref info.Center);
     sc.Serialize(ref info.ConvexHull);
     sc.Serialize(ref info.Bounds);
     if (sc.Game >= MEGame.ME3)
     {
         sc.Serialize(ref info.Neighbours, Serialize);
         sc.Serialize(ref info.bCanBeDestroyed);
         sc.Serialize(ref info.bRootFragment);
         sc.Serialize(ref info.bNeverSpawnPhysicsChunk);
         sc.Serialize(ref info.AverageExteriorNormal);
         sc.Serialize(ref info.NeighbourDims, Serialize);
     }
     else if (sc.IsLoading)
     {
         info.Neighbours      = new byte[info.ConvexHull.FacePlaneData.Length];
         info.bCanBeDestroyed = true;
         info.NeighbourDims   = new float[info.Neighbours.Length];
         for (int i = 0; i < info.NeighbourDims.Length; i++)
         {
             info.NeighbourDims[i] = 1;
         }
     }
 }
示例#2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            this.View = inflater.Inflate(Resource.Layout.fragment_unified_basic_info, container, false);

            this.CreateView();

            if (savedInstanceState != null)
            {
                this._fragmentInfo = this.Activity.SupportFragmentManager.GetFragment(savedInstanceState, OverLayFragmentBundleKey) as FragmentInfo;

                if (this._fragmentInfo != null)
                {
                    this.WizardActivity.ShowOverlay(this._fragmentInfo, false);
                }

                if (savedInstanceState.ContainsKey(ProspectBeingConvertedBundleKey))
                {
                    this._prospectBeingConverted =
                        JsonConvert.DeserializeObject <ProspectSearchResult>(
                            savedInstanceState.GetString(ProspectBeingConvertedBundleKey));
                }
            }

            return(this.View);
        }
示例#3
0
        private static List <FragmentInfo> GetSectorFragments(string name)
        {
            name = name.ToLowerInvariant();
            List <FragmentInfo> fragments = new List <FragmentInfo>();
            string current = name;

            while (current != "")
            {
                bool spacestart = current.StartsWith(" ");
                current = current.Trim();
                FragmentInfo frag = Fragments.FirstOrDefault(f => current.StartsWith(f.Value));
                if (frag.Value == null)
                {
                    return(null);
                }
                if (spacestart)
                {
                    frag.IsSuffix = false;
                    frag.IsInfix  = false;
                }
                else if (fragments.Count != 0 && frag.IsInfix && frag.IsVowelInfix != fragments.Last().IsVowelInfix)
                {
                    frag.IsPrefix = false;
                }
                fragments.Add(frag);
                current = current.Substring(frag.Value.Length);
            }

            return(fragments);
        }
示例#4
0
        private void InvokeFragmentTransaction(FragmentInfo fragmentInfo)
        {
            if (fragmentInfo.FragmentInstance == _currentFragment)
            {
                return;
            }

            var fragmentTransaction = CurrentFragmentManager.BeginTransaction();
            var fragment            = fragmentInfo.FragmentInstance;

            fragment.ViewModel = fragmentInfo.ViewModelInstance;

            if (CurrentFragmentManager.FindFragmentByTag(fragmentInfo.JavaFragmentName) != null)
            {
                fragmentTransaction.Show(CurrentFragmentManager.FindFragmentByTag(
                                             fragmentInfo.JavaFragmentName));
            }
            else
            {
                fragmentTransaction.Add(fragmentInfo.FragmentContentId,
                                        (Fragment)fragment, fragmentInfo.JavaFragmentName);
            }

            fragmentTransaction.Commit();
            fragmentTransaction = CurrentFragmentManager.BeginTransaction();

            if (_currentFragment != null)
            {
                fragmentTransaction.Hide(_currentFragment);
            }
            fragmentTransaction.Commit();

            _currentFragment = (Fragment)fragment;
            fragmentInfo.ViewModelInstance.ViewAppearing();
        }
示例#5
0
 private static int C1ProcessPrefixFragment(FragmentInfo frag, int offset)
 {
     offset  = Math.DivRem(offset, PrefixRunLengths[frag.Value], out int offset_mod);
     offset *= PrefixTotalRunLength;
     offset += offset_mod;
     offset += PrefixOffsets[frag.Value];
     return(offset);
 }
示例#6
0
        /// <summary>
        ///     Register a Fragment to be shown, this should usually be done in OnCreate
        /// </summary>
        /// <typeparam name="TFragment">Fragment Type</typeparam>
        /// <typeparam name="TViewModel">ViewModel Type</typeparam>
        /// <param name="tag">The tag of the Fragment, it is used to register it with the FragmentManager</param>
        public void RegisterFragment <TFragment, TViewModel>(string tag, bool isRoot = false)
            where TViewModel : IMvxViewModel
            where TFragment : IMvxFragmentView
        {
            var fragInfo = new FragmentInfo(tag, typeof(TFragment), typeof(TViewModel), isRoot);

            _lookup.Add(tag, fragInfo);
        }
示例#7
0
        /// <summary>
        ///     Register a Fragment to be shown, this should usually be done in OnCreate
        /// </summary>
        /// <typeparam name="TFragment">Fragment Type</typeparam>
        /// <typeparam name="TViewModel">ViewModel Type</typeparam>
        /// <param name="tag">The tag of the Fragment, it is used to register it with the FragmentManager</param>
        public void RegisterFragment <TFragment, TViewModel>(string tag)
            where TFragment : IMvxFragmentView
            where TViewModel : IMvxViewModel
        {
            var fragInfo = new FragmentInfo(tag, typeof(TFragment), typeof(TViewModel));

            _lookup.Add(tag, fragInfo);
        }
示例#8
0
 private static int C1ProcessInfixFragment(FragmentInfo frag, int offset)
 {
     offset  = Math.DivRem(offset, InfixRunLengths[frag.Value], out int offset_mod);
     offset *= frag.IsVowelInfix ? Infix1TotalRunLength : Infix2TotalRunLength;
     offset += offset_mod;
     offset += InfixOffsets[frag.Value];
     return(offset);
 }
示例#9
0
 void InitFragment()
 {
     fragScheduler = new FragmentScheduler();
     fragTest      = new FragmentTest();
     fragExam      = new FragmentExam();
     fragInfo      = new FragmentInfo();
     fragProviso   = new FragmentProviso();
 }
示例#10
0
 internal ItemPart(StoreObjectId itemId, string subject, FragmentInfo uniqueBodyFragment, FragmentInfo disclaimerFragment, ParticipantTable recipients, IList <Participant> replyToParticipants, IStorePropertyBag storePropertyBag, PropertyDefinition[] loadedProperties) : this(loadedProperties)
 {
     this.itemId             = itemId;
     this.subject            = subject;
     this.storePropertyBag   = storePropertyBag;
     this.uniqueBodyFragment = uniqueBodyFragment;
     this.disclaimerFragment = disclaimerFragment;
     this.recipients         = recipients;
     this.replyToParticipants.AddRange(replyToParticipants);
 }
示例#11
0
        public async Task <bool> ShowOverlayIfOffline(SalesApp.Core.BL.Models.People.Customer customer)
        {
            this._fragmentInfo = new FragmentInfo();
            this._fragmentInfo.SetArgument(FragmentInfo.ResourceIdBundleKey, Resource.Layout.fragment_choose_registration_type);

            this._fragmentInfo.ViewCreated += (sender, args) =>
            {
                ViewsHelper <Person> viewsHelper = new ViewsHelper <Person>(Activity as ActivityBase,
                                                                            _fragmentInfo.InflatedView);

                viewsHelper.BindEvent
                (
                    BindableEvents.OnClick
                    , Resource.Id.linFirstTimeProduct
                    , linFirstTimeProduct =>
                {
                    WizardActivity.HideOverlay(false);
                    IsAdditionalProduct              = false;
                    customer.IsAdditionalProduct     = IsAdditionalProduct;
                    WizardActivity.ButtonNextEnabled = true;

                    string serializedData = JsonConvert.SerializeObject(customer);
                    WizardActivity.CurrentFragment.SetData(serializedData);
                    WizardActivity.Go(true);
                });

                viewsHelper.BindEvent(
                    BindableEvents.OnClick,
                    Resource.Id.linAddProduct,
                    linAddProduct =>
                {
                    WizardActivity.HideOverlay(false);
                    IsAdditionalProduct              = true;
                    customer.IsAdditionalProduct     = IsAdditionalProduct;
                    WizardActivity.ButtonNextEnabled = true;

                    string serializedData = JsonConvert.SerializeObject(customer);
                    WizardActivity.CurrentFragment.SetData(serializedData);
                    WizardActivity.Go(true);
                });

                viewsHelper.Write(Resource.Id.tvPersonName, customer.FullName);
                viewsHelper.Write(Resource.Id.tvPhone, customer.Phone);
                viewsHelper.WriteBoundViews(customer);
            };

            WizardActivity.ShowOverlay(_fragmentInfo, false);
            return(false);
        }
示例#12
0
        /// <summary>
        /// 构建组件Map属性值
        /// </summary>
        /// <returns></returns>
        private Dictionary <string, string> BuildComponentMapPropertyValue(FragmentInfo fragmentInfo)
        {
            if (fragmentInfo.QueryOutputParams == null || fragmentInfo.QueryOutputParams.Count == 0)
            {
                return(null);
            }
            Dictionary <string, string> mapValue = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);

            foreach (var fragmentInfoQueryOutputParam in fragmentInfo.QueryOutputParams)
            {
                if (!mapValue.ContainsKey(fragmentInfoQueryOutputParam.Code))
                {
                    mapValue.Add(fragmentInfoQueryOutputParam.Code, fragmentInfoQueryOutputParam.Metadata);
                }
            }
            return(mapValue);
        }
示例#13
0
    public static ConversionResult Convert(IRenderedFragment fragment, VerifySettings settings)
    {
        var stream = new MemoryStream();

        using var writer = stream.BuildLeaveOpenWriter();
        var markup = fragment.Markup;

        writer.WriteLine(markup);

        var instance = ComponentReader.GetInstance(fragment);
        var all      = fragment.FindAll("*");
        var info     = new FragmentInfo(
            instance,
            fragment.RenderCount,
            all.Count,
            markup.Replace("\r\n", "\n").Length.ToString("N0"));

        return(new ConversionResult(info, new [] { new ConversionStream("html", stream) }));
    }
示例#14
0
        private static FragmentInfo ReadFragment(XmlNode node)
        {
            var result       = new FragmentInfo();
            var propertyNode = node.FirstChild;

            while (propertyNode != null)
            {
                if (propertyNode.Name == "FileName")
                {
                    result.Filename = propertyNode.InnerText;
                }
                else if (propertyNode.Name == "LineRange")
                {
                    result.LineStart = TryGetIntegerAttribute(propertyNode, "Start", 1);
                    result.LineEnd   = TryGetIntegerAttribute(propertyNode, "End", 1);
                }
                propertyNode = propertyNode.NextSibling;
            }
            return(result);
        }
示例#15
0
        private void SetUniqueBody(IMessageItem escalatedMessage, IMailboxSession mailboxSession)
        {
            StoreId messageStoreId = this.GetMessageStoreId(escalatedMessage.InReplyTo, mailboxSession);

            if (messageStoreId != null)
            {
                using (IMessageItem messageItem = this.xsoFactory.BindToMessage(mailboxSession, messageStoreId, null))
                {
                    BodyDiffer   bodyDiffer     = new BodyDiffer(messageItem.Body.GetConversationBodyScanner(), escalatedMessage.Body.GetConversationBodyScanner());
                    FragmentInfo uniqueBodyPart = bodyDiffer.UniqueBodyPart;
                    using (TextWriter textWriter = escalatedMessage.Body.OpenTextWriter(new BodyWriteConfiguration(BodyFormat.TextHtml)))
                    {
                        using (HtmlWriter htmlWriter = new HtmlWriter(textWriter))
                        {
                            uniqueBodyPart.WriteHtml(htmlWriter);
                        }
                    }
                }
            }
        }
示例#16
0
        /// <summary>
        /// 替换模板变量
        /// </summary>
        /// <returns></returns>
        private List <string> ReplaceTextTemplateVariable(FragmentInfo fragmentInfo, object textTemplateData)
        {
            //todo 代码整理
            List <string> textList = new List <string>();
            var           htmlText = ReplaceWithPageContextParam(fragmentInfo.Htmltext);

            //参数替换
            if (fragmentInfo.FragmentHasTextTemplate && !string.IsNullOrWhiteSpace(htmlText) &&
                _pageContext.TextTemplateParams != null && textTemplateData != null)
            {
                if (textTemplateData is JArray)
                {
                    return(ReplaceTextTemplateVariableWithJArray(textTemplateData as JArray, htmlText));
                }
                else
                {
                    return(ReplaceTextTemplateVariableWithObj(textTemplateData, htmlText));
                }
            }
            return(textList);
        }
        public virtual async Task <Fragment> ResolveAsync(string name)
        {
            if (string.IsNullOrEmpty(name) == false)
            {
                FragmentInfo fragmentInfo = await _fragmentRegistry.FindAsync(name);

                if (fragmentInfo.IsRemote)
                {
                    return(new RemoteFragment(fragmentInfo, _httpClientProvider, _memoryCache));
                }

                var fragmentName = $"{name}{Constants.FragmentTypeSuffix}";
                var fragmentType = typeof(Fragment);
                var type         = AppDomain.CurrentDomain.GetAssemblies().SelectMany(asm => asm.DefinedTypes).FirstOrDefault(t => t.Name == fragmentName && fragmentType.IsAssignableFrom(t));
                if (type != null)
                {
                    var constructor       = type.GetConstructors().First();
                    var serviceCollection = constructor.GetParameters().Select(p => _serviceProvider.GetService(p.ParameterType));
                    return(constructor.Invoke(serviceCollection.ToArray()) as Fragment);
                }
            }

            return(null);
        }
        private void AddBodySummary(IConversationTree conversationTree, ref IStorePropertyBag propertyBag, FragmentInfo bodyFragment)
        {
            StoreObjectId objectId = ((VersionedId)propertyBag.TryGetProperty(ItemSchema.Id)).ObjectId;

            if (!this.bodySummaryLoadedNodes.Contains(objectId))
            {
                this.bodySummaryLoadedNodes.Add(objectId);
                string summaryText = bodyFragment.GetSummaryText();
                if (!this.SetBodySummary(conversationTree, ref propertyBag, summaryText, objectId))
                {
                    this.optimizationInfo.UpdateItemSummaryConstructed(objectId);
                }
            }
        }
示例#19
0
 public ItemPart Create(StoreObjectId itemId, IStorePropertyBag propertyBagFromTree, FragmentInfo uniqueBodyFragment, FragmentInfo disclaimerFragment, ParticipantTable recipients, IList <Participant> replyToParticipants)
 {
     return(new ItemPart(itemId, (propertyBagFromTree.TryGetProperty(ItemSchema.Subject) as string) ?? string.Empty, uniqueBodyFragment, disclaimerFragment, recipients, replyToParticipants, propertyBagFromTree, this.queriedPropertyDefinitions));
 }
示例#20
0
 public ViewComponent(FragmentInfo fragmentInfo)
 {
     this.FragmentInfo = fragmentInfo;
     // this.Data=new object();
 }
示例#21
0
        public async Task <bool> ShowOverlayIfPhoneNumberDuplicate(string phone, string nationalId = null)
        {
            ErrorFilterFlags flag = ErrorFilterFlags.DisableErrorHandling;
            Person           person;

            SalesApp.Core.BL.Models.People.Customer customer = await new CustomersController().GetPersonIfExists(phone, nationalId, filterFlags: flag, checkDuplicate: false);
            SalesApp.Core.BL.Models.People.Prospect prospect = null;

            if (customer == null)
            {
                prospect = await new ProspectsController().GetPersonIfExists(phone, filterFlags: flag, checkDuplicate: false);
                person   = JsonConvert.DeserializeObject <Person>(JsonConvert.SerializeObject(prospect));
            }
            else
            {
                if (customer.PersonType == PersonTypeEnum.Prospect)
                {
                    prospect =
                        JsonConvert.DeserializeObject <SalesApp.Core.BL.Models.People.Prospect>(
                            JsonConvert.SerializeObject(customer));
                }
                else
                {
                    string         urlParam       = customer.Phone + "&foradditionalproduct=true";
                    CustomerStatus customerStatus = await new CustomerStatusApi().GetAsync(urlParam);

                    if (customerStatus != null)
                    {
                        customer.AccountStatus = customerStatus.AccountStatus;
                    }
                }

                person = JsonConvert.DeserializeObject <Person>(JsonConvert.SerializeObject(customer));
            }

            if (person == null)
            {
                return(false);
            }

            this._fragmentInfo = new FragmentInfo();
            this._fragmentInfo.SetArgument(FragmentInfo.ResourceIdBundleKey, Resource.Layout.fragment_unified_existing_person);

            this._fragmentInfo.ViewCreated += (sender, args) =>
            {
                ViewsHelper <Person> viewsHelper = new ViewsHelper <Person>(Activity as ActivityBase,
                                                                            _fragmentInfo.InflatedView);

                viewsHelper.BindEvent
                (
                    BindableEvents.OnClick
                    , Resource.Id.linEditCustomer
                    , linEditCustomer =>
                {
                    WizardActivity.HideOverlay(true);
                });

                viewsHelper.BindEvent(
                    BindableEvents.OnClick,
                    Resource.Id.linAddProduct,
                    linAddProduct =>
                {
                    // if doing prospect registration, do conversion to customer
                    if (WizardActivity.WizardType == WizardTypes.ProspectRegistration)
                    {
                        // do conversion to customer
                        if (person.PersonType == PersonTypeEnum.Prospect)
                        {
                            ProspectSearchResult psr = JsonConvert.DeserializeObject <ProspectSearchResult>(JsonConvert.SerializeObject(prospect));
                            Dictionary <string, object> bundledItems = new Dictionary <string, object>();
                            bundledItems.Add(KeyProspectIdBundled, psr);

                            WizardLauncher.Launch(Activity, WizardTypes.CustomerRegistration, WizardActivity.StartPoint, bundledItems);
                        }
                        else
                        {
                            // posible additional product
                            if (customer != null)
                            {
                                WizardActivity.HideOverlay(true);
                                IsAdditionalProduct = true;
                                WizardActivity.IsProspectConversion      = true;
                                CustomerSearchResult csr                 = JsonConvert.DeserializeObject <CustomerSearchResult>(JsonConvert.SerializeObject(customer));
                                Dictionary <string, object> bundledItems = new Dictionary <string, object>();
                                bundledItems.Add(KeyCustomerIdBundled, csr);

                                WizardLauncher.Launch(Activity, WizardTypes.CustomerRegistration, WizardActivity.StartPoint, bundledItems);
                            }
                        }
                    }
                    else
                    {
                        // customer registration
                        if (person.PersonType == PersonTypeEnum.Prospect)
                        {
                            // auto fill the details
                            FillFromExistingRecord(prospect);
                            WizardActivity.IsProspectConversion = true;
                        }
                        else
                        {
                            // auto fill the details
                            FillFromExistingRecord(customer);
                        }

                        WizardActivity.HideOverlay(true);
                        IsAdditionalProduct = true; // though this may be cheating ;)
                        WizardActivity.GoNext();
                    }
                });

                viewsHelper.Write(Resource.Id.tvPersonName, person.FullName);
                viewsHelper.Write(Resource.Id.tvPhone, person.Phone);
                viewsHelper.WriteBoundViews(customer);

                if (customer != null && customer.AccountStatus != null && !customer.AccountStatus.Equals("Active"))
                {
                    ShowConversionButton(_fragmentInfo.InflatedView, ViewStates.Gone);
                    ShowPersonStatus(_fragmentInfo.InflatedView);
                }

                if (person.PersonType == PersonTypeEnum.Prospect)
                {
                    // show conversion button
                    ShowConversionButton(_fragmentInfo.InflatedView, ViewStates.Visible);
                }
            };

            WizardActivity.ShowOverlay(_fragmentInfo, false);
            return(true);
        }
示例#22
0
        private static FragmentInfo[] FillFragments(string[] prefixes, string[] infixes1, string[] infixes2, string[] suffixes1, string[] suffixes2)
        {
            Dictionary <string, FragmentInfo> frags = new Dictionary <string, FragmentInfo>(StringComparer.InvariantCultureIgnoreCase);

            for (int i = 0; i < prefixes.Length; i++)
            {
                string       prefix = prefixes[i];
                string       p      = prefix.ToLowerInvariant();
                FragmentInfo frag   = frags.ContainsKey(p) ? frags[p] : new FragmentInfo {
                    Value = p
                };
                frag.IsPrefix        = true;
                frag.IsC1VowelPrefix = C1PrefixInfix2.Contains(prefix);
                frag.IsC2VowelPrefix = C2PrefixSuffix2.Contains(prefix);
                frag.PrefixIndex     = i;
                frags[p]             = frag;
            }

            for (int i = 0; i < infixes1.Length; i++)
            {
                string       p    = infixes1[i].ToLowerInvariant();
                FragmentInfo frag = frags.ContainsKey(p) ? frags[p] : new FragmentInfo {
                    Value = p
                };
                frag.IsInfix      = true;
                frag.IsVowelInfix = true;
                frag.InfixIndex   = i;
                frags[p]          = frag;
            }

            for (int i = 0; i < infixes2.Length; i++)
            {
                string       p    = infixes2[i].ToLowerInvariant();
                FragmentInfo frag = frags.ContainsKey(p) ? frags[p] : new FragmentInfo {
                    Value = p
                };
                frag.IsInfix      = true;
                frag.IsVowelInfix = false;
                frag.InfixIndex   = i;
                frags[p]          = frag;
            }

            for (int i = 0; i < suffixes1.Length; i++)
            {
                string       p    = suffixes1[i].ToLowerInvariant();
                FragmentInfo frag = frags.ContainsKey(p) ? frags[p] : new FragmentInfo {
                    Value = p
                };
                frag.IsSuffix      = true;
                frag.IsVowelSuffix = true;
                frag.SuffixIndex   = i;
                frags[p]           = frag;
            }

            for (int i = 0; i < suffixes2.Length; i++)
            {
                string       p    = suffixes2[i].ToLowerInvariant();
                FragmentInfo frag = frags.ContainsKey(p) ? frags[p] : new FragmentInfo {
                    Value = p
                };
                frag.IsSuffix      = true;
                frag.IsVowelSuffix = false;
                frag.SuffixIndex   = i;
                frags[p]           = frag;
            }

            return(frags.Values.OrderByDescending(f => f.Value.Length).ThenBy(f => f.Value).ToArray());
        }
示例#23
0
 public RemoteFragment(FragmentInfo fragmentInfo, IHttpClientProvider httpClientProvider, IMemoryCache memoryCache)
 {
     _fragmentInfo       = fragmentInfo;
     _httpClientProvider = httpClientProvider;
     _memoryCache        = memoryCache;
 }
    void OnEnable()
    {
        mainUILogic = GameObject.Find("MainUILogic");
        Debug.Log("xlym: OnEnable BattleEndController");
        if (Obj_MyselfPlayer.GetMe().battleData.isPlayed)
        {
            if (Obj_MyselfPlayer.GetMe().battleType == BattleType.WORLD_BOSS)
            {
                normalBattle.SetActive(false);
                worldBossBattle.SetActive(true);
                pataBattle.SetActive(false);
                if (Obj_MyselfPlayer.GetMe().battleData.isWin)
                {
                    worldBossName.text = Obj_MyselfPlayer.GetMe().lastKillInfo.lastBossInfo.name;
                }
                else
                {
                    worldBossName.text = Obj_MyselfPlayer.GetMe().activeBoss.name;
                }
                UIEventListener.Get(backGround).onClick += OnWorldBossController;
                moneyMax = Obj_MyselfPlayer.GetMe().worldBossRewardMoney;
                moneyCut = moneyMax / 50;
                if (moneyCut == 0)
                {
                    moneyCut = 1;
                }
                damageMax = (int)Obj_MyselfPlayer.GetMe().worldBossCurrentDamage;
                damageCut = damageMax / 50;
                if (damageCut == 0)
                {
                    damageCut = 1;
                }
            }
            else if (Obj_MyselfPlayer.GetMe().battleType == BattleType.CHONG_LOU)
            {
                normalBattle.SetActive(false);
                worldBossBattle.SetActive(false);
                pataBattle.SetActive(true);
                pataMoney.text = Obj_MyselfPlayer.GetMe().pataTotalRewardMoney.ToString();
                pataRuby.text  = Obj_MyselfPlayer.GetMe().pataTotalRewardYuanbao.ToString();
                pataFloor.text = Obj_MyselfPlayer.GetMe().lastPataNum.ToString();


                UIEventListener.Get(pataBackBtn).onClick += OnPataBackBtn;
                if (Obj_MyselfPlayer.GetMe().pataTimes > 0)
                {
                    pataContinueBtn.collider.enabled = true;
                    pataContinueBtn.transform.FindChild("Sprite").GetComponent <UISprite>().spriteName     = "jixutiaozhan_1";
                    pataContinueBtn.transform.FindChild("Background").GetComponent <UISprite>().spriteName = "anniu_1";
                    UIEventListener.Get(pataContinueBtn).onClick += OnPataContinueBtn;
                }
                else
                {
                    pataContinueBtn.collider.enabled = false;
                    pataContinueBtn.transform.FindChild("Sprite").GetComponent <UISprite>().spriteName     = "jixutiaozhan_3";
                    pataContinueBtn.transform.FindChild("Background").GetComponent <UISprite>().spriteName = "anniu_3";
                }
            }
            else
            {
                worldBossBattle.SetActive(false);
                normalBattle.SetActive(true);
                pataBattle.SetActive(false);
                if (!Obj_MyselfPlayer.GetMe().battleData.isWin)
                {
                    Obj_MyselfPlayer.GetMe().battleData.addExp = 0;
                }
                if (Obj_MyselfPlayer.GetMe().exp - Obj_MyselfPlayer.GetMe().battleData.addExp < 0)
                {
                    nowLev          = Obj_MyselfPlayer.GetMe().lastLevel;
                    levelValue.text = nowLev.ToString();
                    lastLevelExp    = TableManager.GetIdexperienceByID((Obj_MyselfPlayer.GetMe().lastLevel)).IDExperience;
                    if (Obj_MyselfPlayer.GetMe().level == 16)
                    {
                        mainUILogic.SendMessage("flashLunJian");
                    }
                }
                else
                {
                    nowLev          = Obj_MyselfPlayer.GetMe().level;
                    levelValue.text = nowLev.ToString();
                    lastLevelExp    = TableManager.GetIdexperienceByID((Obj_MyselfPlayer.GetMe().level)).IDExperience;
                }
                expProgress.sliderValue = (float)Obj_MyselfPlayer.GetMe().lastExp / (float)lastLevelExp;
                nexLevelExp             = TableManager.GetIdexperienceByID((Obj_MyselfPlayer.GetMe().level)).IDExperience;
                Debug.Log("nexLevelExp=" + nexLevelExp);
                mainCopy.text = LanguageManger.GetWords(TableManager.GetCopyByID(Obj_MyselfPlayer.GetMe().curMainCopy.copyId).Copyname);
                subCopy.text  = LanguageManger.GetWords(TableManager.GetCopydetailByID(Obj_MyselfPlayer.GetMe().curSubcopy.subCopyID).Copyname);
                //expProgress.sliderValue = 0.8f;
                dropBags = Obj_MyselfPlayer.GetMe().battleData.winDropBags;
                BattleTrophys.gameObject.SetActive(false);
                if (Obj_MyselfPlayer.GetMe().battleData.isWin)
                {
                    AniStart = true;
                    moneyMax = 0;
                    foreach (DropBag bag in dropBags)
                    {
                        Debug.Log("bag.type=" + bag.type.ToString());
                        if (bag.type == DropType.MONEY && bag.val > 0)
                        {
                            moneyMax += bag.val;
                        }
                    }
                    Debug.Log("moneyMax=" + moneyMax);
                    moneyCut = moneyMax / 50;
                    if (moneyCut == 0)
                    {
                        moneyCut = 1;
                    }
                    //moneyCount.text = money.ToString();
                    expCount.text = Obj_MyselfPlayer.GetMe().battleData.addExp.ToString();
                    expMax        = Obj_MyselfPlayer.GetMe().battleData.addExp;
                    expCut        = expMax / 50;
                    if (expCut == 0)
                    {
                        expCut = 1;
                    }
                    //				BattleTrophys.gameObject.SetActive(true);
                    SetDropCard();
                }

                if (Obj_MyselfPlayer.GetMe().exp - Obj_MyselfPlayer.GetMe().battleData.addExp < 0)
                {
                    //升级
                    AudioManager.Instance.PlayEffectSound("upgrade");
                    levUpData.SetActive(true);
                    RefreshLevUpData();
                    trophy.spriteName = "shengji";
                    trophy.MakePixelPerfect();
                    UIEventListener.Get(backGround).onClick += OnMainWindow;
                }
                else
                {
                    AudioManager.Instance.PlayEffectSound("reward");
                    levUpData.SetActive(false);
                    if (Obj_MyselfPlayer.GetMe().newTemplateID.Count > 0)
                    {
                        //获得图鉴中没有的新卡牌进入卡牌展示界面
                        UIEventListener.Get(backGround).onClick += HeroInfoWindowClick;
                    }
                    else
                    {
                        UIEventListener.Get(backGround).onClick += OnConfirmButtonClick;
                    }
                    if (Obj_MyselfPlayer.GetMe().battleData.isWin)
                    {
                        trophy.spriteName = "zhandou_zhanlipin";
                        trophy.MakePixelPerfect();
                        BattleTrophys.gameObject.SetActive(true);
                    }
                }
                //星级
                int starLev = Obj_MyselfPlayer.GetMe().currentCopyStar;
                //显示星级
                for (int i = 1; i <= 3; i++)
                {
                    //判断星级
                    if (i <= starLev)
                    {
                        Stars.transform.FindChild("Sprite-Star" + i).gameObject.SetActive(true);
                        Stars.transform.FindChild("Star" + i + "Ani").gameObject.SetActive(true);
                    }
                    else
                    {
                        Stars.transform.FindChild("Sprite-Star" + i).gameObject.SetActive(false);
                        Stars.transform.FindChild("Star" + i + "Ani").gameObject.SetActive(false);
                    }
                }
                Stars.GetComponent <Animation>().Play();
                //碎片
                //clear
                for (int i = 0; i < Fragments.Length; i++)
                {
                    Fragments[i].text = "0";
                }
                List <FragmentInfo> fragementResult = new List <FragmentInfo>();
                if (Obj_MyselfPlayer.GetMe().currentFragmentList != null)
                {
                    foreach (var fragment in Obj_MyselfPlayer.GetMe().currentFragmentList)
                    {
                        bool isFind = false;
                        for (int i = 0; i < fragementResult.Count; i++)
                        {
                            if (fragementResult[i].id == fragment.id)
                            {
                                isFind = true;
                                fragementResult[i].num += fragment.num;
                                break;
                            }
                        }
                        if (!isFind)
                        {
                            FragmentInfo newone = new FragmentInfo();
                            newone.id  = fragment.id;
                            newone.num = fragment.num;
                            fragementResult.Add(newone);
                        }
                    }
                }
                if (fragementResult != null)
                {
                    foreach (var fragment in fragementResult)
                    {
                        Fragments[fragment.id].text = fragment.num.ToString();
                    }
                }
            }
        }
        GameObject.FindWithTag("main_controller").SendMessage("updateUserInfo");
    }
 private void LoadItemPartsOrBodySummaries(IConversationTree conversationTree, ICollection <StoreObjectId> storeIds)
 {
     conversationTree.ExecuteSortedAction(ConversationTreeSortOrder.ChronologicalDescending, delegate(ConversationTreeSortOrder param0)
     {
         HashSet <StoreObjectId> hashSet = null;
         if (storeIds != null && storeIds.Any <StoreObjectId>())
         {
             hashSet = new HashSet <StoreObjectId>(storeIds);
         }
         this.RecursiveLoadBodyFragments(conversationTree, hashSet);
         foreach (IConversationTreeNode conversationTreeNode in conversationTree)
         {
             if (!this.treeNodeBodyFragment.ContainsKey(conversationTreeNode.MainStoreObjectId))
             {
                 for (int i = 0; i < conversationTreeNode.StorePropertyBags.Count; i++)
                 {
                     IStorePropertyBag storePropertyBag = conversationTreeNode.StorePropertyBags[i];
                     this.AddBodySummaryError(conversationTree, ref storePropertyBag);
                 }
             }
             else
             {
                 FragmentInfo fragmentInfo         = FragmentInfo.Empty;
                 FragmentInfo disclaimerFragment   = FragmentInfo.Empty;
                 BodyFragmentInfo bodyFragmentInfo = this.treeNodeBodyFragment[conversationTreeNode.MainStoreObjectId].Key;
                 fragmentInfo = bodyFragmentInfo;
                 if (conversationTreeNode.ParentNode.HasData && this.treeNodeBodyFragment.ContainsKey(conversationTreeNode.ParentNode.MainStoreObjectId))
                 {
                     BodyFragmentInfo key = this.treeNodeBodyFragment[conversationTreeNode.ParentNode.MainStoreObjectId].Key;
                     ExtractionData extractionData;
                     if (this.IsBodyPartPresent(bodyFragmentInfo, conversationTreeNode.ParentNode.StorePropertyBags[0], out extractionData))
                     {
                         fragmentInfo       = extractionData.ChildUniqueBody;
                         disclaimerFragment = extractionData.ChildDisclaimer;
                     }
                     else
                     {
                         BodyDiffer bodyDiffer = new BodyDiffer(bodyFragmentInfo, key);
                         fragmentInfo          = bodyDiffer.UniqueBodyPart;
                         disclaimerFragment    = bodyDiffer.DisclaimerPart;
                     }
                 }
                 for (int j = 0; j < conversationTreeNode.StorePropertyBags.Count; j++)
                 {
                     IStorePropertyBag storePropertyBag2 = conversationTreeNode.StorePropertyBags[j];
                     StoreObjectId objectId = ((VersionedId)storePropertyBag2.TryGetProperty(ItemSchema.Id)).ObjectId;
                     this.AddBodySummary(conversationTree, ref storePropertyBag2, fragmentInfo);
                     if (!conversationTreeNode.HasChildren)
                     {
                         this.OptimizationCounters.UpdateItemIsLeafNode(objectId);
                     }
                     if (!this.itemParts.ContainsKey(objectId))
                     {
                         ParticipantTable recipients;
                         List <Participant> replyToParticipants;
                         if (this.treeNodeBodyFragment[conversationTreeNode.MainStoreObjectId].Value && this.CanExtractItemPart(conversationTree, storePropertyBag2, out recipients, out replyToParticipants))
                         {
                             this.optimizationInfo.UpdateItemExtracted(objectId);
                             ItemPart itemPart = this.itemPartLoader.Create(objectId, storePropertyBag2, fragmentInfo, disclaimerFragment, recipients, replyToParticipants);
                             this.itemParts.Add(objectId, itemPart);
                             this.AddRecipientToRecipientDisplayNameCache(itemPart);
                         }
                         else if (hashSet != null && hashSet.Contains(objectId))
                         {
                             this.LoadItemPart(conversationTree, storePropertyBag2);
                             bodyFragmentInfo = this.loadedItemParts[objectId].BodyFragmentInfo;
                         }
                     }
                 }
             }
         }
     });
 }