Beispiel #1
0
 //tell plugins to pack their states into a dictionary to pass to other plugins
 public void RaiseBroadcastRequest(object sender, IDictionary<string, object> dictPackedPlugin)
 {
     if (BroadcastState != null) //has some method been told to handle this event?
     {
         BroadCastEventArgs e = new BroadCastEventArgs(sender, dictPackedPlugin);
         BroadcastState(sender, e);
     }
 }
Beispiel #2
0
        //listen to plugin's broadcast in order to update other plugins
        private void BroadcastStateListener(object sender, VBCommon.PluginSupport.BroadCastEventArgs e)
        {
            string strPluginType = (((IPlugin)sender).PluginType).ToString();

            //if datasheet is broadcasting any changes
            if (strPluginType == "Datasheet")
            {
                //find modeling plugin, needs to show itself once datasheet broadcasts itself with complete flag raised
                foreach (DotSpatial.Extensions.IExtension ex in App.Extensions)
                {
                    IPlugin plugin = (IPlugin)ex;

                    if (plugin.PluginType.ToString() == "Modeling")
                    {
                        //already visible, just update not show again
                        if (plugin.VisiblePlugin)
                        {
                            return;
                        }
                        //if datasheet is complete, show modeling
                        else if (((IPlugin)sender).Complete)
                        {
                            plugin.Show();
                        }
                    }
                }
                //if modeling is broadcasting itself
            }
            else if (strPluginType == "Modeling")
            {
                //find prediction plugin, needs to show itself once modeling broadcasts itself with complete flag raised
                foreach (DotSpatial.Extensions.IExtension ex in App.Extensions)
                {
                    IPlugin plugin = (IPlugin)ex;
                    if (plugin.PluginType.ToString() == "Prediction")
                    {
                        //already visible, just update not show again
                        if (plugin.VisiblePlugin)
                        {
                            return;
                        }
                        else
                        //modeling is complete, show prediction
                        if (((IPlugin)sender).Complete)
                        {
                            plugin.Show();
                        }
                    }
                }
            }
        }
Beispiel #3
0
 private void BroadcastStateListener(object sender, BroadCastEventArgs e)
 {
     //listen to others broadcast..receiving something
     //e.PackedPluginState
 }