Beispiel #1
0
        private void addButton_Click(object sender, EventArgs e)
        {
            EditShareForm editShare = new EditShareForm();

            if (selectedSection == "movies")
            {
                editShare.labelCreateThumbs.Visible = true;
                editShare.cbCreateThumbs.Visible    = true;
                editShare.CreateThumbs = true;

                editShare.cbEachFolderIsMovie.Visible = true;
                editShare.EachFolderIsMovie           = false;
            }
            else
            {
                editShare.labelCreateThumbs.Visible = false;
                editShare.cbCreateThumbs.Visible    = false;
                editShare.CreateThumbs = true;

                editShare.cbEachFolderIsMovie.Visible = false;
                editShare.EachFolderIsMovie           = false;
            }

            editShare.DonotFolderJpgIfPin = true;
            DialogResult dialogResult = editShare.ShowDialog(this);

            if (dialogResult == DialogResult.OK)
            {
                ShareData shareData = new ShareData(editShare.ShareName, editShare.Folder, editShare.PinCode, editShare.CreateThumbs);
                shareData.IsRemote            = editShare.IsRemote;
                shareData.Server              = editShare.Server;
                shareData.LoginName           = editShare.LoginName;
                shareData.PassWord            = editShare.PassWord;
                shareData.Port                = editShare.Port;
                shareData.ActiveConnection    = editShare.ActiveConnection;
                shareData.RemoteFolder        = editShare.RemoteFolder;
                shareData.DefaultLayout       = ProperLayoutFromDefault(editShare.View);
                shareData.EnableWakeOnLan     = editShare.EnableWakeOnLan;
                shareData.DonotFolderJpgIfPin = editShare.DonotFolderJpgIfPin;

                //CreateThumbs
                if (selectedSection == "movies")
                {
                    //int drivetype = Util.Utils.getDriveType(shareData.Folder);
                    //if (drivetype != 2 &&
                    //    drivetype != 5)
                    //{
                    shareData.CreateThumbs      = editShare.CreateThumbs;
                    shareData.EachFolderIsMovie = editShare.EachFolderIsMovie;
                    //}
                    //else
                    //{
                    //  shareData.CreateThumbs = false;
                    //}
                }
                AddShare(shareData, currentlyCheckedItem == null);
            }
        }
        private void editButton_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem selectedItem in sharesListView.SelectedItems)
            {
                ShareData shareData = selectedItem.Tag as ShareData;

                if (shareData != null)
                {
                    EditShareForm editShare = new EditShareForm();

                    editShare.ShareName = shareData.Name;
                    editShare.PinCode   = shareData.PinCode;
                    editShare.Folder    = shareData.Folder;

                    editShare.IsRemote         = shareData.IsRemote;
                    editShare.Server           = shareData.Server;
                    editShare.Port             = shareData.Port;
                    editShare.ActiveConnection = shareData.ActiveConnection;
                    editShare.LoginName        = shareData.LoginName;
                    editShare.PassWord         = shareData.PassWord;
                    editShare.RemoteFolder     = shareData.RemoteFolder;
                    editShare.View             = ProperDefaultFromLayout(shareData.DefaultLayout);

                    DialogResult dialogResult = editShare.ShowDialog(this);

                    if (dialogResult == DialogResult.OK)
                    {
                        shareData.Name    = editShare.ShareName;
                        shareData.Folder  = editShare.Folder;
                        shareData.PinCode = editShare.PinCode;

                        shareData.IsRemote         = editShare.IsRemote;
                        shareData.Server           = editShare.Server;
                        shareData.LoginName        = editShare.LoginName;
                        shareData.PassWord         = editShare.PassWord;
                        shareData.Port             = editShare.Port;
                        shareData.ActiveConnection = editShare.ActiveConnection;
                        shareData.RemoteFolder     = editShare.RemoteFolder;
                        shareData.DefaultLayout    = ProperLayoutFromDefault(editShare.View);

                        selectedItem.Tag = shareData;

                        selectedItem.SubItems[0].Text = shareData.Name;
                        selectedItem.SubItems[1].Text = shareData.HasPinCode ? "Yes" : "No";
                        selectedItem.SubItems[2].Text = shareData.Folder;
                        if (shareData.IsRemote)
                        {
                            selectedItem.SubItems[2].Text = String.Format("ftp://{0}:{1}{2}", shareData.Server, shareData.Port,
                                                                          shareData.RemoteFolder);
                        }
                    }
                }
            }
        }
        private void addButton_Click(object sender, EventArgs e)
        {
            EditShareForm editShare = new EditShareForm();

            DialogResult dialogResult = editShare.ShowDialog(this);

            if (dialogResult == DialogResult.OK)
            {
                ShareData shareData = new ShareData(editShare.ShareName, editShare.Folder, editShare.PinCode);
                shareData.IsRemote         = editShare.IsRemote;
                shareData.Server           = editShare.Server;
                shareData.LoginName        = editShare.LoginName;
                shareData.PassWord         = editShare.PassWord;
                shareData.Port             = editShare.Port;
                shareData.ActiveConnection = editShare.ActiveConnection;
                shareData.RemoteFolder     = editShare.RemoteFolder;
                shareData.DefaultLayout    = ProperLayoutFromDefault(editShare.View);

                AddShare(shareData, currentlyCheckedItem == null);
            }
        }
Beispiel #4
0
        private void editButton_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem selectedItem in sharesListView.SelectedItems)
            {
                ShareData shareData = selectedItem.Tag as ShareData;

                if (shareData != null)
                {
                    EditShareForm editShare = new EditShareForm();

                    editShare.ShareName = shareData.Name;
                    editShare.PinCode   = shareData.PinCode;
                    editShare.Folder    = shareData.Folder;

                    editShare.IsRemote            = shareData.IsRemote;
                    editShare.Server              = shareData.Server;
                    editShare.Port                = shareData.Port;
                    editShare.ActiveConnection    = shareData.ActiveConnection;
                    editShare.LoginName           = shareData.LoginName;
                    editShare.PassWord            = shareData.PassWord;
                    editShare.RemoteFolder        = shareData.RemoteFolder;
                    editShare.View                = ProperDefaultFromLayout(shareData.DefaultLayout);
                    editShare.EnableWakeOnLan     = shareData.EnableWakeOnLan;
                    editShare.DonotFolderJpgIfPin = shareData.DonotFolderJpgIfPin;

                    // CreateThumbs
                    int drivetype = Util.Utils.getDriveType(shareData.Folder);
                    if (selectedSection == "movies") // &&
                    //drivetype != 2 &&
                    //drivetype != 5)
                    {
                        editShare.labelCreateThumbs.Visible = true;
                        editShare.cbCreateThumbs.Visible    = true;
                        editShare.CreateThumbs = shareData.CreateThumbs;

                        editShare.cbEachFolderIsMovie.Visible = true;
                        editShare.EachFolderIsMovie           = shareData.EachFolderIsMovie;
                    }
                    else
                    {
                        editShare.labelCreateThumbs.Visible = false;
                        editShare.cbCreateThumbs.Visible    = false;
                        editShare.CreateThumbs = true;

                        editShare.cbEachFolderIsMovie.Visible = false;
                        editShare.EachFolderIsMovie           = false;
                    }

                    DialogResult dialogResult = editShare.ShowDialog(this);

                    if (dialogResult == DialogResult.OK)
                    {
                        shareData.Name    = editShare.ShareName;
                        shareData.Folder  = editShare.Folder;
                        shareData.PinCode = editShare.PinCode;

                        shareData.IsRemote            = editShare.IsRemote;
                        shareData.Server              = editShare.Server;
                        shareData.LoginName           = editShare.LoginName;
                        shareData.PassWord            = editShare.PassWord;
                        shareData.Port                = editShare.Port;
                        shareData.ActiveConnection    = editShare.ActiveConnection;
                        shareData.RemoteFolder        = editShare.RemoteFolder;
                        shareData.DefaultLayout       = ProperLayoutFromDefault(editShare.View);
                        shareData.EnableWakeOnLan     = editShare.EnableWakeOnLan;
                        shareData.DonotFolderJpgIfPin = editShare.DonotFolderJpgIfPin;

                        //CreateThumbs
                        if (selectedSection == "movies")
                        {
                            //if (drivetype != 2 &&
                            //    drivetype != 5)
                            //{
                            shareData.CreateThumbs      = editShare.CreateThumbs;
                            shareData.EachFolderIsMovie = editShare.EachFolderIsMovie;
                            //}
                            //else
                            //{
                            //  shareData.CreateThumbs = false;
                            //}
                        }
                        selectedItem.Tag = shareData;

                        selectedItem.SubItems[0].Text = shareData.Name;
                        selectedItem.SubItems[1].Text = shareData.HasPinCode ? "Yes" : "No";
                        selectedItem.SubItems[2].Text = shareData.Folder;
                        selectedItem.SubItems[3].Text = shareData.CreateThumbs ? "Yes" : "No";

                        if (!Util.Utils.IsNetwork(shareData.Folder))
                        {
                            selectedItem.SubItems[4].Text = string.Empty;
                        }
                        else
                        {
                            using (Profile.Settings xmlreader = new MPSettings())
                            {
                                selectedItem.SubItems[4].Text = xmlreader.GetValueAsString("macAddress", Util.Utils.GetServerNameFromUNCPath(shareData.Folder), null);
                            }
                        }

                        if (shareData.IsRemote)
                        {
                            selectedItem.SubItems[2].Text = String.Format("ftp://{0}:{1}{2}", shareData.Server, shareData.Port,
                                                                          shareData.RemoteFolder);
                        }
                    }
                }
            }
        }
Beispiel #5
0
    private void editButton_Click(object sender, EventArgs e)
    {
      foreach (ListViewItem selectedItem in sharesListView.SelectedItems)
      {
        ShareData shareData = selectedItem.Tag as ShareData;

        if (shareData != null)
        {
          EditShareForm editShare = new EditShareForm();

          editShare.ShareName = shareData.Name;
          editShare.PinCode = shareData.PinCode;
          editShare.Folder = shareData.Folder;

          editShare.IsRemote = shareData.IsRemote;
          editShare.Server = shareData.Server;
          editShare.Port = shareData.Port;
          editShare.ActiveConnection = shareData.ActiveConnection;
          editShare.LoginName = shareData.LoginName;
          editShare.PassWord = shareData.PassWord;
          editShare.RemoteFolder = shareData.RemoteFolder;
          editShare.View = ProperDefaultFromLayout(shareData.DefaultLayout);
          editShare.EnableWakeOnLan = shareData.EnableWakeOnLan;
          editShare.DonotFolderJpgIfPin = shareData.DonotFolderJpgIfPin;

          // CreateThumbs
          int drivetype = Util.Utils.getDriveType(shareData.Folder);
          if (selectedSection == "movies") // && 
                           //drivetype != 2 && 
                           //drivetype != 5)
          {
            editShare.labelCreateThumbs.Visible = true;
            editShare.cbCreateThumbs.Visible = true;
            editShare.CreateThumbs = shareData.CreateThumbs;

            editShare.cbEachFolderIsMovie.Visible = true;
            editShare.EachFolderIsMovie = shareData.EachFolderIsMovie;
          }
          else
          {
            editShare.labelCreateThumbs.Visible = false;
            editShare.cbCreateThumbs.Visible = false;
            editShare.CreateThumbs = true;

            editShare.cbEachFolderIsMovie.Visible = false;
            editShare.EachFolderIsMovie = false;
          }

          DialogResult dialogResult = editShare.ShowDialog(this);

          if (dialogResult == DialogResult.OK)
          {
            shareData.Name = editShare.ShareName;
            shareData.Folder = editShare.Folder;
            shareData.PinCode = editShare.PinCode;

            shareData.IsRemote = editShare.IsRemote;
            shareData.Server = editShare.Server;
            shareData.LoginName = editShare.LoginName;
            shareData.PassWord = editShare.PassWord;
            shareData.Port = editShare.Port;
            shareData.ActiveConnection = editShare.ActiveConnection;
            shareData.RemoteFolder = editShare.RemoteFolder;
            shareData.DefaultLayout = ProperLayoutFromDefault(editShare.View);
            shareData.EnableWakeOnLan = editShare.EnableWakeOnLan;
            shareData.DonotFolderJpgIfPin = editShare.DonotFolderJpgIfPin;

            //CreateThumbs
            if (selectedSection == "movies")
            {
              //if (drivetype != 2 && 
              //    drivetype != 5)
              //{
              shareData.CreateThumbs = editShare.CreateThumbs;
              shareData.EachFolderIsMovie = editShare.EachFolderIsMovie;
              //}
              //else
              //{
              //  shareData.CreateThumbs = false;
              //}
            }
            selectedItem.Tag = shareData;

            selectedItem.SubItems[0].Text = shareData.Name;
            selectedItem.SubItems[1].Text = shareData.HasPinCode ? "Yes" : "No";
            selectedItem.SubItems[2].Text = shareData.Folder;
            selectedItem.SubItems[3].Text = shareData.CreateThumbs ? "Yes" : "No";

            if (!Util.Utils.IsNetwork(shareData.Folder))
            {
              selectedItem.SubItems[4].Text = string.Empty;
            }
            else
            {
              using (Profile.Settings xmlreader = new MPSettings())
              {
                selectedItem.SubItems[4].Text = xmlreader.GetValueAsString("macAddress", Util.Utils.GetServerNameFromUNCPath(shareData.Folder), null);
              }
            }

            if (shareData.IsRemote)
            {
              selectedItem.SubItems[2].Text = String.Format("ftp://{0}:{1}{2}", shareData.Server, shareData.Port,
                                                            shareData.RemoteFolder);
            }
          }
        }
      }
    }
Beispiel #6
0
    private void addButton_Click(object sender, EventArgs e)
    {
      EditShareForm editShare = new EditShareForm();
      
      if (selectedSection == "movies")
      {
        editShare.labelCreateThumbs.Visible = true;
        editShare.cbCreateThumbs.Visible = true;
        editShare.CreateThumbs = true;

        editShare.cbEachFolderIsMovie.Visible = true;
        editShare.EachFolderIsMovie = false;
      }
      else
      {
        editShare.labelCreateThumbs.Visible = false;
        editShare.cbCreateThumbs.Visible = false;
        editShare.CreateThumbs = true;

        editShare.cbEachFolderIsMovie.Visible = false;
        editShare.EachFolderIsMovie = false;
      }

      editShare.DonotFolderJpgIfPin = true;
      DialogResult dialogResult = editShare.ShowDialog(this);

      if (dialogResult == DialogResult.OK)
      {
        ShareData shareData = new ShareData(editShare.ShareName, editShare.Folder, editShare.PinCode, editShare.CreateThumbs);
        shareData.IsRemote = editShare.IsRemote;
        shareData.Server = editShare.Server;
        shareData.LoginName = editShare.LoginName;
        shareData.PassWord = editShare.PassWord;
        shareData.Port = editShare.Port;
        shareData.ActiveConnection = editShare.ActiveConnection;
        shareData.RemoteFolder = editShare.RemoteFolder;
        shareData.DefaultLayout = ProperLayoutFromDefault(editShare.View);
        shareData.EnableWakeOnLan = editShare.EnableWakeOnLan;
        shareData.DonotFolderJpgIfPin = editShare.DonotFolderJpgIfPin;

        //CreateThumbs
        if (selectedSection == "movies")
        {
          //int drivetype = Util.Utils.getDriveType(shareData.Folder);
          //if (drivetype != 2 && 
          //    drivetype != 5)
          //{
          shareData.CreateThumbs = editShare.CreateThumbs;
          shareData.EachFolderIsMovie = editShare.EachFolderIsMovie;
          //}
          //else
          //{
          //  shareData.CreateThumbs = false;
          //}
        }
        AddShare(shareData, currentlyCheckedItem == null);
      }
    }
    private void editButton_Click(object sender, EventArgs e)
    {
      foreach (ListViewItem selectedItem in sharesListView.SelectedItems)
      {
        ShareData shareData = selectedItem.Tag as ShareData;

        if (shareData != null)
        {
          EditShareForm editShare = new EditShareForm();

          editShare.ShareName = shareData.Name;
          editShare.PinCode = shareData.PinCode;
          editShare.Folder = shareData.Folder;

          editShare.IsRemote = shareData.IsRemote;
          editShare.Server = shareData.Server;
          editShare.Port = shareData.Port;
          editShare.ActiveConnection = shareData.ActiveConnection;
          editShare.LoginName = shareData.LoginName;
          editShare.PassWord = shareData.PassWord;
          editShare.RemoteFolder = shareData.RemoteFolder;
          editShare.View = ProperDefaultFromLayout(shareData.DefaultLayout);

          DialogResult dialogResult = editShare.ShowDialog(this);

          if (dialogResult == DialogResult.OK)
          {
            shareData.Name = editShare.ShareName;
            shareData.Folder = editShare.Folder;
            shareData.PinCode = editShare.PinCode;

            shareData.IsRemote = editShare.IsRemote;
            shareData.Server = editShare.Server;
            shareData.LoginName = editShare.LoginName;
            shareData.PassWord = editShare.PassWord;
            shareData.Port = editShare.Port;
            shareData.ActiveConnection = editShare.ActiveConnection;
            shareData.RemoteFolder = editShare.RemoteFolder;
            shareData.DefaultLayout = ProperLayoutFromDefault(editShare.View);

            selectedItem.Tag = shareData;

            selectedItem.SubItems[0].Text = shareData.Name;
            selectedItem.SubItems[1].Text = shareData.HasPinCode ? "Yes" : "No";
            selectedItem.SubItems[2].Text = shareData.Folder;
            if (shareData.IsRemote)
            {
              selectedItem.SubItems[2].Text = String.Format("ftp://{0}:{1}{2}", shareData.Server, shareData.Port,
                                                            shareData.RemoteFolder);
            }
          }
        }
      }
    }
    private void addButton_Click(object sender, EventArgs e)
    {
      EditShareForm editShare = new EditShareForm();

      DialogResult dialogResult = editShare.ShowDialog(this);

      if (dialogResult == DialogResult.OK)
      {
        ShareData shareData = new ShareData(editShare.ShareName, editShare.Folder, editShare.PinCode);
        shareData.IsRemote = editShare.IsRemote;
        shareData.Server = editShare.Server;
        shareData.LoginName = editShare.LoginName;
        shareData.PassWord = editShare.PassWord;
        shareData.Port = editShare.Port;
        shareData.ActiveConnection = editShare.ActiveConnection;
        shareData.RemoteFolder = editShare.RemoteFolder;
        shareData.DefaultLayout = ProperLayoutFromDefault(editShare.View);

        AddShare(shareData, currentlyCheckedItem == null);
      }
    }