Different configurations of the annex



  • There's a full functional application. This is an application for one type of user. They can be edited/admitted/added. But there are other users who can't do it.

    How do we go not to create a few similar applications, but with a slight difference in the operation?

    In Delphi, I used this approach.

    #IFDEF DISPATCHER
    ...
    #ENDIF
    

    #IFDEF VIEWER
    ...
    #ENDIF

    In VisualStudio somehow.

    #if DEBUG
    // Работает
    #endif

    #if RELEASE
    // Не работает
    #endif



  • It's all about project designs. Debug default configuration defines DEBUG and TRACE symbols, however, the version only defines TRACE (the RELEASE Symbol does not exist).

    This'll help you in this way:

    #if !DEBUG
    

    #endif

    Or like this:

    #if DEBUG

    #else

    #endif

    Also in the properties of the project, you can identify your symbols for imputation. I'm doing this like this:

    скриншот студии

    But, in general, for different modes of operation, the design and configuration files are usually well suited:

    if (Properties.Settings.Default.CanEditFoo) {
    // ...
    }

    It also makes sense to limit user access to the server or the DSB. If Active Directory is used in the organization, it will be a good decision to authorise users on the basis of the home groups to which they belong.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2