Click here to Skip to main content
15,888,320 members
Home / Discussions / C#
   

C#

 
AnswerRe: Disabling a button on one form from another. Pin
DaveyM6914-Aug-09 0:53
professionalDaveyM6914-Aug-09 0:53 
AnswerRe: Disabling a button on one form from another. Pin
DaveyM6914-Aug-09 1:00
professionalDaveyM6914-Aug-09 1:00 
GeneralRe: Disabling a button on one form from another. Pin
False Chicken14-Aug-09 1:06
False Chicken14-Aug-09 1:06 
AnswerRe: Disabling a button on one form from another. Pin
Hristo-Bojilov14-Aug-09 1:08
Hristo-Bojilov14-Aug-09 1:08 
GeneralRe: Disabling a button on one form from another. Pin
False Chicken14-Aug-09 1:15
False Chicken14-Aug-09 1:15 
GeneralRe: Disabling a button on one form from another. Pin
DaveyM6914-Aug-09 1:39
professionalDaveyM6914-Aug-09 1:39 
GeneralRe: Disabling a button on one form from another. Pin
Hristo-Bojilov14-Aug-09 2:01
Hristo-Bojilov14-Aug-09 2:01 
QuestionDelegateSerializationHolder is not permitted to be deserialized at this security level Pin
Nigel Mackay14-Aug-09 0:08
Nigel Mackay14-Aug-09 0:08 
I'm not sure how much code you need to see to handle this problem.
I am trying to add the ability for any logged-on client to send a message to all other logged-on clients.
My server code looks like this:
public OedipusServer
{
   // Register our tcp channel
   bool ensureSecurity = true;
   RemotingConfiguration.Configure("oedipus.exe.config", ensureSecurity);
   
   UserList insUserList = UserList.Instance;
   ObjRef refUserList = RemotingServices.Marshal(insUserList, "UserList");
   ...  //  More classes instanced here
   ServerClass insServerClass = ServerClass.Instance;
   ObjRef refAServerClass = RemotingServices.Marshal(insServerClass, "Messaging");
}
public class ServerClass : AbstractServer
{
   private static ServerClass mInstance = null;
   public static ServerClass Instance
   {
      get
      {
         if (mInstance == null)
            mInstance = new ServerClass();
         return mInstance;
      }
   }
   public override Object InitializeLifetimeService()
   {
      return null;
   }
   public override void myStatusHasChanged(int userID, int newStatus)
   {
      FireNewBroadcastedMessageEvent(userID, newStatus);
   }
   public event StatusChangedEventHandler myStatusChangedHandler;
   public override event StatusChangedEventHandler myStatusChangedEvent
   {
     add
     {
        myStatusChangedHandler = value;
     }
     remove
     {
     }
   }
   protected void FireNewBroadcastedMessageEvent(int userID, int newStatus)
   {
      myStatusChangedHandler(userID, newStatus);
   }
}

I have another project, Messaging, which looks like this:
public delegate void StatusChangedEventHandler(int userID, int newStatus);
public abstract class AbstractServer : MarshalByRefObject
{
   public abstract void myStatusHasChanged(int userID, int newStatus);
   public abstract event StatusChangedEventHandler myStatusChangedEvent;
}
public abstract class AbstractBroadcastedMessageEventSink : MarshalByRefObject
{
   public void callbackStatusChanged(int userID, int newStatus)
   {
      internalCallbackStatusChanged(userID, newStatus);
   }
   protected abstract void internalCallbackStatusChanged(int userID, int newStatus);
}

On the client side I have:
class EventSink : AbstractBroadcastedMessageEventSink
{
   protected override void internalCallbackStatusChanged(int userID, int newStatus)
   {
      //  Handle event here
   }
}
private AbstractServer rmMessaging;
public Office()
{
   rmMessaging = (AbstractServer)Activator.GetObject
                 (typeof(AbstractServer),
                 System.Configuration.ConfigurationManager.AppSettings
                 ["AbstractServerUrl"]);
   EventSink sinkStatusChanged = new EventSink();
   //  Subscribe to event
   rmMessaging.myStatusChangedEvent += 
         new StatusChangedEventHandler(sinkStatusChanged.callbackStatusChanged);
}
private void button1_Click(object sender, EventArgs e)
{
   // Initiate the event
   rmMessaging.myStatusHasChanged(23, 14);
}

It's subscribing to the event which raises the runtime error "DelegateSerializationHolder is not permitted to be deserialized at this security level".
AnswerRe: DelegateSerializationHolder is not permitted to be deserialized at this security level Pin
Hristo-Bojilov14-Aug-09 7:46
Hristo-Bojilov14-Aug-09 7:46 
GeneralRe: DelegateSerializationHolder is not permitted to be deserialized at this security level Pin
Nigel Mackay14-Aug-09 21:27
Nigel Mackay14-Aug-09 21:27 
Question'Mirror' ListView control Pin
kanchoette13-Aug-09 23:48
kanchoette13-Aug-09 23:48 
AnswerRe: 'Mirror' ListView control Pin
musefan14-Aug-09 2:33
musefan14-Aug-09 2:33 
QuestionCatching an Exception Pin
stancrm13-Aug-09 23:47
stancrm13-Aug-09 23:47 
AnswerRe: Catching an Exception Pin
Eddy Vluggen14-Aug-09 0:07
professionalEddy Vluggen14-Aug-09 0:07 
GeneralRe: Catching an Exception Pin
stancrm14-Aug-09 1:15
stancrm14-Aug-09 1:15 
QuestionClose Firefox with C# Pin
nhqlbaislwfiikqraqnm13-Aug-09 22:35
nhqlbaislwfiikqraqnm13-Aug-09 22:35 
AnswerRe: Close Firefox with C# Pin
Eddy Vluggen13-Aug-09 22:39
professionalEddy Vluggen13-Aug-09 22:39 
AnswerRe: Close Firefox with C# Pin
Rajesh R Subramanian13-Aug-09 22:42
professionalRajesh R Subramanian13-Aug-09 22:42 
GeneralRe: Close Firefox with C# Pin
nhqlbaislwfiikqraqnm13-Aug-09 22:51
nhqlbaislwfiikqraqnm13-Aug-09 22:51 
GeneralRe: Close Firefox with C# Pin
0x3c013-Aug-09 22:54
0x3c013-Aug-09 22:54 
GeneralRe: Close Firefox with C# Pin
nhqlbaislwfiikqraqnm13-Aug-09 22:59
nhqlbaislwfiikqraqnm13-Aug-09 22:59 
GeneralRe: Close Firefox with C# Pin
Eddy Vluggen13-Aug-09 23:14
professionalEddy Vluggen13-Aug-09 23:14 
GeneralRe: Close Firefox with C# Pin
nhqlbaislwfiikqraqnm13-Aug-09 23:41
nhqlbaislwfiikqraqnm13-Aug-09 23:41 
GeneralRe: Close Firefox with C# Pin
Eddy Vluggen13-Aug-09 23:55
professionalEddy Vluggen13-Aug-09 23:55 
GeneralRe: Close Firefox with C# Pin
Pete O'Hanlon14-Aug-09 1:10
mvePete O'Hanlon14-Aug-09 1:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.