Esempio n. 1
0
        public frmOptions()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            #if USE_DEVICE_DISCOVERY
            string FakeUDN = "DBF54A20-3C3F-477c-A15D-84673C1DDF3B";
            NoDevice = Intel.UPNP.UPnPDevice.CreateEmbeddedDevice((double)1,FakeUDN);
            NoDevice.FriendlyName = "No Device Selected";
            NoDevice.SerialNumber = "N/A";
            cboOysterDevice.DisplayMember = "FriendlyName";
            cboOysterDevice.ValueMember = "SerialNumber";

            cboOysterDevice.Items.Add(NoDevice);
            cboOysterDevice.SelectedItem = NoDevice;
            disco = new OysterDeviceDiscovery();
            disco.OnAddedDevice += new OysterDeviceDiscovery.DiscoveryHandler(AddSink);
            disco.OnRemovedDevice += new OysterDeviceDiscovery.DiscoveryHandler(RemoveSink);
            #endif

            m_PlayerOptions = new PlayerOptions(PlayerOptions.SaveType.ToRegistry);

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
Esempio n. 2
0
 private static void WriteToFile(PlayerOptions This, ref bool bWritten)
 {
     if (System.IO.File.Exists(This.m_sPathFileToSave))
     {
         System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter =
             new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
         bWritten = true;
         formatter.Serialize(new System.IO.FileStream(This.m_sPathFileToSave,
             System.IO.FileMode.OpenOrCreate),This);
     }
     else
     {
         throw new System.IO.FileNotFoundException("File was not found.",This.m_sPathFileToSave);
     }
 }
Esempio n. 3
0
 private static void ReadFromFile(PlayerOptions This, string PathFile)
 {
     if (System.IO.File.Exists(PathFile))
     {
         System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter =
             new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
         formatter.Serialize(new System.IO.FileStream(PathFile,
             System.IO.FileMode.OpenOrCreate),This);
     }
     else
     {
         throw new System.IO.FileNotFoundException("File was not found.",PathFile);
     }
 }
Esempio n. 4
0
 public void Save(PlayerOptions.SaveType HowToSave)
 {
     System.Diagnostics.Debug.Assert(HowToSave == PlayerOptions.SaveType.ToRegistry,"Only Registry save is supported.");
     switch (HowToSave)
     {
         case PlayerOptions.SaveType.ToRegistry:
             WriteToRegistry();
             break;
         case PlayerOptions.SaveType.ToFile:
             WriteToFile(this,ref m_bHasBeenSaved);
             break;
         case PlayerOptions.SaveType.ToRegistryAndFile:
             WriteToRegistry();
             WriteToFile(this,ref m_bHasBeenSaved);
             break;
     }
 }
Esempio n. 5
0
        public PlayerOptions(PlayerOptions.SaveType OptionsSaveType)
        {
            System.Diagnostics.Debug.Assert(OptionsSaveType == PlayerOptions.SaveType.ToRegistry,"Only Registry save is supported.");

            switch (OptionsSaveType)
            {
                case PlayerOptions.SaveType.ToRegistry:
                    ClassInit("",SystemDefaults.DefaultOysterNetworkPort,SystemDefaults.DefaultOysterFileTransferPort,"N/A","N/A",true,OCL.OysterRecordingSessionSearchType.Title,"N/A","N/A");
                    break;
                case PlayerOptions.SaveType.ToFile:
                    PlayerOptions.ReadFromFile(this,"PlayerOptions.dat");
                    break;
                case PlayerOptions.SaveType.ToRegistryAndFile:
                    ClassInit("",SystemDefaults.DefaultOysterNetworkPort,SystemDefaults.DefaultOysterFileTransferPort,"N/A","N/A",true,OCL.OysterRecordingSessionSearchType.Title,"N/A","N/A");
                    break;
            }
        }
Esempio n. 6
0
        public PlayerOptions(PlayerOptions.SaveType OptionsSaveType)
        {
            System.Diagnostics.Debug.Assert(OptionsSaveType == PlayerOptions.SaveType.ToRegistry,"Only Registry save is supported.");

            //			System.Reflection.AssemblyTitleAttribute ata = (System.Reflection.AssemblyTitleAttribute)
            //				System.Attribute.GetCustomAttribute(System.Reflection.Assembly.GetAssembly(typeof(DesktopRecorder.PlayerOptions)),
            //				typeof(System.Reflection.AssemblyTitleAttribute));

            switch (OptionsSaveType)
            {
                case PlayerOptions.SaveType.ToRegistry:
                    ClassInit("",OCL.Oyster.DefaultOysterNetworkPort,OCL.Oyster.DefaultOysterFileTransferPort,"N/A","N/A",true,OCL.OysterRecordingSessionSearchType.Title,"N/A","N/A");
                    break;
                case PlayerOptions.SaveType.ToFile:
                    PlayerOptions.ReadFromFile(this,"PlayerOptions.dat");
                    break;
                case PlayerOptions.SaveType.ToRegistryAndFile:
                    ClassInit("",OCL.Oyster.DefaultOysterNetworkPort,OCL.Oyster.DefaultOysterFileTransferPort,"N/A","N/A",true,OCL.OysterRecordingSessionSearchType.Title,"N/A","N/A");
                    break;
            }
        }