Пример #1
0
        static void Main(string[] args)
        {
            #region 1. Setup

            remoteManager = InitRemoteManager();

            #endregion

            #region 2. Create Entities and Link

            //CreateProduct();
            //CreateItem();
            // CreateResource();
            //LinkProductToItem();
            //LinkProductToResource();

            #endregion

            #region 3. Create CVL

            //CreateCVL();

            #endregion

            #region 4. Search

            // SearchByUniqueNumber();
            // SearchByCriteria();
            // SearchByLinkQuery();
            // SearchByComplexQuery();
            #endregion

            // Delete();
            GenerateReport();
        }
Пример #2
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            PluginInterface = pluginInterface;

            Configuration = PluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
            Configuration.Initialize(pluginInterface);

            RemoteConfigManager = new RemoteManager(this);
            var config = RemoteConfigManager.Config;

            Version =
                $"FP{VersionInfo.VersionNum}{VersionInfo.Type}_SP{Spotify.VersionInfo.VersionNum}{Spotify.VersionInfo.Type}_HX{config.ApiVersion}";

            PluginInterface.CommandManager.AddHandler(Command, new CommandInfo(OnCommand)
            {
                HelpMessage = "Run commands for Fantasy Player"
            });

            //Setup player
            PlayerManager = new PlayerManager(this);

            CommandManager = new CommandManager(pluginInterface, this);

            InterfaceController = new InterfaceController(this);

            PluginInterface.UiBuilder.OnBuildUi      += InterfaceController.Draw;
            PluginInterface.UiBuilder.OnOpenConfigUi += OpenConfig;
        }
Пример #3
0
        private static void Main(string[] args)
        {
            try
            {
                FriendManager friendManager = CreatePlugin <FriendManager>();
                friendManager.OnPluginLoaded("", "", "");
                friendManager.OnPluginEnable();
                friendManager.OnPluginDisable();


                RemoteManager remoteManager = CreatePlugin <RemoteManager>();
                remoteManager.OnPluginLoaded("", "", "");
                remoteManager.OnPluginEnable();
                remoteManager.OnPluginDisable();


                ServerLogger serverLogger = CreatePlugin <ServerLogger>();
                serverLogger.OnPluginLoaded("", "", "");
                serverLogger.OnPluginEnable();
                serverLogger.OnPluginDisable();
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.ToString());
            }
            Console.ReadLine();
        }
        public async void Register( )
        {
            _main = MainPresenter.Get();
            _view = ViewPresenterManager.ResolveView(typeof(IRemoteSetupView)) as IRemoteSetupView;

            var users = await DbLocal.FetchUsers();

            _view.Contacts  = users?.ToList();
            _view.StartGame = (addr) => {
                var gamePres = new ChessBoardPresenter();
                var canPlay  = RemoteManager.ConnectTo(new Connection {
                    Address = addr.Split(':')[0],
                    Port    = addr.Split(':')[1]
                });
                if (canPlay)
                {
                    _main.ShowInfo("Невозможно подключиться");
                    _main.ReleaseControl();
                    return;
                }
                gamePres.Register(new Model.Game.Chess.ChessSettings {
                    Type          = Model.Game.Chess.GameType.Remote,
                    IsWhite       = true,// TODO:
                    SecondLimited = -1
                });
            };
            _view.Cancel = () => {
                _main.ReleaseControl();
            };

            _view.Start();
            _main.QueryForSetupView(_view as UserControl);
        }
Пример #5
0
        // =================================================================
        //              UI Events
        // =================================================================

        private void ButtonConnect_Click(object sender, EventArgs e)
        {
            var sd = ServersConfig.GetInstance().GetSelected();

            if (sd == null)
            {
                return;
            }
            if (rm == null)
            {
                RemoteManager rmm = RemoteManager.GetInstance();
                rm = rmm.Connect(sd);

                if (rm.IsConnected())
                {
                    st = rm.GetStream();
                    ButtonConnect.Text = "Disconnect";
                }
                return;
            }

            if (rm.IsConnected())
            {
                rm.Disconnect();
                rm = null;
                st = null;
                ButtonConnect.Text = "Connect";
            }
        }
Пример #6
0
        private static void Main(string[] args)
        {
            var importer = new XmlExporter();

            importer.Context = new inRiverContext(
                RemoteManager.CreateInstance("http://*****:*****@testcustomer3.com", "Pimuser1!", "PROD"),
                new ConsoleLogger());

            importer.Context.Settings = new Dictionary <string, string>
            {
                { "CHANNEL_ID", "15880" },
                { "EPI_APIKEY", "epi123" },
                { "EPI_ENDPOINT_URL", "http://localhost:64010/inriverapi/InriverDataImport/" },
                { "RESOURCE_CONFIGURATION", "Thumbnail" },
                { "PUBLISH_FOLDER", "c:\\temp" },
                { "PUBLISH_FOLDER_RESOURCES", "c:\\temp" },
                { "EPI_RESTTIMEOUT", "1" },
                { "ITEM_TO_SKUS", "false" },
                { "LANGUAGE_MAPPING", "<languages><language><epi>en-us</epi><inriver>en</inriver></language></languages>" },
                { "STORAGE_NAME", "epifileshare" },
                { "STORAGE_KEY", "AddKeyHere" },
                { "STORAGE_SHARE_REFERENCE", "myshare" },
                { "STORAGE_CATALOG_DIRECTORY_REFERENCE", "catalog" },
                { "STORAGE_RESOURCES_DIRECTORY_REFERENCE", "resource" }
            };


            importer.Publish(15880);
        }
        private void authenticate()
        {
            AuthenticationTicket ticket = RemoteManager.Authenticate(ConfigurationManager.AppSettings["authenticationUrl"], ConfigurationManager.AppSettings["username"], ConfigurationManager.AppSettings["password"]);

            // Initialize RemoteManager
            RemoteManager.CreateInstance(ConfigurationManager.AppSettings["authenticationUrl"], ticket);
        }
Пример #8
0
        private static void RunRemoteQueue()
        {
            McQueueProperties prop = new McQueueProperties("NC_Quick");

            //prop.ConnectionString = cnn;
            prop.CoverMode = CoverMode.FileSystem;//.ItemsAndLog;
            prop.Server    = 0;
            //prop.Provider = QueueProvider.SqlServer;
            prop.ReloadOnStart = true;
            Console.WriteLine("create remote queue");
            RemoteQueue rque = RemoteManager.Create(prop);

            //rque.ReceiveCompleted += new ReceiveCompletedEventHandler(rq_ReceiveCompleted);


            //RemoteQueue.AddQueue(prop);
            Console.WriteLine("rempote queue created");
            rque.MessageArraived += new QueueItemEventHandler(rq_MessageArraived);
            rque.MessageReceived += new QueueItemEventHandler(rq_MessageReceived);
            //Console.WriteLine(rqc.Reply("test"));

            //AsyncManagerWorker();
            RunThreads(new ThreadStart(AsyncRemoteDequeue), 10);
            RunThreads(new ThreadStart(AsyncManagerWorker), 10);

            while (true)
            {
                IAsyncResult result = rque.BeginReceive(null);
                Console.WriteLine("Count: {0}", rque.Count);
                Thread.Sleep(10);
            }
            Console.ReadLine();
        }
Пример #9
0
 void Start()
 {
     rb          = GetComponent <Rigidbody2D>();
     tumble      = Random.Range(0.8f, 1.5f);
     rb.velocity = Random.insideUnitCircle * tumble;
     manager     = RemoteManager.GetManager();
 }
Пример #10
0
 public async Task <object> SendData(object data)
 {
     return(await Task.Run(() =>
     {
         RemoteManager.SendData(data as RemoteData, _connection);
         return true;
     }));
 }
Пример #11
0
 public async Task <bool> SendMessage(object data)
 {
     return(await Task.Run(() =>
     {
         RemoteManager.SendData(new RemoteData
         {
             MessageText = data as string
         }, _connection);
         return true;
     }));
 }
Пример #12
0
 public async Task <bool> Resign( )
 {
     return(await Task.Run(() =>
     {
         RemoteManager.SendData(new RemoteData
         {
             State = GameStateQuery.Resign
         }, _connection);
         return true;
     }));
 }
Пример #13
0
        public void TestInitialize()
        {
            Logger = new Logger(TestContext);
            Logger.Log(LogLevel.Information, $"Initialize connection to inRiver Server");

            // todo: add your inRiver username, password and environment here
            InRiverContext = new inRiverContext(
                RemoteManager.CreateInstance(_partnerRemotingUrl,
                                             "***", "***", "***"), Logger);

            Assert.IsNotNull(InRiverContext?.ExtensionManager, "Connection to inRiver failed. Please check the url and credentials within the test initialize method.");
        }
Пример #14
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
 }
Пример #15
0
        public async Task <object> MakeMove(object moveData)
        {
            var move = await _validator.MakeMove(moveData);

            var userMoved = (GameState)moveData;

            RemoteManager.SendData(new RemoteData {
                State = GameStateQuery.Move,
                Move  = new Tuple <BPosition, BPosition>(userMoved.LastMove.Item1, userMoved.LastMove.Item2)
            },
                                   _connection);
            return(move);
        }
Пример #16
0
        static void TestChangeSender()
        {
            RemoteManager manager = RemoteManager.CreateInstance(
                "https://demo.remoting.productmarketingcloud.com",
                "*****@*****.**",
                "inRiverBest4Ever!"
                );

            ChangeSender.ChangeSenderEntityListener changeSenderEntityListener = new ChangeSender.ChangeSenderEntityListener();
            changeSenderEntityListener.Context = new inRiverContext(manager, new ConsoleLogger());

            changeSenderEntityListener.EntityCreated(102);
        }
Пример #17
0
        public static void Main(string[] args)
        {
            Task.Run(() =>
            {
                if (Config.Get().AllowRemote)
                {
                    RemoteManager.StartServer();
                }
            });
            var app = new App();

            app.InitializeComponent();
            app.Run();
        }
Пример #18
0
        public void TestInitialize()
        {
            Logger = new Logger(TestContext);
            Logger.Log(LogLevel.Information, $"Initialize connection to inRiver Server");

            // Customer: https://remoting.productmarketingcloud.com
            // Sandbox:  https://partner.remoting.productmarketingcloud.com

            // todo: add your inRiver username, password and environment here
            InRiverContext = new inRiverContext(
                RemoteManager.CreateInstance("https://partner.remoting.productmarketingcloud.com",
                                             "***", "***", "***"), Logger);

            Assert.IsNotNull(InRiverContext, "Login failed ??");
        }
Пример #19
0
 public async Task <bool> Open( )
 {
     return(await Task.Run(() =>
     {
         try
         {
             _connection = RemoteManager.RecentConnections[0];
             RemoteManager.ReceiveData(LocalReceive, _connection);
             return _connection.Connected;
         }
         catch
         {
             return false;
         }
     }));
 }
Пример #20
0
        private static RemoteManager InitRemoteManager()
        {
            try
            {
                RemoteManager manager = RemoteManager.CreateInstance(
                    "https://demo.remoting.productmarketingcloud.com",
                    "*****@*****.**",
                    "inRiverBest4Ever!"
                    );

                return(manager);
            } catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(null);
        }
Пример #21
0
        static void Init()
        {
            AuthenticationTicket ticket;

            try
            {
                ticket = RemoteManager.Authenticate("http://dev.inriver.com:8080", "pimuser1", "pimuser1");
            }
            //catch (EndpointNotFoundException epEx)
            //{
            //    Console.WriteLine("Authentication failed for communication reason!");
            //    Console.WriteLine(string.Format("Error message: {0}", epEx.Message));
            //    Console.ReadLine();
            //    return;
            //}
            catch (SecurityException secEx)
            {
                Console.WriteLine("Authentication failed for Security reason!");
                Console.WriteLine(string.Format("Error message: {0}", secEx.Message));
                Console.ReadLine();
                return;
            }
            catch (AuthenticationException autEx)
            {
                Console.WriteLine("Authentication failed!");
                Console.WriteLine(string.Format("Error message: {0}", autEx.Message));
                Console.ReadLine();
                return;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Authentication failed for unknown reason!");
                Console.WriteLine(string.Format("Error message: {0}", ex.Message));
                Console.ReadLine();
                return;
            }

            if (ticket == null)
            {
                Console.WriteLine("Authentication failed! No ticket created.");
                Console.ReadLine();
                return;
            }

            RemoteManager.CreateInstance("http://dev.inriver.com:8080", ticket);
        }
Пример #22
0
        private static RemoteManager CreateRemoteManager(string serverUrl, string username, string password, string environment)
        {
            var ticket = new RemoteManager(serverUrl).Authenticate(serverUrl, username, password, environment);

            if (ticket == null)
            {
                Console.WriteLine("Could not create a Remote Manager ticket.");
                return(null);
            }

            var manager = RemoteManager.CreateInstance(serverUrl, ticket);

            if (manager == null)
            {
                Console.WriteLine("Error when creating Remote Manager instance");
                return(null);
            }

            return(manager);
        }
Пример #23
0
        public Plugin(
            DalamudPluginInterface dalamudPluginInterface,
            DCommandManager commandManager,
            ChatGui chatGui,
            ClientState clientState,
            Condition condition)
        {
            PluginInterface = dalamudPluginInterface;
            ChatGui         = chatGui;
            ClientState     = clientState;
            Condition       = condition;

            Configuration = PluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
            Configuration.Initialize(dalamudPluginInterface);

            RemoteConfigManager = new RemoteManager(this);
            var config = RemoteConfigManager.Config;

            Version =
                $"FP{VersionInfo.VersionNum}{VersionInfo.Type}_SP{Spotify.VersionInfo.VersionNum}{Spotify.VersionInfo.Type}_HX{config.ApiVersion}";

            commandManager.AddHandler(Command, new CommandInfo(OnCommand)
            {
                HelpMessage = "Run commands for Fantasy Player"
            });

            //Setup player
            PlayerManager = new PlayerManager(this);

            FPCommandManager = new FPCommandManager(dalamudPluginInterface, this);

            InterfaceController = new InterfaceController(this);

            PluginInterface.UiBuilder.Draw         += InterfaceController.Draw;
            PluginInterface.UiBuilder.OpenConfigUi += OpenConfig;
        }
Пример #24
0
        public MainService(bool daemon)
        {
            var settings = Properties.Settings.Default;

            if (settings.UpgradeRequired)
            {
                settings.Upgrade();
                settings.UpgradeRequired = false;
                settings.Save();
            }
            Natfrp.Token       = settings.Token; // Prevent possible token lost
            Natfrp.BypassProxy = settings.BypassProxy;

            AutoLogin = Natfrp.Token != null && Natfrp.Token.Length > 0;

            Daemonize = daemon;
            if (!daemon)
            {
                TickThread = new Thread(new ThreadStart(TickRun));
            }

            InitializeComponent();

            Pipe = new PipeServer(Utils.InstallationPipeName);
            Pipe.DataReceived += Pipe_DataReceived;

            LogManager    = new LogManager(this, 8192);
            NodeManager   = new NodeManager(this);
            TunnelManager = new TunnelManager(this);
            UpdateManager = new UpdateManager(this);
            RemoteManager = new RemoteManager(this)
            {
                Enabled    = settings.EnableRemote && settings.RemoteKey != null && settings.RemoteKey.Length > 0,
                EncryptKey = settings.RemoteKey
            };
        }
        static void Initialize()
        {
            _remoteManager = RemoteManager.CreateInstance("https://partner.remoting.productmarketingcloud.com", "*****@*****.**", "b6r1lLGMIClbiAKTlszG!");
            _logger        = new ConsoleLogger();
            _context       = new inRiverContext(_remoteManager, _logger);


            // Where can I find settings options? Are these just custom? https://servicecenter.inriver.com/hc/en-us/articles/360012462053-inRiver-Context

            /*Dictionary<string, string> settings = new Dictionary<string, string> {
             * { "clientID", "RY3WL3AR-RY3W" },
             * { "integrationUsername", "jratiniIntegration" },
             * { "userToken", "270bd80a61274300bd5f0ed19d2d5f69" },
             * { "aprimoTenant", "productstrategy1" },
             * { "entityTypeDAMFieldID", "e101ff8be98d404ca43daa3f01538c97" }, //inRiverEntityType
             * { "entityIDDAMFieldID", "6989a1abea754a3e887eaa8b0102c77b" }, // inRiverEntityID
             * { "resourceIDDAMFieldID", "c871793508d34d1a97b9aa86010ca90a" },
             * { "ResourceTitle", "Record Title" },
             * { "aprimoRecordIdFieldTypeID", "AprimoRecordId" },
             * { "aprimoResourceFromAprimoFieldTypeID", "ResourceFromAprimo" },
             * { "aprimoInRiverStatusFieldID", "6e6ff917-37ef-42d7-949e-aa8c013cb2fe" },
             * { "entityUniqueFieldsForIdentifying", "Product:ProductId;Item:ItemNumber;Channel:ChannelName" },
             * { "inRiverProductMetadataMapping", "SKU:4661dee1-b4c8-4575-afbf-aa8c00edcd84;Materials:ce349f4e-0995-46dd-8934-aa880121abd9;Price:b47a5ce7-a364-4b6f-9eb5-aa8c00ee3fe8" }
             * };*/

            Dictionary <string, string> InboundDataExtensionSettings = new Dictionary <string, string>
            {
                { "clientID", "RY3WL3AR-RY3W" },
                { "integrationUsername", "jratiniIntegration" },
                { "userToken", "270bd80a61274300bd5f0ed19d2d5f69" },
                { "aprimoTenant", "productstrategy1" },
                { "entityTypeDAMFieldID", "e101ff8be98d404ca43daa3f01538c97" }, //inRiverEntityType
                { "entityIDDAMFieldID", "7ac090e504944877ab4faa3f0153d467" },   // inRiverEntityID
                { "resourceIDDAMFieldID", "c871793508d34d1a97b9aa86010ca90a" },
                { "statusDAMFieldID", "6e6ff917-37ef-42d7-949e-aa8c013cb2fe" },
                { "ResourceTitle", "Record Title" },
                { "aprimoRecordIdFieldTypeID", "AprimoRecordId" },
                { "aprimoResourceFromAprimoFieldTypeID", "ResourceFromAprimo" },
                { "entityUniqueFieldsForIdentifying", "Product:ProductId;Item:ItemNumber;Channel:ChannelName" }
            };
            Dictionary <string, string> ListenerExtensionSettings = new Dictionary <string, string>
            {
                { "clientID", "RY3WL3AR-RY3W" },
                { "integrationUsername", "jratiniIntegration" },
                { "userToken", "270bd80a61274300bd5f0ed19d2d5f69" },
                { "aprimoTenant", "productstrategy1" },
                { "aprimoResourceFromAprimoFieldTypeID", "ResourceFromAprimo" },
                { "aprimoRecordIdFieldTypeID", "AprimoRecordId" },
                { "inRiverProductMetadataMapping", "SKU:4661dee1-b4c8-4575-afbf-aa8c00edcd84;Materials:ce349f4e-0995-46dd-8934-aa880121abd9;Price:b47a5ce7-a364-4b6f-9eb5-aa8c00ee3fe8" },
                { "inRiverItemMetadataMapping", "inRiverField1:aprimoField1" }
            };



            dataAPI = new DataAPI();
            //listener = new InRiverAprimoListener();

            dataAPI.Context = _context;
            //listener.Context = _context;

            dataAPI.Context.Settings = InboundDataExtensionSettings;
            //listener.Context.Settings = ListenerExtensionSettings;
        }
Пример #26
0
 // ReSharper disable once UnusedMember.Local
 private void Awake()
 {
     _remoteManager = FindObjectOfType <RemoteManager>();
 }
Пример #27
0
 private void MenuItemExit_Click(object sender, EventArgs e)
 {
     RemoteManager.GetInstance().DisconnectAll();
     Application.Exit();
 }
Пример #28
0
        static void Main(string[] args)
        {
            //Set server and user details.
            var myServer   = "https://myinRiverServer:8080";
            var myUser     = "******";
            var myPassword = "******";
            var userToGetNotificationsFor = "inRiverUserNameToActivateNotifictaionFor";

            AuthenticationTicket ticket;

            try
            {
                ticket = RemoteManager.Authenticate(myServer, myUser, myPassword);
            }
            catch (EndpointNotFoundException epEx)
            {
                Console.WriteLine("Authentication failed for communication reason!");
                Console.WriteLine(string.Format("Error message: {0}", epEx.Message));
                Console.ReadLine();
                return;
            }
            catch (SecurityException secEx)
            {
                Console.WriteLine("Authentication failed for Security reason!");
                Console.WriteLine(string.Format("Error message: {0}", secEx.Message));
                Console.ReadLine();
                return;
            }
            catch (AuthenticationException autEx)
            {
                Console.WriteLine("Authentication failed!");
                Console.WriteLine(string.Format("Error message: {0}", autEx.Message));
                Console.ReadLine();
                return;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Authentication failed for unknown reason!");
                Console.WriteLine(string.Format("Error message: {0}", ex.Message));
                Console.ReadLine();
                return;
            }

            if (ticket == null)
            {
                Console.WriteLine("Authentication failed! No ticket created.");
                Console.ReadLine();
                return;
            }

            RemoteManager.CreateInstance(myServer, ticket);
            Console.WriteLine("Authentication Succeeded. Now you can start using the inRiver Remoting API");
            //Console.ReadLine();

            //Get All Notifications For a specific User (see variable at the start of the )
            var myNotifications = RemoteManager.UtilityService.GetAllNotificationsForUser(userToGetNotificationsFor);

            //Activate all of the Notifiction statuses.
            foreach (var aNotification in myNotifications)
            {
                aNotification.Status = "Active";
                RemoteManager.UtilityService.UpdateNotificaton(aNotification);
            }

            //Fetch all of the Notifications again for the user and see that they are updated.
            myNotifications = RemoteManager.UtilityService.GetAllNotificationsForUser(userToGetNotificationsFor);
            myNotifications.ForEach(i => Console.WriteLine("{0}\t{1}\t", i.Status, i.Id));

            Console.ReadLine();
        }
Пример #29
0
        // =================================================================
        //              UI Events
        // =================================================================

        /// <summary>
        /// When creating a new repository two things need to happen. The
        /// server needs to setup a bare repo and the local directory needs
        /// to be linked to the remote repo.
        /// </summary>
        private void ButtonAccept_Click(object sender, EventArgs e)
        {
            // error checks
            string repoName = TextBoxRepoName.Text;

            if (repoName == null)
            {
                return;
            }
            if (repoName.Equals(""))
            {
                return;
            }
            if (repoName.Equals("Repository Name"))
            {
                return;
            }

            string localDir = TextBoxLocalDirectory.Text;

            if (localDir == null)
            {
                return;
            }
            if (localDir.Equals(""))
            {
                return;
            }

            string server = ComboBoxSelectServer.GetItemText(ComboBoxSelectServer.SelectedItem);

            if (server == null)
            {
                return;
            }
            if (server.Equals(""))
            {
                return;
            }
            localDir = localDir.Replace(@"\", "/") + "/" + repoName;

            // get server details
            ListItem      listitem = (ListItem)(ComboBoxSelectServer.SelectedItem);
            ServerDetails sd       = listitem.Details;

            // connect to server to setup the remote repo
            RemoteManager rman   = RemoteManager.GetInstance();
            IRemote       remote = rman.Connect(sd);

            if (!remote.IsConnected()) // error
            {
                DialogUtil.Message("Error: Cannot connect to remote repository");
                return;
            }

            IStream stream  = remote.GetStream();
            string  repoLoc = sd.GetLocation() + "/" + repoName;

            stream.Execute("mkdir -p " + repoLoc);
            stream.Execute("cd " + repoLoc);
            bool success = stream.Execute("git init --bare");

            if (!success) // error
            {
                DialogUtil.Message("Error: Could not execute command");
                return;
            }

            // make local directory
            Directory.CreateDirectory(localDir);

            if (!Directory.Exists(localDir)) // error
            {
                DialogUtil.Message("Error: Could not create local repository");
                return;
            }

            // make and run the script for initializing a new local repo
            string      remoteDir = sd.GetServerLoginString() + "/" + repoName;
            RepoDetails repo      = new RepoDetails(repoName, sd.GetName(), remoteDir, localDir);
            string      script    = ScriptBuilder.NewScript(repo);
            Executable  exe       = new Executable("expect.exe", script).Start();

            exe.WaitForExit();

            // add new repo to configuration
            ReposConfig.GetInstance().AddRepoDetails(repo, false);
            ReposConfig.GetInstance().Save();

            // done. now close and fire refresh event
            EventManager.Fire(EventCode.REFRESH_REPOS);
            ProperClose();
        }
        // =================================================================
        //              UI Events
        // =================================================================

        private void ButtonAccept_Click(object sender, EventArgs e)
        {
            // error checks
            string repoName = TextBoxRepoName.Text;

            if (repoName == null)
            {
                return;
            }
            if (repoName.Equals(""))
            {
                return;
            }
            if (repoName.Equals("Repository Name"))
            {
                return;
            }

            string localDir = TextBoxLocalDirectory.Text;

            if (localDir == null)
            {
                return;
            }
            if (localDir.Equals(""))
            {
                return;
            }
            localDir = localDir.Replace(@"\", "/");

            string server = ComboBoxSelectServer.GetItemText(ComboBoxSelectServer.SelectedItem);

            if (server == null)
            {
                return;
            }
            if (server.Equals(""))
            {
                return;
            }


            // get server details
            ListItem      listitem = (ListItem)(ComboBoxSelectServer.SelectedItem);
            ServerDetails sd       = listitem.Details;

            // check to see if sevrer is available
            RemoteManager rman   = RemoteManager.GetInstance();
            IRemote       remote = rman.Connect(sd);

            if (!remote.IsConnected()) // error
            {
                DialogUtil.Message("Error: Cannot connect to remote repository");
                return;
            }

            // make and run the script for downloading the selected repository
            string      remoteDir = sd.GetServerLoginString() + "/" + repoName;
            RepoDetails repo      = new RepoDetails(repoName, sd.GetName(), remoteDir, localDir);
            string      script    = ScriptBuilder.CloneScript(repo, sd);
            Executable  exe       = new Executable("expect.exe", script).Start();

            exe.WaitForExit();

            // add new repo to configuration
            ReposConfig.GetInstance().AddRepoDetails(repo, false);
            ReposConfig.GetInstance().Save();

            // done. now close and fire refresh event
            EventManager.Fire(EventCode.REFRESH_REPOS);
            ProperClose();
        }