Пример #1
0
        public void Initialize(MgaProject project)
        {
            try
            {
                Configuration = MetaLinkConfiguration.Create(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "metalink.config"));
            }
            catch (Exception e)
            {
                GMEConsole.Warning.WriteLine("Unable to read Meta-Link configuration: " + e.Message);
                Configuration = new MetaLinkConfiguration();
            }

            // Creating addon
            project.CreateAddOn(this, out addon);

            // Setting event mask (see ComponentConfig.eventMask)
            unchecked
            {
                addon.EventMask = (uint)ComponentConfig_Addon.eventMask;
            }
            // DISABLE BY DEFAULT
            Enable(false);

            // Create the proxy windows control which sends-receives messages
            this.SyncControl = new System.Windows.Forms.Control();
            IntPtr handle = SyncControl.Handle; // If the handle has not yet been created, referencing this property will force the handle to be created.
        }
Пример #2
0
        public void Initialize(MgaProject project)
        {
            try
            {
                Configuration = MetaLinkConfiguration.Create(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "metalink.config"));
            }
            catch (Exception e)
            {
                GMEConsole.Warning.WriteLine("Unable to read Meta-Link configuration: " + e.Message);
                Configuration = new MetaLinkConfiguration();
            }

            // Creating addon 
            project.CreateAddOn(this, out addon);

            // Setting event mask (see ComponentConfig.eventMask)
            unchecked
            {
                addon.EventMask = (uint)ComponentConfig_Addon.eventMask;
            }
            // DISABLE BY DEFAULT
            Enable(false);

            // Create the proxy windows control which sends-receives messages
            this.SyncControl = new System.Windows.Forms.Control();
            IntPtr handle = SyncControl.Handle; // If the handle has not yet been created, referencing this property will force the handle to be created.
        }
Пример #3
0
        public void Initialize(MgaProject p)
        {
            // Creating addon
            p.CreateAddOn(this, out addon);
            // Setting event mask (see ComponentConfig.eventMask)
            unchecked
            {
                addon.EventMask = (uint)ComponentConfig.eventMask;
            }
            this.project = p;
            if (metaPath == null)
            {
                metaPath = Path.Combine(META.VersionInfo.MetaPath, "meta");
            }

            if (!Directory.Exists(metaPath))
            {
                throw new ApplicationException(metaPath + " doesn't exist");
            }
            //qudtTimer = new LibraryTimer("QudtTimer", new TimerLogicDelegate(QudtTimerHandler), project, control);
            //portLibTimer = new LibraryTimer("PortLibTimer", new TimerLogicDelegate(PortLibTimerHandler), project, control);
            QudtLibraryInfo        = new LibraryInfo("CyPhyMLQudt", "UnitLibrary QUDT", new Action(QudtTimerHandler), project, control);
            PortLibraryInfo        = new LibraryInfo("CyPhy_PortLib", "PortLibrary CyPhy_PortLib", new Action(PortLibTimerHandler), project, control);
            MaterialLibraryInfo    = new LibraryInfo("CyPhy_MaterialLib", "MaterialLibrary CyPhy_MaterialLib", new Action(MaterialLibTimerHandler), project, control);
            CADResourceLibraryInfo = new LibraryInfo("CyPhy_CADResourceLib", "CADResourceLibrary", new Action(CADResourceLibTimerHandler), project, control);
        }
        public void Initialize(MgaProject project)
        {
            // Creating addon
            project.CreateAddOn(this, out addon);
            this.project = project;
            // Setting event mask (see ComponentConfig.eventMask)
            unchecked
            {
                addon.EventMask = (uint)ComponentConfig.eventMask;
            }
            if (hiddenWindow == null)
            {
                hiddenWindow = new System.Windows.Forms.Control();
                IntPtr handle = hiddenWindow.Handle; // If the handle has not yet been created, referencing this property will force the handle to be created.
            }

            new Thread(() =>
            {
                while (!getGMEConsole())
                {
                    Thread.Sleep(100);
                }
                GMEConsole.Info.Write(String.Format("Loaded Addon: {0}", ComponentProgID));
            }).Start();
        }
Пример #5
0
 public void Initialize(MgaProject p)
 {
     // Creating addon
     p.CreateAddOn(this, out addon);
     // Setting event mask (see ComponentConfig.eventMask)
     unchecked
     {
         addon.EventMask = (uint)ComponentConfig.eventMask;
     }
 }
Пример #6
0
        public void Initialize(MgaProject project)
        {
            // Creating addon
            project.CreateAddOn(this, out addon);
            // Setting event mask (see ComponentConfig.eventMask)
            unchecked
            {
                addon.EventMask = (uint)ComponentConfig.eventMask;
            }

            if (Logger == null)
            {
                Logger = new CyPhyGUIs.GMELogger(project, this.ComponentName);
            }
            GetMetaRefs(project);
        }
Пример #7
0
        public void InvokeEx(MgaProject project, MgaFCO currentobj, MgaFCOs selectedobjs, int param)
        {
            if (!enabled)
            {
                return;
            }

            try
            {
                this.project = project;
                GMEConsole   = GMEConsole.CreateFromProject(project);
                MgaGateway   = new MgaGateway(project);

                project.CreateAddOn(this, out addon);
                // addOn->put_EventMask(OBJEVENT_ATTR | OBJEVENT_CONNECTED));

                MgaGateway.PerformInTransaction(delegate
                {
                    component = Main(project, currentobj, selectedobjs, Convert(param));
                });

                if (GMEConsole.gme != null && component != null)
                {
                    GMEConsole.gme.ShowFCO(component, false);
                }
            }
            finally
            {
                MgaGateway   = null;
                project      = null;
                currentobj   = null;
                selectedobjs = null;
                // GMEConsole = null;
                GC.Collect();
                GC.WaitForPendingFinalizers();
            }
        }
 public void Initialize(MgaProject p)
 {
     // Creating addon
     p.CreateAddOn(this, out addon);
     // Setting event mask (see ComponentConfig.eventMask)
     unchecked
     {
         addon.EventMask = (uint)ComponentConfig.eventMask;
     }
 }
        public void Initialize(MgaProject p)
        {
            // Creating addon
            p.CreateAddOn(this, out addon);
            // Setting event mask (see ComponentConfig.eventMask)
            unchecked
            {
                addon.EventMask = (uint)ComponentConfig.eventMask;
            }
            this.project = p;
            if (metaPath == null)
            {
                metaPath = Path.Combine(META.VersionInfo.MetaPath, "meta");
            }

            if (!Directory.Exists(metaPath))
            {
                throw new ApplicationException(metaPath + " doesn't exist");
            }
            //qudtTimer = new LibraryTimer("QudtTimer", new TimerLogicDelegate(QudtTimerHandler), project, control);
            //portLibTimer = new LibraryTimer("PortLibTimer", new TimerLogicDelegate(PortLibTimerHandler), project, control);
            QudtLibraryInfo = new LibraryInfo("CyPhyMLQudt", "UnitLibrary QUDT", new Action(QudtTimerHandler), project, control);
            PortLibraryInfo = new LibraryInfo("CyPhy_PortLib", "PortLibrary CyPhy_PortLib", new Action(PortLibTimerHandler), project, control);
            MaterialLibraryInfo = new LibraryInfo("CyPhy_MaterialLib", "MaterialLibrary CyPhy_MaterialLib", new Action(MaterialLibTimerHandler), project, control);
            CADResourceLibraryInfo = new LibraryInfo("CyPhy_CADResourceLib", "CADResourceLibrary", new Action(CADResourceLibTimerHandler), project, control);
        }
        public void Initialize(MgaProject project)
        {
            // Creating addon
            project.CreateAddOn(this, out addon);
            // Setting event mask (see ComponentConfig.eventMask)
            unchecked
            {
                addon.EventMask = (uint)ComponentConfig.eventMask;
            }

            if (Logger == null)
            {
                Logger = new CyPhyGUIs.GMELogger(project, this.ComponentName);
            }
            GetMetaRefs(project);
        }