Exemple #1
0
        private void GetAllMapTypesCompleted(object sender, Service.GetAllMapTypesCompletedEventArgs eventArgs)
        {
            if (eventArgs.Error == null)
            {
                ServiceProxy.GetAllMapTypesCompleted -= GetAllMapTypesCompleted;

                TypeManager.AddNodeTypes(eventArgs.Result.NodeTypes.Values);
                TypeManager.AddRelationshipTypes(eventArgs.Result.RelationshipTypes.Values);
                TypeManager.AddConnectionTypes(eventArgs.Result.DescriptorTypes.Values);
                TypeManager.AddMetadataTypes(eventArgs.Result.MetadataTypes.Values);

                IsMapTypesLoaded = true;

                InitialiseMapManagerEventArgs initialisationEventArgs = new InitialiseMapManagerEventArgs(true);

                InitialiseMapManagerCompleted(this, initialisationEventArgs);
            }
            else
            {
                InitialiseMapManagerEventArgs initialisationEventArgs = new InitialiseMapManagerEventArgs(false);

                string errorMsg = eventArgs.Error.ToString();
                if (eventArgs.Error.InnerException != null)
                {
                    //strip off the TargetInvocationException that wraps the real exception
                    errorMsg = eventArgs.Error.InnerException.ToString();
                }
                initialisationEventArgs.ErrorMessage = errorMsg;
                InitialiseMapManagerCompleted(this, initialisationEventArgs);
            }
        }
Exemple #2
0
        private void GetAllMapTypesCompleted(object sender, Service.GetAllMapTypesCompletedEventArgs eventArgs)
        {
            ServiceProxy.GetAllMapTypesCompleted -= GetAllMapTypesCompleted;

            TypeManager.AddNodeTypes(eventArgs.Result.NodeTypes.Values);
            TypeManager.AddRelationshipTypes(eventArgs.Result.RelationshipTypes.Values);
            TypeManager.AddConnectionTypes(eventArgs.Result.DescriptorTypes.Values);
            TypeManager.AddMetadataTypes(eventArgs.Result.MetadataTypes.Values);

            IsMapTypesLoaded = true;

            Proxy.InitialiseMapManagerEventArgs initialisationEventArgs = new Proxy.InitialiseMapManagerEventArgs(true);

            InitialiseMapManagerCompleted(this, initialisationEventArgs);
        }