private void connectButton_Click(object sender, EventArgs e)
 {
     try
     {
         uint appId;
         if (string.IsNullOrWhiteSpace(appIdTextBox.Text))
         {
             MessageBox.Show(this, "Please enter an App ID.", "Failed to connect", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         if (!uint.TryParse(appIdTextBox.Text.Trim(), out appId))
         {
             MessageBox.Show(this, "Please make sure the App ID you entered is valid.", "Failed to connect", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         storage = RemoteStorage.CreateInstance(uint.Parse(appIdTextBox.Text));
         //storage = new RemoteStorageLocal("remote", uint.Parse(appIdTextBox.Text));
         refreshButton.Enabled = true;
         addButton.Enabled     = true;
         refreshButton_Click(this, EventArgs.Empty);
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.ToString(), "Failed to connect", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        public static RemoteStorage CreateInstance(uint appID)
        {
            lock (sync)
            {
                if (instance != null)
                {
                    instance.Dispose();
                    instance = null;
                }

                RemoteStorage rs = new RemoteStorage(appID);
                instance = rs;
                return rs;
            }
        }
        public static RemoteStorage CreateInstance(uint appID)
        {
            lock (sync)
            {
                if (instance != null)
                {
                    instance.Dispose();
                    instance = null;
                }

                RemoteStorage rs = new RemoteStorage(appID);
                instance = rs;
                return(rs);
            }
        }
 internal RemoteFile(RemoteStorage parent, string name)
 {
     this.parent = parent;
     Name = name;
 }
Exemplo n.º 5
0
 internal RemoteFile(RemoteStorage parent, string name)
 {
     this.parent = parent;
     Name        = name;
 }