コード例 #1
0
ファイル: frmPlayerOptions.cs プロジェクト: CarverLab/Oyster
        public frmPlayerOptions()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            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);

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

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
コード例 #2
0
ファイル: frmPlayerOptions.cs プロジェクト: CarverLab/Oyster
 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;
     }
 }
コード例 #3
0
ファイル: frmPlayerOptions.cs プロジェクト: CarverLab/Oyster
        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("OysterMini",13075,10904,"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("OysterMini",13075,10904,"N/A","N/A",true,OCL.OysterRecordingSessionSearchType.Title,"N/A","N/A");
                    break;
            }
        }
コード例 #4
0
ファイル: frmPlayerOptions.cs プロジェクト: CarverLab/Oyster
 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);
     }
 }
コード例 #5
0
ファイル: frmPlayerOptions.cs プロジェクト: CarverLab/Oyster
 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);
     }
 }