public CreateBuilderSkeleton(ITypeContainer typeContainer,
                              INameResolver resolver, IErrorReport errorReport)
 {
     this.typeContainer = typeContainer;
     this.resolver      = resolver;
     this.errorReport   = errorReport;
 }
示例#2
0
        public override string Execute(IErrorReport errorReport)
        {
            if (functionArguments.Count() != 1)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Too many arguments", this.Name));
            }

            string result = null;

            try
            {
                string dateFormatText = functionArguments[0].Execute(errorReport);

                if (dateFormatText != null && dateFormatText.Length >= 1)
                {
                    string dateText = DateTime.Now.ToString(dateFormatText);
                    result = dateText;
                }
            }
            catch (Exception)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Bad function call.", this.Name));
            }
            return(result);
        }
示例#3
0
        public override string Execute(IErrorReport errorReport)
        {
            if (functionArguments.Count() != 1)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Too many arguments", this.Name));
            }

            string result = null;

            try
            {
                string txt = functionArguments[0].Execute(errorReport);

                if (txt != null && txt.Length >= 1)
                {
                    string firstChar = txt.Substring(0, 1);
                    string theRest   = txt.Substring(1, txt.Length - 1);
                    result = firstChar.ToLower() + theRest;
                }
            }
            catch (Exception)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Bad function call.", this.Name));
            }
            return(result);
        }
示例#4
0
        public override string Execute(IErrorReport errorReport)
        {
            if (functionArguments.Count() != 1)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Too many arguments", this.Name));
            }

            string result = null;

            try
            {
                string txt = functionArguments[0].Execute(errorReport);

                if (txt != null && txt.Length >= 1)
                {
                    CultureInfo cultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture;
                    result = cultureInfo.TextInfo.ToTitleCase(txt.ToLower());
                }
            }
            catch (Exception)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Bad function call.", this.Name));
            }
            return(result);
        }
示例#5
0
        public override string Execute(IErrorReport errorReport)
        {
            if (functionArguments.Count() != 3)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Too many arguments", this.Name));
            }

            string result = null;

            try
            {
                string txt       = functionArguments[0].Execute(errorReport);
                char   character = functionArguments[1].Execute(errorReport)[0];
                int    amount    = int.Parse(functionArguments[2].Execute(errorReport));

                if (txt != null && txt.Length >= 1)
                {
                    result = txt.PadLeft(amount, character);
                }
            }
            catch (Exception)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Bad function call.", this.Name));
            }
            return(result);
        }
示例#6
0
		public CreateBuilderSkeleton(ITypeContainer typeContainer, 
			INameResolver resolver, IErrorReport errorReport)
		{
			this.typeContainer = typeContainer;
			this.resolver = resolver;
			this.errorReport = errorReport;
		}
示例#7
0
        public override string Execute(IErrorReport errorReport)
        {
            if (functionArguments.Count() != 1)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Too many arguments", this.Name));
            }

            string result = null;

            try
            {
                string txt = functionArguments[0].Execute(errorReport);

                if (txt != null && txt.Length >= 1)
                {
                    return("\"" + txt + "\"");
                }
                result = txt;
            }
            catch (Exception)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Bad function call.", this.Name));
            }
            return(result);
        }
示例#8
0
        public override string Execute(IErrorReport errorReport)
        {
            if (functionArguments.Count() != 3)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Too many arguments", this.Name));
            }

            string result = null;

            try
            {
                List <string> textResults = new List <string>();
                foreach (BaseFunction funcArg in functionArguments)
                {
                    textResults.Add(funcArg.Execute(errorReport));
                }

                string targetText      = functionArguments[0].Execute(errorReport);
                string textToReplace   = functionArguments[1].Execute(errorReport);
                string replacementText = functionArguments[2].Execute(errorReport);

                if (targetText != null && targetText.Length >= 1)
                {
                    result = targetText.Replace(textToReplace, replacementText);
                }
            }
            catch (Exception)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Bad function call.", this.Name));
            }
            return(result);
        }
示例#9
0
 public TypeBuilderSkeletonStep(ModuleBuilder modBuilder, ITypeContainer container,
                                INameResolver resolver, IErrorReport errorReport)
 {
     this.modBuilder  = modBuilder;
     this.container   = container;
     this.resolver    = resolver;
     this.errorReport = errorReport;
 }
示例#10
0
 public BaseSymbol(IErrorReport errorReport, string symbol, string title, string description, bool isPlaceholder)
 {
     this.Symbol        = symbol;
     this.Title         = title;
     this.Description   = description;
     this.IsPlaceholder = isPlaceholder;
     this.errorReport   = errorReport;
 }
示例#11
0
		public TypeBuilderSkeletonStep(ModuleBuilder modBuilder, ITypeContainer container, 
			INameResolver resolver, IErrorReport errorReport)
		{
			this.modBuilder = modBuilder;
			this.container = container;
			this.resolver = resolver;
			this.errorReport = errorReport;
		}
示例#12
0
 public ExpressionSymbol(IErrorReport errorReport, string symbol, string title, string description,
                         bool isPlaceholder, bool isVisibleToEditor, BaseFunction func, string prefix, string postfix)
     : base(errorReport, symbol, title, description, isPlaceholder, prefix, postfix)
 {
     this.func = func;
     this.IsVisibleToEditor = IsVisibleToEditor;
     this.errorReport       = errorReport;
 }
 public static AppConfigManager GetInstance(IErrorReport errorReport, IUserInterfaceProvider userIP)
 {
     if (instance == null)
     {
         instance = new AppConfigManager(errorReport, userIP);
     }
     return(instance);
 }
示例#14
0
 protected GraphViewProvider(Activity activity, TraceDataSource dataSource, IWindowlessControlContainerExt container, IErrorReport errorReport, IUserInterfaceProvider userIP, GraphViewMode mode)
 {
     currentActivity   = activity;
     currentDataSource = dataSource;
     currentContainer  = container;
     this.errorReport  = errorReport;
     currentViewMode   = mode;
     this.userIP       = userIP;
 }
 public ErrorReportRemap(IErrorReport parent)
     : base(parent)
 {
     m_Remap = new RemapTo[] {
         RemapTo.Log,
         RemapTo.Warning,
         RemapTo.Error,
     };
 }
示例#16
0
 protected WindowlessControlBase(int zOrder, WindowlessControlScale scale, IWindowlessControlContainer container, Point location, IErrorReport errorReport)
 {
     ZOrder           = zOrder;
     this.container   = container;
     Scale            = scale;
     Location         = location;
     this.errorReport = errorReport;
     Container.RegisterWindowlessControl(this);
 }
示例#17
0
        public BaseSymbol(IErrorReport errorReport, string symbol, string title, string description, bool isPlaceholder, string prefix, string postfix)
        {
            this.prefix  = prefix;
            this.postfix = postfix;

            this.Symbol        = symbol;
            this.Title         = title;
            this.Description   = description;
            this.IsPlaceholder = IsPlaceholder;
            this.errorReport   = errorReport;
        }
示例#18
0
 public CustomFilterDefineDialog(CustomFilterDialog parent, IErrorReport errorReport)
 {
     InitializeComponent();
     this.parent      = parent;
     this.errorReport = errorReport;
     sumOfcolumnWidth = 0;
     foreach (DataGridViewColumn column in paramGrid.Columns)
     {
         sumOfcolumnWidth += column.Width;
     }
 }
 public CreateCustomFilterByTemplateDialog(CustomFilterDialog parent, IErrorReport errorReport)
 {
     InitializeComponent();
     this.parent      = parent;
     this.errorReport = errorReport;
     sumOfColumnWidth = 0;
     foreach (DataGridViewColumn column in logicGrid.Columns)
     {
         sumOfColumnWidth += column.Width;
     }
 }
示例#20
0
 public VSOController(
     ISourceRepositoryFactory sourceRepositoryFactory,
     IDestinationRepositoryFactory destinationRepositoryFactory,
     IChangesCalculator changesCalculator, 
     IChangesReport changesReport, 
     IErrorReport errorReport
     )
 {
     _sourceRepositoryFactory = sourceRepositoryFactory;
     _destinationRepositoryFactory = destinationRepositoryFactory;
     _changesCalculator = changesCalculator;
     _changesReport = changesReport;
     _errorReport = errorReport;
 }
示例#21
0
 public VSOController(
     ISourceRepositoryFactory sourceRepositoryFactory,
     IDestinationRepositoryFactory destinationRepositoryFactory,
     IChangesCalculator changesCalculator,
     IChangesReport changesReport,
     IErrorReport errorReport
     )
 {
     _sourceRepositoryFactory      = sourceRepositoryFactory;
     _destinationRepositoryFactory = destinationRepositoryFactory;
     _changesCalculator            = changesCalculator;
     _changesReport = changesReport;
     _errorReport   = errorReport;
 }
示例#22
0
        public TraceFilterControl(IErrorReport report, TraceViewerForm form)
        {
            InitializeComponent();
            InitializeToolStrips();
            objectStateController        = new StateMachineController(this);
            searchInList.SelectedIndex   = 0;
            traceLevelList.SelectedIndex = 0;
            this.errorReport             = report;
            this.parentForm = form;
            TraceViewerForm traceViewerForm = this.parentForm;

            traceViewerForm.DataSourceChangedHandler = (TraceViewerForm.DataSourceChanged)Delegate.Combine(traceViewerForm.DataSourceChangedHandler, new TraceViewerForm.DataSourceChanged(TraceViewerForm_DataSourceChanged));
            objectStateController.SwitchState("TraceFilterDisableState");
        }
示例#23
0
        public void InitializeTest()
        {
            pushPassedToSource   = null;
            rootPassedToSource   = null;
            fakeSourceRepository = new SourceControlSync.Domain.Fakes.StubISourceRepository()
            {
                DownloadChangesAsyncPushStringCancellationToken = (push, root, token) =>
                {
                    token.ThrowIfCancellationRequested();
                    pushPassedToSource = push;
                    rootPassedToSource = root;
                    foreach (var commit in push.Commits)
                    {
                        commit.Changes = Enumerable.Empty <ItemChange>();
                    }
                    return(Task.FromResult(0));
                }
            };

            commitsPassedToCalculator   = null;
            changesReturnedByCalculator = null;
            fakeChangesCalculator       = new SourceControlSync.Domain.Fakes.StubIChangesCalculator()
            {
                CalculateItemChangesIEnumerableOfCommit = (commits) =>
                {
                    commitsPassedToCalculator   = commits;
                    changesReturnedByCalculator = commits.SelectMany(commit => commit.Changes).ToList();
                },
                ItemChangesGet = () => { return(changesReturnedByCalculator); }
            };

            changesPassedToDestination = null;
            rootPassedToDestination    = null;
            fakeDestinationRepository  = new SourceControlSync.Domain.Fakes.StubIDestinationRepository()
            {
                PushItemChangesAsyncIEnumerableOfItemChangeString = (changes, root) =>
                {
                    changesPassedToDestination = changes;
                    rootPassedToDestination    = root;
                    return(Task.FromResult(0));
                },
                ExecutedCommandsGet = () => { return(new SourceControlSync.Domain.Fakes.StubIExecutedCommands()); }
            };

            var fakeClock = new SourceControlSync.Domain.Fakes.StubIClock();

            fakeChangesReport = new ChangesReport(fakeClock);
            fakeErrorReport   = new ErrorReport(fakeClock);
        }
示例#24
0
        public static void RunMain(IErrorReport errorReport, Action entryPoint)
        {
            if (errorReport == null || Debugger.IsAttached)
            {
                entryPoint();
                return;
            }

            try
            {
                entryPoint();
            }
            catch (Exception ex)
            {
                errorReport.Report(ex);
            }
        }
示例#25
0
        public override string Execute(IErrorReport errorReport)
        {
            string result = null;

            try
            {
                foreach (BaseFunction func in functions)
                {
                    result += func.Execute(errorReport);
                }
            }
            catch (Exception)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Concatenation error.", this.Name));
            }
            return(result);
        }
示例#26
0
        public override string Execute(IErrorReport errorReport)
        {
            if (functionArguments.Count() != 1)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Guid function requires a single empty string parameter.", this.Name));
            }

            string result = null;

            try
            {
                string txt = functionArguments[0].Execute(errorReport);
                result = txt == "u" ? Guid.NewGuid().ToString().ToUpper() : Guid.NewGuid().ToString();
            }
            catch (Exception)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Bad function call.", this.Name));
            }
            return(result);
        }
示例#27
0
        public override string Execute(IErrorReport errorReport)
        {
            string result = null;

            try
            {
                string curOption = scopeTable.GetValueOfSymbol(this.symbol);
                if (curOption != null && functions.ContainsKey(curOption))
                {
                    BaseFunction func = functions[curOption];
                    string       txt  = func.Execute(errorReport);

                    result = txt;
                }
            }
            catch (Exception)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "If statement failed.", this.Name));
            }
            return(result);
        }
 private AppConfigManager(IErrorReport errorReport, IUserInterfaceProvider userIP)
 {
     try
     {
         this.errorReport = errorReport;
         this.userIP      = userIP;
         XmlNode xmlNode = InternalLoadSettingNodeFromAppConfigFile("filterOptions");
         if (xmlNode == null)
         {
             customFilterOptionSettings = new CustomFilterOptionSettings();
         }
         else
         {
             customFilterOptionSettings = new CustomFilterOptionSettings(xmlNode);
         }
     }
     catch (LogFileException)
     {
         customFilterOptionSettings = new CustomFilterOptionSettings();
     }
 }
示例#29
0
 internal void Initialize(TraceViewerForm parent, IUserInterfaceProvider userIP, IErrorReport errorReport)
 {
     parentForm         = parent;
     this.userIP        = userIP;
     this.errorReport   = errorReport;
     extensionMenu      = new ToolStripDropDownButton();
     extensionMenu.Text = SR.GetString("FV_Options");
     extensionMenu.ShowDropDownArrow = true;
     extensionMenu.ToolTipText       = SR.GetString("FV_OptionsTip");
     showBasicsMenuItem              = new ToolStripMenuItem(SR.GetString("FV_BasicInfoOption"));
     showBasicsMenuItem.ToolTipText  = SR.GetString("FV_BasicInfoOptionTip");
     showBasicsMenuItem.Checked      = true;
     showBasicsMenuItem.CheckOnClick = true;
     showBasicsMenuItem.Click       += changeOptionsMenuItem_Click;
     showDiagMenuItem              = new ToolStripMenuItem(SR.GetString("FV_DiagInfoOption"));
     showDiagMenuItem.ToolTipText  = SR.GetString("FV_DiagInfoOptionTip");
     showDiagMenuItem.Checked      = true;
     showDiagMenuItem.CheckOnClick = true;
     showDiagMenuItem.Click       += changeOptionsMenuItem_Click;
     extensionMenu.DropDownItems.Add(showBasicsMenuItem);
     extensionMenu.DropDownItems.Add(showDiagMenuItem);
     toolStrip.Items.Add(extensionMenu);
 }
示例#30
0
        public override string Execute(IErrorReport errorReport)
        {
            if (functionArguments.Count() != 3)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Too many arguments", this.Name));
            }

            string result = null;

            try
            {
                string txt        = functionArguments[0].Execute(errorReport);
                string indentType = functionArguments[1].Execute(errorReport);
                int    noOfTimes  = int.Parse(functionArguments[2].Execute(errorReport));

                string indentedText = "";

                if (txt != null && txt.Length >= 1)
                {
                    if (indentType == "TAB")
                    {
                        indentedText = txt.PadLeft(txt.Length + noOfTimes, '\t');
                    }
                    else // SPACE
                    {
                        indentedText = txt.PadLeft(txt.Length + noOfTimes, ' ');
                    }

                    result = indentedText;
                }
            }
            catch (Exception)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Bad function call.", this.Name));
            }
            return(result);
        }
示例#31
0
 public ActivityTraceModeAnalyzer(Activity activeActivity, TraceDataSource dataSource, bool containsActivityBoundary, bool containsVerboseTraces, ActivityTraceModeAnalyzerParameters parameters, IErrorReport errorReport)
 {
     if (activeActivity != null && dataSource != null)
     {
         this.containsActivityBoundary = containsActivityBoundary;
         this.containsVerboseTraces    = containsVerboseTraces;
         this.activeActivity           = activeActivity;
         this.dataSource  = dataSource;
         this.parameters  = parameters;
         this.errorReport = errorReport;
         RuntimeHelpers.PrepareConstrainedRegions();
         try
         {
             AnalysisRootActivity(ActiveActivity);
             ExpandTransfers();
             CollapseTransfers();
             ExpandActivities();
             CheckSuppressedActivities();
             SortResults();
             UpdateParameters();
         }
         catch (LogFileException e)
         {
             throw new TraceViewerException(SR.GetString("SL_ERROR_LOAD_TRACE"), e);
         }
         catch (TraceViewerException ex)
         {
             throw ex;
         }
         catch (Exception e2)
         {
             ExceptionManager.GeneralExceptionFilter(e2);
             throw new TraceViewerException(SR.GetString("SL_UnknownException"), e2);
         }
     }
 }
示例#32
0
        public override string Execute(IErrorReport errorReport)
        {
            if (functionArguments.Count() != 1)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Too many arguments", this.Name));
            }

            string result = null;

            try
            {
                string txt = functionArguments[0].Execute(errorReport);

                if (txt != null && txt.Length >= 1)
                {
                    result = txt.Where(c => !char.IsPunctuation(c)).Aggregate("", (current, c) => current + c);
                }
            }
            catch (Exception)
            {
                errorReport.AddError(new CustomError(this.Line, this.Column, "Bad function call.", this.Name));
            }
            return(result);
        }
示例#33
0
		public RookParser(IErrorReport errorReport)
		{
			this.errorReport = errorReport;
		}
示例#34
0
		public DeclarationBinding(IErrorReport errorReport, IIdentifierNameService identifierService)
		{
			this.errorReport = errorReport;
			this.identifierService = identifierService;
		}
示例#35
0
文件: Form1.cs 项目: atczyc/castle
		private void PostPassExecution(object sender, ICompilerPass pass, CompilationUnit unit, IErrorReport errorService)
		{
			CreateAst(unit, resultingAST.Nodes);
		}
 public ActivityTransferCellControl(TraceRecordCellItem parentTraceItem, IWindowlessControlContainer parentContainer, Point location, IErrorReport errorReport)
     : base(1, parentContainer.GetCurrentScale(), parentContainer, location, errorReport)
 {
     this.parentTraceItem = parentTraceItem;
     base.BackColor       = defaultBackColor;
     base.ForeColor       = defaultForeColor;
     isToArrow            = ((parentTraceItem.RelatedActivityItem.ItemIndex <= parentTraceItem.RelatedTraceRecordCellItem.RelatedActivityItem.ItemIndex) ? true : false);
     isLeft    = ((parentTraceItem.RelatedActivityItem.ItemIndex >= parentTraceItem.RelatedTraceRecordCellItem.RelatedActivityItem.ItemIndex) ? true : false);
     base.Size = GetControlSize(base.Scale, parentTraceItem);
 }
        public void InitializeTest()
        {
            pushPassedToSource = null;
            rootPassedToSource = null;
            fakeSourceRepository = new SourceControlSync.Domain.Fakes.StubISourceRepository()
            {
                DownloadChangesAsyncPushStringCancellationToken = (push, root, token) =>
                {
                    token.ThrowIfCancellationRequested();
                    pushPassedToSource = push;
                    rootPassedToSource = root;
                    foreach (var commit in push.Commits)
                    {
                        commit.Changes = Enumerable.Empty<ItemChange>();
                    }
                    return Task.FromResult(0);
                }
            };

            commitsPassedToCalculator = null;
            changesReturnedByCalculator = null;
            fakeChangesCalculator = new SourceControlSync.Domain.Fakes.StubIChangesCalculator()
            {
                CalculateItemChangesIEnumerableOfCommit = (commits) =>
                {
                    commitsPassedToCalculator = commits;
                    changesReturnedByCalculator = commits.SelectMany(commit => commit.Changes).ToList();
                },
                ItemChangesGet = () => { return changesReturnedByCalculator; }
            };

            changesPassedToDestination = null;
            rootPassedToDestination = null;
            fakeDestinationRepository = new SourceControlSync.Domain.Fakes.StubIDestinationRepository()
            {
                PushItemChangesAsyncIEnumerableOfItemChangeString = (changes, root) =>
                {
                    changesPassedToDestination = changes;
                    rootPassedToDestination = root;
                    return Task.FromResult(0);
                },
                ExecutedCommandsGet = () => { return new SourceControlSync.Domain.Fakes.StubIExecutedCommands(); }
            };

            var fakeClock = new SourceControlSync.Domain.Fakes.StubIClock();
            fakeChangesReport = new ChangesReport(fakeClock);
            fakeErrorReport = new ErrorReport(fakeClock);
        }