Exemplo n.º 1
0
 private void Compare2Dic(Dictionary <int, LegendExtension> current, Dictionary <int, LegendExtension> old)
 {
     this.newDic.Clear();
     foreach (KeyValuePair <int, LegendExtension> keyValuePair in current)
     {
         LegendExtension value = keyValuePair.Value;
         int             key   = keyValuePair.Key;
         bool            flag  = old.ContainsKey(keyValuePair.Key);
         if (flag)
         {
             LegendExtension legendExtension = old[keyValuePair.Key];
             bool            flag2           = value.Name != legendExtension.Name;
             if (flag2)
             {
                 LegendExtension legendExtension2 = value;
                 legendExtension2.Name = legendExtension2.Name + "_[" + legendExtension.Name + "]";
                 value.MoreInfo        = 1;
             }
             this.newDic.Add(key, value);
         }
         else
         {
             value.MoreInfo = 2;
             this.newDic.Add(key, value);
         }
     }
     foreach (KeyValuePair <int, LegendExtension> keyValuePair2 in old)
     {
         int             key2   = keyValuePair2.Key;
         LegendExtension value2 = keyValuePair2.Value;
         bool            flag3  = !current.ContainsKey(key2);
         if (flag3)
         {
             value2.MoreInfo = 3;
             this.newDic.Add(key2, value2);
         }
     }
     this.DisplayToView(this.newDic);
 }
Exemplo n.º 2
0
        private void LoadData(Document doc)
        {
            this.Doc = doc;
            List <ViewSheet> list  = this.AllViewSheets(doc);
            List <View>      list2 = new List <View>();

            foreach (ViewSheet viewSheet in list)
            {
                List <View> list3 = this.AllLegendInSheet(viewSheet, doc);
                bool        flag  = list3.Count < 1;
                if (!flag)
                {
                    foreach (View view in list3)
                    {
                        bool flag2 = this.Dic.ContainsKey(view.Id.IntegerValue);
                        if (flag2)
                        {
                            string str = string.Concat(new string[]
                            {
                                "  + [",
                                viewSheet.SheetNumber,
                                "_",
                                viewSheet.Name,
                                "]"
                            });
                            LegendExtension legendExtension = this.Dic[view.Id.IntegerValue];
                            legendExtension.ListSheets += str;
                        }
                        else
                        {
                            LegendExtension        legendExtension2       = new LegendExtension();
                            WorksharingTooltipInfo worksharingTooltipInfo = WorksharingUtils.GetWorksharingTooltipInfo(doc, view.Id);
                            legendExtension2.Name          = view.Name;
                            legendExtension2.Id            = view.Id.IntegerValue;
                            legendExtension2.Creator       = worksharingTooltipInfo.Creator;
                            legendExtension2.LastChangedBy = worksharingTooltipInfo.LastChangedBy;
                            legendExtension2.ListSheets    = string.Concat(new string[]
                            {
                                "[",
                                viewSheet.SheetNumber,
                                "_",
                                viewSheet.Name,
                                "]"
                            });
                            list2.Add(view);
                            this.Dic.Add(view.Id.IntegerValue, legendExtension2);
                        }
                    }
                }
            }
            foreach (View view2 in this.AllLegends(doc))
            {
                foreach (View view3 in list2)
                {
                    bool flag3 = view2.Id.IntegerValue == view3.Id.IntegerValue;
                    if (!flag3)
                    {
                        bool flag4 = this.Dic.ContainsKey(view2.Id.IntegerValue);
                        if (!flag4)
                        {
                            LegendExtension        legendExtension3        = new LegendExtension();
                            WorksharingTooltipInfo worksharingTooltipInfo2 = WorksharingUtils.GetWorksharingTooltipInfo(doc, view2.Id);
                            legendExtension3.Name          = view2.Name;
                            legendExtension3.Id            = view2.Id.IntegerValue;
                            legendExtension3.Creator       = worksharingTooltipInfo2.Creator;
                            legendExtension3.LastChangedBy = worksharingTooltipInfo2.LastChangedBy;
                            legendExtension3.ListSheets    = "";
                            this.Dic.Add(view2.Id.IntegerValue, legendExtension3);
                        }
                    }
                }
            }
        }