Exemplo n.º 1
0
            private static void AssemblyEventHandlerAsyncCallBack(IAsyncResult ar)
            {
                AssemblyEventHandler aeh = ar.AsyncState as AssemblyEventHandler;

                if (aeh != null)
                {
                    aeh.EndInvoke(ar);
                }
            }
Exemplo n.º 2
0
 public TestRunAllCommand(ICommandTarget commandTarget)
    : base(commandTarget, "&Test", "&Run All", _menuPosition) {
    _onRecipeLoaded = new RecipeEventHandler(OnRecipeLoaded);
    _onRecipeClosing = new RecipeEventHandler(OnRecipeClosing);
    _onOtherRecipeEvent = new RecipeEventHandler(OnOtherRecipeEvent);
    _onAssemblyEvent = new AssemblyEventHandler(OnAssemblyEvent);
    
    Recipe.Loaded += _onRecipeLoaded;
    Recipe.Closing += _onRecipeClosing;
    HookupRecipe();
    UpdateEnabledStatus();
 }
Exemplo n.º 3
0
        public TestRunAllCommand(ICommandTarget commandTarget)
            : base(commandTarget, "&Test", "&Run All", _menuPosition)
        {
            _onRecipeLoaded     = new RecipeEventHandler(OnRecipeLoaded);
            _onRecipeClosing    = new RecipeEventHandler(OnRecipeClosing);
            _onOtherRecipeEvent = new RecipeEventHandler(OnOtherRecipeEvent);
            _onAssemblyEvent    = new AssemblyEventHandler(OnAssemblyEvent);

            Recipe.Loaded  += _onRecipeLoaded;
            Recipe.Closing += _onRecipeClosing;
            HookupRecipe();
            UpdateEnabledStatus();
        }
Exemplo n.º 4
0
        public bool AttachModelDocEventHandler(ModelDoc2 modDoc)
        {
            if (modDoc == null)
            {
                return(false);
            }

            DocumentEventHandler docHandler = null;

            if (!openDocs.Contains(modDoc))
            {
                switch (modDoc.GetType())
                {
                case (int)swDocumentTypes_e.swDocPART:
                {
                    docHandler = new PartEventHandler(modDoc, this);
                    break;
                }

                case (int)swDocumentTypes_e.swDocASSEMBLY:
                {
                    docHandler = new AssemblyEventHandler(modDoc, this);
                    break;
                }

                case (int)swDocumentTypes_e.swDocDRAWING:
                {
                    docHandler = new DrawingEventHandler(modDoc, this);
                    break;
                }

                default:
                {
                    return(false);        //Unsupported document type
                }
                }
                docHandler.AttachEventHandlers();
                openDocs.Add(modDoc, docHandler);
            }
            return(true);
        }
Exemplo n.º 5
0
        public bool AttachModelDocEventHandler(ModelDoc2 modDoc)
        {
            if (modDoc == null)
                return false;

            DocumentEventHandler docHandler = null;

            if (!openDocs.Contains(modDoc))
            {
                switch (modDoc.GetType())
                {
                    case (int)swDocumentTypes_e.swDocPART:
                        {
                            docHandler = new PartEventHandler(modDoc, this);
                            break;
                        }
                    case (int)swDocumentTypes_e.swDocASSEMBLY:
                        {
                            docHandler = new AssemblyEventHandler(modDoc, this);
                            break;
                        }
                    case (int)swDocumentTypes_e.swDocDRAWING:
                        {
                            docHandler = new DrawingEventHandler(modDoc, this);
                            break;
                        }
                    default:
                        {
                            return false; //Unsupported document type
                        }
                }
                docHandler.AttachEventHandlers();
                openDocs.Add(modDoc, docHandler);
            }
            return true;
        }