Dev2.Webs.RootWebSite.ShowFileChooser C# (CSharp) Method

ShowFileChooser() public static method

public static ShowFileChooser ( IEnvironmentModel environment, FileChooserMessage fileChooserMessage ) : void
environment IEnvironmentModel
fileChooserMessage FileChooserMessage
return void
        public static void ShowFileChooser(IEnvironmentModel environment, FileChooserMessage fileChooserMessage)
        {
            VerifyArgument.IsNotNull("environment", environment);

            const string PageName = "dialogs/filechooser";
            const double Width = 704;
            const double Height = 517;
            const string LeftTitle = "Choose File(s)";
            var environmentConnection = environment.Connection;
            if(environmentConnection != null)
            {
                string rightTitle = environment.Name + " (" + environmentConnection.AppServerUri + ")";

            var pageHandler = new FileChooserCallbackHandler(fileChooserMessage);

                var envirDisplayName = FullyEncodeServerDetails(environmentConnection);
                var relativeUriString = string.Format("{0}?envir={1}", PageName, envirDisplayName);
                if(!IsTestMode)
                {
                    environment.ShowWebPageDialog(SiteName, relativeUriString, pageHandler, Width, Height, LeftTitle, rightTitle);
                }
                else
                {
                    CallBackHandler = pageHandler;
                    TestModeRelativeUri = relativeUriString;
                }
            }
        }