public void Get_description()
        {
            var target   = new PrototypeTarget("Jeremy");
            var instance = new PrototypeInstance(target);

            TestUtility.AssertDescriptionIs(instance, "Prototype of " + target);
        }
        public void Build_a_clone()
        {
            var target   = new PrototypeTarget("Jeremy");
            var instance = new PrototypeInstance(target);

            object returnedValue = instance.Build(typeof(PrototypeTarget), new StubBuildSession());

            Assert.AreEqual(target, returnedValue);
            Assert.AreNotSame(target, returnedValue);
        }
        public void Can_be_part_of_PluginFamily()
        {
            var target   = new PrototypeTarget("Jeremy");
            var instance = new PrototypeInstance(target);
            IDiagnosticInstance diagnosticInstance = instance;

            var family1 = new PluginFamily(typeof(PrototypeTarget));

            Assert.IsTrue(diagnosticInstance.CanBePartOfPluginFamily(family1));

            var family2 = new PluginFamily(GetType());

            Assert.IsFalse(diagnosticInstance.CanBePartOfPluginFamily(family2));
        }
示例#4
0
 public void _0002()
 {
     //Discarded unreachable code: IL_0002
     //IL_0003: Incompatible stack heights: 0 vs 1
     if (!itemList)
     {
         return;
     }
     itemList = false;
     FacadePropertyStruct.VisitDic(QueueBroadcasterFilter.GetDic(m_FieldList), "waveInStop");
     for (int i = 0; i < _RegList.Length; i++)
     {
         int num = (i + proccesorList + 1) % _RegList.Length;
         PrototypeInstance prototypeInstance = _RegList[num];
         if (prototypeInstance._0001())
         {
             AwakeDic(prototypeInstance);
         }
     }
     UpdateDic(null);
 }
示例#5
0
 private void PrepareDic(IntPtr config, QueueBroadcasterFilter.BufferLoadResult selection, IntPtr serv, ServerErrorFilter connection2, IntPtr attr3)
 {
     //Discarded unreachable code: IL_0002
     //IL_0003: Incompatible stack heights: 0 vs 1
     if (selection == (QueueBroadcasterFilter.BufferLoadResult) 960 && itemList)
     {
         PrototypeInstance prototypeInstance = (PrototypeInstance)((GCHandle)connection2._RuleList).Target;
         if (prototypeInstance != null)
         {
             proccesorList = Array.IndexOf(_RegList, prototypeInstance);
             AwakeDic(prototypeInstance);
             try
             {
                 prototypeInstance.VerifyError();
             }
             catch (Exception asset)
             {
                 itemList = false;
                 UpdateDic(asset);
             }
         }
     }
 }
示例#6
0
        protected internal override IEnumerator <KeyValuePair <string, JSValue> > GetEnumerator(bool hideNonEnumerable, EnumerationMode enumerationMode)
        {
            if (_members == null)
            {
                fillMembers();
            }

            if (PrototypeInstance != null)
            {
                var @enum = PrototypeInstance.GetEnumerator(hideNonEnumerable, enumerationMode);
                while (@enum.MoveNext())
                {
                    yield return(@enum.Current);
                }
            }
            else
            {
                foreach (var f in _fields)
                {
                    if (!hideNonEnumerable || (f.Value._attributes & JSValueAttributesInternal.DoNotEnumerate) == 0)
                    {
                        yield return(f);
                    }
                }
            }

            foreach (var item in _members)
            {
                if (_fields.ContainsKey(item.Key))
                {
                    continue;
                }
                for (var i = item.Value.Count; i-- > 0;)
                {
                    if (item.Value[i].IsDefined(typeof(HiddenAttribute), false))
                    {
                        continue;
                    }

                    if (!hideNonEnumerable || !item.Value[i].IsDefined(typeof(DoNotEnumerateAttribute), false))
                    {
                        switch (enumerationMode)
                        {
                        case EnumerationMode.KeysOnly:
                        {
                            yield return(new KeyValuePair <string, JSValue>(item.Key, null));

                            break;
                        }

                        case EnumerationMode.RequireValues:
                        case EnumerationMode.RequireValuesForWrite:
                        {
                            yield return(new KeyValuePair <string, JSValue>(
                                             item.Key,
                                             _fields[item.Key] = proxyMember(enumerationMode == EnumerationMode.RequireValuesForWrite, item.Value)));

                            break;
                        }
                        }
                        break;
                    }
                }
            }
        }
示例#7
0
 private void AwakeDic(PrototypeInstance setup)
 {
     //Discarded unreachable code: IL_0002
     //IL_0003: Incompatible stack heights: 0 vs 1
     adapterList?.Invoke(this, new TemplateList(setup._0001(), setup._0001()));
 }