Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DataEditor"/> class.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="settings">The settings.</param>
        /// <param name="dataTypeDefinitionId">The data type definition id.</param>
        /// <param name="instanceId">The instance id.</param>
        public DataEditor(IData data, PreValueEditorSettings settings, int dataTypeDefinitionId, string instanceId)
        {
            // Set up dependencies
            this.prevalueEditorSettingsHandler = new PrevalueEditorSettingsHandler();
            this.settings = settings;
            this.data     = data;

            this.dataTypeDefinitionId = dataTypeDefinitionId;
            this.instanceId           = instanceId;
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DataEditor"/> class.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="settings">The settings.</param>
        /// <param name="dataTypeDefinitionId">The data type definition id.</param>
        /// <param name="instanceId">The instance id.</param>
        public DataEditor(IData data, PreValueEditorSettings settings, int dataTypeDefinitionId, string instanceId)
        {
            // Set up dependencies
            this.prevalueEditorSettingsHandler = new PrevalueEditorSettingsHandler();
            this.settings = settings;
            this.data = data;

            this.dataTypeDefinitionId = dataTypeDefinitionId;
            this.instanceId = instanceId;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PrevalueEditor"/> class.
        /// </summary>
        /// <param name="dataType">The DataType.</param>
        public PrevalueEditor(umbraco.cms.businesslogic.datatype.BaseDataType dataType)
            : base(dataType, umbraco.cms.businesslogic.datatype.DBTypes.Ntext)
        {
            // Set up dependencies
            this.regexValidator = new RegexValidator();
            this.prevalueEditorSettingsHandler = new PrevalueEditorSettingsHandler();
            this.prevalueEditorControlFactory = new PrevalueEditorControlFactory();

            // Ensure settings file exists
            Helper.IO.EnsureFileExists(
                IOHelper.MapPath("~/config/DataTypeGrid.config"),
                DtgConfiguration.DataTypeGrid);

            // Ensure webservice file exists
            var dtgFolder = Helper.IO.EnsureFolderExists(Path.Combine(DataTypes.Settings.BaseDir.FullName, "DataTypeGrid"));
            Helper.IO.EnsureFileExists(Path.Combine(dtgFolder.FullName, "PreValueWebService.asmx"), DtgWebServices.PreValueWebService);
        }