Пример #1
0
        private static IList <string> BuildParameterStrings(DataRow row, IList <ParameterProfile> paramInfos)
        {
            List <string> list = new List <string>();

            foreach (ParameterProfile parameterProfile in paramInfos)
            {
                if (parameterProfile.IsRunnable(row))
                {
                    switch (parameterProfile.ParameterType)
                    {
                    case ParameterType.Switched:
                        list.Add(string.Format("-{0} ", parameterProfile.Name));
                        break;

                    case ParameterType.Column:
                    case ParameterType.ModifiedColumn:
                    {
                        string arg = MonadCommand.FormatParameterValue(MonadSaveTask.ConvertToParameterValue(row, parameterProfile));
                        list.Add(string.Format("-{0} {1} ", parameterProfile.Name, arg));
                        break;
                    }

                    default:
                        list.Add(string.Empty);
                        break;
                    }
                }
                else
                {
                    list.Add(string.Empty);
                }
            }
            return(list);
        }
Пример #2
0
 public override void BuildParameters(DataRow row, DataObjectStore store, IList <ParameterProfile> paramInfos)
 {
     this.dataHandler.Parameters.Clear();
     this.dataHandler.ClearParameterNames();
     this.modifiedParametersDescription = MonadSaveTask.BuildParametersDescription(row, paramInfos);
     this.dataHandler.CommandText       = MonadPipelineSaveTask.BuildCommandScript(this.originalCommandText, row, paramInfos);
 }
Пример #3
0
 public override void BuildParameters(DataRow row, DataObjectStore store, IList <ParameterProfile> paramInfos)
 {
     foreach (DataHandler dataHandler in this.dataHandler.DataHandlers)
     {
         SingleTaskDataHandler singleTaskDataHandler = (SingleTaskDataHandler)dataHandler;
         foreach (ParameterProfile parameterProfile in paramInfos)
         {
             singleTaskDataHandler.Parameters.Remove(parameterProfile.Name);
         }
         MonadSaveTask.BuildParametersCore(row, paramInfos, singleTaskDataHandler.Parameters);
     }
     this.modifiedParametersDescription = MonadSaveTask.BuildParametersDescription(row, paramInfos);
 }
Пример #4
0
        private void UpdateWorkUnitsInfo(DataRow row)
        {
            DataRow dataRow = this.PrepareCombineRow(row);

            foreach (KeyValuePair <DataRow, SingleTaskDataHandler> keyValuePair in this.permissionItems)
            {
                this.CopyPermission(dataRow, keyValuePair.Key);
                keyValuePair.Value.WorkUnit.Icon = this.GetDisplayIcon(dataRow);
                keyValuePair.Value.WorkUnit.Text = this.GetDisplayText(dataRow);
                if (this.paramInfos != null)
                {
                    keyValuePair.Value.WorkUnit.Description = MonadSaveTask.BuildParametersDescription(dataRow, this.paramInfos);
                }
            }
        }
Пример #5
0
        public override void BuildParameters(DataRow row, DataObjectStore store, IList <ParameterProfile> paramInfos)
        {
            this.DataHandler.Parameters.Clear();
            StringBuilder stringBuilder  = new StringBuilder();
            StringBuilder stringBuilder2 = new StringBuilder();

            if ((bool)row[this.AutoDiscovery])
            {
                string text = MonadCommand.FormatParameterValue(row[this.AutoDiscoveryDomain]);
                stringBuilder2.AppendFormat(this.AutoDiscoveryCommandText, text);
                stringBuilder.Append(Strings.NameValueFormat(this.AutoDiscoveryDomain, text));
            }
            stringBuilder2.Append(this.originalCommandText);
            stringBuilder2.Append(" ");
            foreach (ParameterProfile parameterProfile in paramInfos)
            {
                if ((store.ModifiedColumns.Contains(parameterProfile.Reference) || this.Identity.Equals(parameterProfile.Name)) && parameterProfile.IsRunnable(row))
                {
                    switch (parameterProfile.ParameterType)
                    {
                    case ParameterType.Switched:
                        stringBuilder2.AppendFormat("-{0} ", parameterProfile.Name);
                        stringBuilder.AppendLine(parameterProfile.Name);
                        break;

                    case ParameterType.Column:
                    case ParameterType.ModifiedColumn:
                    {
                        string text2 = MonadCommand.FormatParameterValue(MonadSaveTask.ConvertToParameterValue(row, parameterProfile.Reference));
                        stringBuilder.Append(Strings.NameValueFormat(parameterProfile.Name, text2));
                        if (this.Identity.Equals(parameterProfile.Name) && row[parameterProfile.Reference] is ADObjectId)
                        {
                            text2 = string.Format("'{0}'", ((ADObjectId)row[parameterProfile.Reference]).ObjectGuid.ToString());
                        }
                        stringBuilder2.AppendFormat("-{0} {1} ", parameterProfile.Name, text2);
                        break;
                    }
                    }
                }
            }
            this.modifiedParametersDescription = stringBuilder.ToString();
            this.DataHandler.CommandText       = stringBuilder2.ToString();
            this.DataHandler.ClearParameterNames();
        }