Пример #1
0
		public ProxyConnParam CovertoProxy(ConnParams connParams)
		{
			DbConnectionStr = connParams.Connection;
			Host = connParams.Host;
			Port = connParams.Port;
			UserName = connParams.UserName;
			PassWord = connParams.PassWord;
			ReadOnly = connParams.ConnectionReadOnly;  
			return this;
		}
Пример #2
0
        //
        public string dbConnection(ConnParams login)
        {
            try
            {
                Db4oFactory.Configure().AllowVersionUpdates(true);
                Db4oClient.conn = login;

                dbConn = Db4oClient.Client;
                return Db4oClient.exceptionConnection;
            }
            catch (Exception oEx)
            {
                LoggingHelper.HandleException(oEx);
                return "";
            }
        }
Пример #3
0
	    public static void Create()
		{
			try
			{
				dbInteraction.CreateDemoDb(demoFilePath);
			    ConnParams conparam = new ConnParams(demoFilePath,false);
				
				RecentQueries currRecentConnection = new RecentQueries(conparam);
				RecentQueries tempRc = currRecentConnection.ChkIfRecentConnIsInDb();
				if (tempRc != null)
					currRecentConnection = tempRc;
				currRecentConnection.Timestamp = DateTime.Now;
				currRecentConnection.ConnParam = conparam;
				dbInteraction.ConnectoToDB(currRecentConnection);
				dbInteraction.SetCurrentRecentConnection(currRecentConnection);


			}
			catch (Exception e)
			{
				LoggingHelper.ShowMessage(e);
			}
		}
Пример #4
0
 public static long GetTimeforSearchStringCreation(ConnParams conn)
 {
     GroupofSearchStrings lstsearchstring = new GroupofSearchStrings(conn);
     return lstsearchstring.ReturnTimeWhenSearchStringCreated();
 }
Пример #5
0
		public static List<FavouriteFolder> GetFavourites(ConnParams conn)
		{
			FavouriteList lstFav = new FavouriteList(conn);
			return lstFav.ReturnFavouritFolderList(); 
		}
Пример #6
0
 public static long GetTimeforFavCreation(ConnParams conn)
 {
     FavouriteList lstFav = new FavouriteList(conn);
     return lstFav.ReturnTimeWhenFavouriteListCreated(); 
 }
Пример #7
0
        private void ConnectAfterCreatingNewAppDomain(ConnParams conparam)
        {
            ConnectionDetails currConnectionDetails = new ConnectionDetails(conparam);
            long id = OMEInteraction.ChkIfRecentConnIsInDb(conparam);
            if (id > 0)
            {
                currConnectionDetails = OMEInteraction.GetConnectionDetailsObject(id);
                if (currConnectionDetails != null)
                    currConnectionDetails.ConnParam.ConnectionReadOnly = chkReadOnly.Checked;
            }

            currConnectionDetails.CustomConfigAssemblyPath = txtCustomConfigAssemblyPath.Text.Trim();
            string exceptionString = AssemblyInspectorObject.Connection.ConnectToDatabase(currConnectionDetails,
                                                                                          checkCustomConfig);

            if (exceptionString == string.Empty)
            {
                SaveConnectionAndCreateToolWindows(currConnectionDetails);
                CreateQueryBuilderToolWindow();
            }
            else
            {
                AssemblyInspectorObject.Connection.Closedb();
                textBoxConnection.Clear();
                MessageBox.Show(exceptionString,
                                Helper.GetResourceString(Common.Constants.PRODUCT_CAPTION),
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                AppDomain.Unload(appDomain.workerAppDomain);
                dbInteraction.SetAssemblyPathtoNull();
            }
        }
Пример #8
0
    	private void RefreshConnectionData(string filepath)
    	{
    		ConnParams conParams = new ConnParams(filepath, false);
    		RecentQueries recQueries = new RecentQueries(conParams);
    		recQueries = recQueries.ChkIfRecentConnIsInDb();

    		if (recQueries != null)
    		{
    			FavouriteList favList = new FavouriteList(conParams);
    			favList.RemoveFavouritFolderForAConnection();

    			GroupofSearchStrings grpSearchString = new GroupofSearchStrings(conParams);
    			grpSearchString.RemovesSearchStringsForAConnection();

    			recQueries.deleteRecentQueriesForAConnection();
    		}
    	}
Пример #9
0
		public static void UpdateFavourite(ConnParams conn, FavouriteFolder FavFolder)
		{
			FavouriteList lstFav = new FavouriteList(conn);
			lstFav.RemoveFolderfromDatabase(FavFolder);  
		}
Пример #10
0
		public static FavouriteFolder GetFolderfromDatabaseByFoldername(ConnParams conn, string folderName)
		{
			FavouriteList lstFav = new FavouriteList(conn);
			lstFav = lstFav.FindFolderWithClassesByFolderName(folderName);
			return lstFav.lstFavFolder[0]; 
		}
Пример #11
0
        public static long ChkIfRecentConnIsInDb(ConnParams connectionDetails)
        {

            ManageConnectionDetails manage = new ManageConnectionDetails(connectionDetails);
            return manage.ChkIfRecentConnIsInDb();
        }
Пример #12
0
 public ConnectionDetails(ConnParams connParam)
 {
     m_queryList = new List <OMQuery>();
     m_connParam = connParam;
 }
Пример #13
0
 public static void DeleteConfigConnection(string path, ConnParams connnection)
 {
   
     ManageConnectionDetails manage = new ManageConnectionDetails(connnection);
     manage.RemoveCustomConfigPath(path); 
 }
Пример #14
0
 public static void SetCurrentRecentConnection(ConnParams  conn)
 {
     Db4oClient.CurrentConnParams = conn;
 }
Пример #15
0
		/// <summary>
		/// Static property which closes the corresponding object container for the current logon identity.
		/// </summary>
		public static void CloseConnection()
		{
			try
			{
				if (objContainer != null)
				{
					objContainer.Close();
					objContainer = null;
					isConnected = false;
					conn = null;
				}
				embeddedConfig = null;
				

			}
			catch (Exception oEx)
			{
				LoggingHelper.HandleException(oEx);
			}
		}
Пример #16
0
 public SearchStringList(ConnParams connParam)
 {           
     m_connParam = connParam;
     m_ListSearchString = new List<SeachString>(); 
 }
Пример #17
0
 private void btnClearCustomConfig_Click(object sender, EventArgs e)
 {
     if (comboBoxFilePath.SelectedItem != null)
     {
         ConnParams param = new ConnParams(comboBoxFilePath.SelectedItem.ToString());
         OMEInteraction.DeleteConfigConnection(txtCustomConfigAssemblyPath.Text.Trim(), param);
     }
     txtCustomConfigAssemblyPath.Clear();
 }
Пример #18
0
 public static long GetTimeforRecentQueriesCreation(ConnParams conn)
 {
     RecentQueries rQueries = new RecentQueries(conn);
     return rQueries.ReturnTimeWhenRecentQueriesCreated();
 }
Пример #19
0
 public static void RemoveSearchString(ConnParams conn)
 {
     GroupofSearchStrings SearchStringList = new GroupofSearchStrings(conn);
     SearchStringList.RemovesSearchStringsForAConnection();
 }
Пример #20
0
		public static void SaveFavourite(ConnParams conn, FavouriteFolder FavFolder)
		{
			FavouriteList lstFav = new FavouriteList(conn);
			lstFav.AddFolderToDatabase(FavFolder);
		}
Пример #21
0
		private void buttonConnect_Click(object sender, EventArgs e)
		{
			try
			{
				ConnParams conparam = null;
				if (radioButtonLocal.Checked)
				{
					if (!(Validations.ValidateLocalLoginParams(ref comboBoxFilePath, ref textBoxConnection)))
						return;
					conparam = new ConnParams(textBoxConnection.Text.Trim(), chkReadOnly.Checked);

				}
				else
				{
					if (!(Validations.ValidateRemoteLoginParams(ref comboBoxFilePath, ref textBoxHost, ref textBoxPort,
						                                        ref textBoxUserName, ref textBoxPassword)))
						return;

					string connection = STRING_SERVER + textBoxHost.Text.Trim() + STRING_COLON + textBoxPort.Text.Trim() + STRING_COLON +
					                    textBoxUserName.Text.Trim();
					conparam = new ConnParams(connection, textBoxHost.Text.Trim(), textBoxUserName.Text.Trim(),
					                          textBoxPassword.Text.Trim(), Convert.ToInt32(textBoxPort.Text.Trim()));

				}
				
				 RecentQueries currRecentQueries = new RecentQueries(conparam);
				 RecentQueries tempRecentQueries = currRecentQueries.ChkIfRecentConnIsInDb();
				 if (tempRecentQueries != null)
				 {
				 	currRecentQueries = tempRecentQueries;
				 	currRecentQueries.ConnParam.ConnectionReadOnly = chkReadOnly.Checked;      
				 }
				string  exceptionString = dbInteraction.ConnectoToDB(currRecentQueries);

				if (exceptionString == string.Empty)
				{
					dbInteraction.SetCurrentRecentConnection(currRecentQueries);
					dbInteraction.SaveRecentConnection(currRecentQueries);
					AfterSuccessfullyConnected();

					loginToolWindow.Close(vsSaveChanges.vsSaveChangesNo);
					Helper.CheckIfLoginWindowIsVisible = false;
					ObjectBrowserToolWin.CreateObjectBrowserToolWindow();
					ObjectBrowserToolWin.ObjBrowserWindow.Visible = true;

					PropertyPaneToolWin.CreatePropertiesPaneToolWindow(true);
					PropertyPaneToolWin.PropWindow.Visible = true;

					CreateQueryBuilderToolWindow();

				}
				else
				{
					dbInteraction.CloseCurrDb(); 
					textBoxConnection.Clear();
					MessageBox.Show(exceptionString,
					                Helper.GetResourceString(Common.Constants.PRODUCT_CAPTION),
					                MessageBoxButtons.OK,
					                MessageBoxIcon.Error);
					return;
				}

			}
			catch (Exception oEx)
			{
				LoggingHelper.ShowMessage(oEx);
			}
		}
Пример #22
0
		public static void RenameFolderInDatabase(ConnParams conn, FavouriteFolder oldFav, FavouriteFolder newFav)
		{
			FavouriteList lstFav = new FavouriteList(conn);
			lstFav.RenameFolderInDatabase(oldFav, newFav);  
		}
Пример #23
0
 public FavouriteList(ConnParams connParam)
 {
     m_connParam = connParam;           
     m_lstFavfolder = new List<FavouriteFolder>();
     
 }
Пример #24
0
 public static void RemoveFavFolder(ConnParams conn)
 {
     FavouriteList favouriteList = new FavouriteList(conn);
     favouriteList.RemoveFavouritFolderForAConnection();
 }
Пример #25
0
		private void buttonConnect_Click(object sender, EventArgs e)
		{
            try
            {
                ConnParams conparam;
                checkCustomConfig = false;
                if (radioButtonLocal.Checked)
                {
                    if (!(Validations.ValidateLocalLoginParams(ref comboBoxFilePath, ref textBoxConnection)))
                        return;
                    conparam = new ConnParams(textBoxConnection.Text.Trim(), chkReadOnly.Checked);

                }
                else
                {
                    if (!(Validations.ValidateRemoteLoginParams(ref comboBoxFilePath, ref textBoxHost, ref textBoxPort,
                                                                ref textBoxUserName, ref textBoxPassword)))
                        return;

                    string connection = STRING_SERVER + textBoxHost.Text.Trim() + STRING_COLON + textBoxPort.Text.Trim() +
                                        STRING_COLON +
                                        textBoxUserName.Text.Trim();
                    conparam = new ConnParams(connection, textBoxHost.Text.Trim(), textBoxUserName.Text.Trim(),
                                              textBoxPassword.Text.Trim(), Convert.ToInt32(textBoxPort.Text.Trim()));

                }
                dbInteraction.SetPathForConnection(conparam.Connection);
                CheckCustomConfig();

                if (CreateAppDomain())
                    ConnectAfterCreatingNewAppDomain(conparam);
            }
            catch (Exception oEx)
            {
                LoggingHelper.ShowMessage(oEx);
            }
		}
Пример #26
0
 public static void RemoveRecentQueries(ConnParams conn)
 {
     RecentQueries recentQueries = new RecentQueries(conn);
     recentQueries.deleteRecentQueriesForAConnection();
 }
Пример #27
0
 public ConnectionDetails(ConnParams connParam)
 {
     m_queryList = new List<OMQuery>();
     m_connParam = connParam;
 }
Пример #28
0
		public static List<string> GetSearchString(ConnParams conn)
		{
			GroupofSearchStrings searchStrings = new GroupofSearchStrings(conn);
			return searchStrings.ReturnStringList();
		}
Пример #29
0
		public static void SaveSearchString(ConnParams conn, SeachString searchString)
		{
			GroupofSearchStrings searchStrings = new GroupofSearchStrings(conn);
			if (searchString.SearchString != string.Empty)
				searchStrings.AddSearchStringToList(searchString);
		}
Пример #30
0
 public RecentQueries(ConnParams connParam)
 {
     m_queryList      = new List <OMQuery>();
     this.m_connParam = connParam;
     //  container = Db4oClient.RecentConn;
 }
Пример #31
0
 	private void RefreshConnectionData(string filepath)
 	{
 		ConnParams conParams = new ConnParams(filepath, false);
         long id = OMEInteraction.ChkIfRecentConnIsInDb(conParams);
         if (id > 0)
         {
             ConnectionDetails connectionDetails = OMEInteraction.GetConnectionDetailsObject(id);
             if (connectionDetails != null)
             {
                 OMEInteraction.RemoveFavFolder();
                 OMEInteraction.RemoveSearchString();
                 OMEInteraction.RemoveRecentQueries();
             }
         }
 	}