Пример #1
0
        internal static DxfScale smethod_4(DxfLayer layer, out DxfLayer oldLayer)
        {
            oldLayer = (DxfLayer)null;
            if (layer.ExtensionDictionary == null)
            {
                return((DxfScale)null);
            }
            IDictionaryEntry first = layer.ExtensionDictionary.Entries.GetFirst("ASDK_XREC_ANNO_SCALE_INFO");

            if (first == null)
            {
                return((DxfScale)null);
            }
            DxfXRecord dxfXrecord = first.Value as DxfXRecord;

            if (dxfXrecord == null)
            {
                return((DxfScale)null);
            }
            if (dxfXrecord.Values.Count < 2)
            {
                return((DxfScale)null);
            }
            DxfScale dxfScale = dxfXrecord.Values[1].Value as DxfScale;

            if (dxfXrecord.Values.Count > 2)
            {
                oldLayer = dxfXrecord.Values[2].Value as DxfLayer;
            }
            return(dxfScale);
        }
Пример #2
0
 public void CopyTo(KeyValuePair <string, T>[] array, int arrayIndex)
 {
     for (int index = 0; index < this.dxfDictionaryEntryCollection_0.Count; ++index)
     {
         IDictionaryEntry dictionaryEntry = this.dxfDictionaryEntryCollection_0[index];
         array[arrayIndex++] = new KeyValuePair <string, T>(dictionaryEntry.Name, (T)dictionaryEntry.Value);
     }
 }
Пример #3
0
 private void method_13(object sender, int index, IDictionaryEntry item)
 {
     if (item == null)
     {
         return;
     }
     item.Dictionary = (DxfDictionary)null;
     this.method_11(item);
 }
Пример #4
0
 private void method_12(object sender, int index, IDictionaryEntry item)
 {
     if (item == null)
     {
         return;
     }
     item.Dictionary = this;
     this.method_10(item, true);
 }
Пример #5
0
 internal void method_11(IDictionaryEntry item)
 {
     if (item.Value == null)
     {
         return;
     }
     item.Value.vmethod_2((IDxfHandledObject)null);
     item.Value.RemovePersistentReactor((DxfHandledObject)this);
 }
Пример #6
0
 public bool Contains(KeyValuePair <string, T> item)
 {
     for (int index = 0; index < this.dxfDictionaryEntryCollection_0.Count; ++index)
     {
         IDictionaryEntry dictionaryEntry = this.dxfDictionaryEntryCollection_0[index];
         if (dictionaryEntry.Value == (object)item.Value && string.Compare(dictionaryEntry.Name, item.Key, StringComparison.InvariantCultureIgnoreCase) == 0)
         {
             return(true);
         }
     }
     return(false);
 }
Пример #7
0
 internal void method_10(IDictionaryEntry item, bool addPersistentReactor)
 {
     if (item.Value == null)
     {
         return;
     }
     item.Value.vmethod_2((IDxfHandledObject)this);
     if (!addPersistentReactor)
     {
         return;
     }
     item.Value.AddPersistentReactor((DxfHandledObject)this);
 }
        public void Get_DictioryItemKeyValue()
        {
            //Arrange
            IDictionarySettings dictionarySettings = Substitute.For <IDictionarySettings>();
            IDictionaryEntry    dictionaryEntry    = Substitute.For <IDictionaryEntry>();

            _testHarness.SitecoreService.GetItem <IDictionarySettings>(Arg.Any <string>()).Returns(dictionarySettings);
            _testHarness.SitecoreService.GetItem <IDictionaryEntry>(Arg.Any <string>()).Returns(dictionaryEntry);

            //Act
            var result = _testHarness.DictionaryPhraseRepository.Get("/blog/LeaveComment", "Hello");

            //Arrange
            result.Should().Equals("Hello");
        }
Пример #9
0
 private void method_14(
     object sender,
     int index,
     IDictionaryEntry oldItem,
     IDictionaryEntry newItem)
 {
     if (oldItem != null)
     {
         oldItem.Dictionary = (DxfDictionary)null;
         this.method_11(oldItem);
     }
     if (newItem == null)
     {
         return;
     }
     newItem.Dictionary = this;
     this.method_10(newItem, true);
 }
Пример #10
0
        public override void ResolveReferences(Class374 modelBuilder)
        {
            base.ResolveReferences(modelBuilder);
            foreach (Class567 class567 in this.list_1)
            {
                class567.ResolveReferences(modelBuilder);
            }
            bool          flag = false;
            DxfDictionary extensionDictionary = this.dxfTableStyle_0.ExtensionDictionary;

            if (extensionDictionary != null && extensionDictionary.Entries.Count > 0)
            {
                IDictionaryEntry first = extensionDictionary.Entries.GetFirst("ACAD_ROUNDTRIP_2008_TABLESTYLE_CELLSTYLEMAP");
                if (first != null)
                {
                    DxfCellStyleMap key = first.Value as DxfCellStyleMap;
                    Class264        class264;
                    if (key != null && modelBuilder.CellStyleMapBuilders.TryGetValue(key, out class264))
                    {
                        class264.ResolveReferences(modelBuilder, this.dxfTableStyle_0);
                        flag = true;
                    }
                }
            }
            if (flag)
            {
                return;
            }
            if (this.dxfTableStyle_0.DataCellStyle == null && this.list_1.Count > 0)
            {
                DxfTableCellStyle cellStyle = this.list_1[0].CellStyle;
                if (string.IsNullOrEmpty(cellStyle.Name))
                {
                    cellStyle.Name = "_DATA";
                }
                this.dxfTableStyle_0.method_8(cellStyle);
            }
            if (this.dxfTableStyle_0.TitleCellStyle == null && this.list_1.Count > 1)
            {
                DxfTableCellStyle cellStyle = this.list_1[1].CellStyle;
                if (string.IsNullOrEmpty(cellStyle.Name))
                {
                    cellStyle.Name = "_TITLE";
                }
                this.dxfTableStyle_0.method_10(cellStyle);
            }
            if (this.dxfTableStyle_0.HeaderCellStyle == null && this.list_1.Count > 2)
            {
                DxfTableCellStyle cellStyle = this.list_1[2].CellStyle;
                if (string.IsNullOrEmpty(cellStyle.Name))
                {
                    cellStyle.Name = "_HEADER";
                }
                this.dxfTableStyle_0.method_9(cellStyle);
            }
            foreach (Class567 class567 in this.list_1)
            {
                if (class567.CellStyle != this.dxfTableStyle_0.TableCellStyle)
                {
                    DxfTableCellStyle cellStyle = class567.CellStyle;
                    DxfTableCellStyle dxfTableCellStyle;
                    if (this.dxfTableStyle_0.CellStyles.TryGetValue(cellStyle.Name, out dxfTableCellStyle))
                    {
                        this.dxfTableStyle_0.CellStyles[this.dxfTableStyle_0.CellStyles.IndexOf(dxfTableCellStyle)] = cellStyle;
                    }
                    else
                    {
                        this.dxfTableStyle_0.CellStyles.Add(cellStyle);
                    }
                }
            }
        }