Exemple #1
0
 protected void Insert(params IDEEvent[] additionalEvents)
 {
     foreach (var ideEvent in additionalEvents)
     {
         _answer.Add(ideEvent);
     }
 }
        public void Run()
        {
            _upes = Lists.NewList <IUserProfileEvent>();
            var users = Sets.NewHashSet <string>();

            _keys = Sets.NewHashSet <string>();
            _assignableSubmissions = Sets.NewHashSet <string>();

            var zips = _io.FindCcZips().ToList();

            var cur   = 1;
            var total = zips.Count;

            foreach (var zipName in zips)
            {
                _printer.StartZip(zipName, cur++, total);

                var userKey = GetUserKey(zipName);
                users.Add(userKey);
                _printer.FoundUserKey(userKey);

                var zipKeys = GetKeysFrom(zipName);
                _printer.FoundKeysInZip(zipKeys);
                foreach (var key in zipKeys)
                {
                    var combKey = string.Format("{0}\t{1}", key, userKey);
                    _keys.Add(combKey);
                }
            }

            _printer.FoundUsers(users);
            _printer.FoundKeys(_keys);
            _printer.FoundUpes(_upes);
            _printer.FoundAssignableZips(_assignableSubmissions);
        }
Exemple #3
0
        /// <summary>
        ///     Formats and appends a type name together with its generic types to the context.
        /// </summary>
        /// <param name="typeName">The type name to append.</param>
        /// <returns>The context after appending.</returns>
        public SSTPrintingContext Type(ITypeName typeName)
        {
            if (typeName.IsDelegateType)
            {
                return(Type(typeName.AsDelegateTypeName.DelegateType));
            }

            if (typeName.IsTypeParameter)
            {
                var tpn = typeName.AsTypeParameterName;
                if (tpn.IsBound)
                {
                    return(Type(tpn.TypeParameterType));
                }
                return(TypeNameOnly(tpn));
            }

            _seenNamespaces.Add(typeName.Namespace);

            TypeNameOnly(typeName);

            if (typeName.HasTypeParameters)
            {
                TypeParameters(typeName.TypeParameters);
            }

            return(this);
        }
        private string GetUserKey(string zipName)
        {
            var upe = _io.TryGetUserProfile(zipName);

            if (upe == null)
            {
                return("AUTO_" + zipName);
            }
            _upes.Add(upe);
            _assignableSubmissions.Add(zipName);
            return(upe.ProfileId);
        }
        private IKaVESet <string> GetKeysFrom(string zipName)
        {
            IKaVESet <string> keys = Sets.NewHashSet <string>();

            foreach (var cce in _io.ReadCce(zipName))
            {
                var date    = cce.TriggeredAt ?? DateTime.MinValue;
                var dateStr = string.Format("{0:0000}{1:00}{2:00}", date.Year, date.Month, date.Day);
                keys.Add(dateStr);
            }

            return(keys);
        }
 public void StoreMergedZip([NotNull] string zip)
 {
     lock (_lock)
     {
         Asserts.NotNull(_zipGroups);
         Asserts.NotNull(zip);
         Asserts.That(_allZips.Contains(zip));
         Asserts.Not(_uncleansedZips.Contains(zip));
         foreach (var zipGroup in _zipGroups)
         {
             Asserts.Not(zipGroup.Contains(zip));
         }
         _uncleansedZips.Add(zip);
     }
 }
Exemple #7
0
        public bool ShouldProcessOrRegister(IMethodName m)
        {
            if (_dupeSetting == Duplication.Include)
            {
                return(true);
            }

            lock (_seenMethods)
            {
                if (_seenMethods.Contains(m))
                {
                    return(false);
                }
                _seenMethods.Add(m);
                return(true);
            }
        }
Exemple #8
0
        public bool ShouldProcessOrRegister(ISST td)
        {
            if (IsGenerated(td) && _genCodeSetting == GeneratedCode.Exclude)
            {
                return(false);
            }

            if (td.IsPartialClass)
            {
                return(true);
            }

            lock (_seenTypes)
            {
                if (_seenTypes.Contains(td.EnclosingType))
                {
                    return(_dupeSetting == Duplication.Include);
                }
                _seenTypes.Add(td.EnclosingType);
                return(true);
            }
        }
Exemple #9
0
        protected override void AnalyzePrimaryPsiModule(IPsiModule primaryPsiModule)
        {
            var psiServices     = primaryPsiModule.GetPsiServices();
            var symbolScope     = psiServices.Symbols.GetSymbolScope(primaryPsiModule, true, true);
            var globalNamespace = symbolScope.GlobalNamespace;

            foreach (var te in FindTypeElements(globalNamespace, symbolScope))
            {
                // ignore private and internal types
                if (!te.CanBeVisibleToSolution())
                {
                    continue;
                }

                // ignore types defined in solution
                if (!IsDefinedInDependency(te))
                {
                    continue;
                }

                // ignore types that are already processed
                var clrName = te.GetClrName().FullName;
                if (!_seenClrNames.Add(clrName))
                {
                    continue;
                }

                // see http://stackoverflow.com/questions/4603139/a-c-sharp-class-with-a-null-namespace
                var isMetaDataClass = "FXAssembly".Equals(clrName) || "ThisAssembly".Equals(clrName) ||
                                      "AssemblyRef".Equals(clrName);
                if (isMetaDataClass)
                {
                    continue;
                }

                // ignore private
                if (clrName.StartsWith("<PrivateImplementationDetails>"))
                {
                    continue;
                }

                // ignore c++ impl details
                if (clrName.StartsWith("<CppImplementationDetails>"))
                {
                    continue;
                }

                // ignore crt impl details
                if (clrName.StartsWith("<CrtImplementationDetails>"))
                {
                    continue;
                }

                // ignore anonymous
                if (clrName.StartsWith("<>"))
                {
                    continue;
                }

                // ignore gcroots
                if (clrName.StartsWith("gcroot<"))
                {
                    continue;
                }

                // ignore global module
                if (clrName.Equals("<Module>"))
                {
                    continue;
                }

                // ignore unnnamed type values
                if (clrName.Contains("<unnamed-type-value>"))
                {
                    continue;
                }

                // ignore anonymous
                if (clrName.StartsWith("<"))
                {
                    Console.WriteLine("Inspect: " + clrName);
                }

                Execute.WithExceptionCallback(
                    () =>
                {
                    var ts = AnalyzeTypeElement(te);
                    _cbTypeShape(ts);
                },
                    e =>
                {
                    Console.WriteLine("error: " + e.Message);
                    Console.WriteLine(te);
                });
            }
        }
 public override void Visit(IMethodReference methodRef, IKaVESet <IName> context)
 {
     context.Add(methodRef.MethodName);
     base.Visit(methodRef, context);
 }
 public override void Visit(IEventReference eventRef, IKaVESet <IName> context)
 {
     context.Add(eventRef.EventName);
     base.Visit(eventRef, context);
 }
Exemple #12
0
 private void OnAnyEvent(IDEEvent @event)
 {
     _currentDeveloperDays.Add(@event.GetTriggerDate());
 }
 public override void Visit(IPropertyReference propertyRef, IKaVESet <IName> context)
 {
     context.Add(propertyRef.PropertyName);
     base.Visit(propertyRef, context);
 }
 public override void Visit(IVariableDeclaration stmt, IKaVESet <IName> context)
 {
     context.Add(stmt.Type);
     base.Visit(stmt, context);
 }
 public override void Visit(IMethodDeclaration stmt, IKaVESet <IName> context)
 {
     context.Add(stmt.Name);
     base.Visit(stmt, context);
 }
 public override void Visit(IFieldReference fieldRef, IKaVESet <IName> context)
 {
     context.Add(fieldRef.FieldName);
     base.Visit(fieldRef, context);
 }
 public override void Visit(IInvocationExpression entity, IKaVESet <IName> context)
 {
     context.Add(entity.MethodName);
     base.Visit(entity, context);
 }
 public override void Visit(ILambdaExpression expr, IKaVESet <IName> context)
 {
     context.Add(expr.Name);
     base.Visit(expr, context);
 }