public Window_ImportContact(ImportFrom from, Object uc)
 {
     InitializeComponent();
     parent = uc;
     importFrom = from;
     downloadController = MultiDownloadController.Instance;
 }
Example #2
0
 public ImportContactForm(ImportFrom from, UserControl uc)
 {
     InitializeComponent();
     uc_parent = uc;
     importFrom = from;
     downloadController = MultiDownloadController.Instance;
 }
Example #3
0
        /// <summary>
        /// Установить import from в указанном файле.
        /// </summary>
        /// <param name="settingsFilePath">Источник настройки.</param>
        /// <param name="filePath">Путь к файлу.</param>
        /// <param name="comments">Комментарии.</param>
        internal void AddOrUpdateImportFrom(string settingsFilePath, string filePath, IReadOnlyList <string> comments = null)
        {
            var importFrom = this.GetImportFrom(filePath);

            if (importFrom == null)
            {
                importFrom = new ImportFrom(settingsFilePath, filePath, false, comments);
                ParseSettingsSource(importFrom.GetAbsolutePath());
                this.importsFrom.Add(importFrom);
                return;
            }

            // Мы не можем изменить filePath, т.к. это ключ, по которому проверяется уникальность.
            importFrom.Update(comments);
        }
Example #4
0
        /// <summary>
        /// Распарсить корневой xml-источник настроек.
        /// </summary>
        protected void ParseRootSettingsSource()
        {
            if (this.isParsed)
            {
                return;
            }
            this.isParsed = true;

            if (string.IsNullOrEmpty(this.RootSettingsFilePath))
            {
                return;
            }

            var rootImport = new ImportFrom(this.RootSettingsFilePath, this.RootSettingsFilePath, isRoot: true);

            this.ParseSettingsSource(rootImport.GetAbsolutePath());

            // Добавляем корневой элемент последним.
            this.importsFrom.Add(rootImport);
        }
Example #5
0
            internal static stmt Convert(Statement stmt) {
                stmt ast;

                if (stmt is FunctionDefinition)
                    ast = new FunctionDef((FunctionDefinition)stmt);
                else if (stmt is ReturnStatement)
                    ast = new Return((ReturnStatement)stmt);
                else if (stmt is AssignmentStatement)
                    ast = new Assign((AssignmentStatement)stmt);
                else if (stmt is AugmentedAssignStatement)
                    ast = new AugAssign((AugmentedAssignStatement)stmt);
                else if (stmt is DelStatement)
                    ast = new Delete((DelStatement)stmt);
                else if (stmt is PrintStatement)
                    ast = new Print((PrintStatement)stmt);
                else if (stmt is ExpressionStatement)
                    ast = new Expr((ExpressionStatement)stmt);
                else if (stmt is ForStatement)
                    ast = new For((ForStatement)stmt);
                else if (stmt is WhileStatement)
                    ast = new While((WhileStatement)stmt);
                else if (stmt is IfStatement)
                    ast = new If((IfStatement)stmt);
                else if (stmt is WithStatement)
                    ast = new With((WithStatement)stmt);
                else if (stmt is RaiseStatement)
                    ast = new Raise((RaiseStatement)stmt);
                else if (stmt is TryStatement)
                    ast = Convert((TryStatement)stmt);
                else if (stmt is AssertStatement)
                    ast = new Assert((AssertStatement)stmt);
                else if (stmt is ImportStatement)
                    ast = new Import((ImportStatement)stmt);
                else if (stmt is FromImportStatement)
                    ast = new ImportFrom((FromImportStatement)stmt);
                else if (stmt is ExecStatement)
                    ast = new Exec((ExecStatement)stmt);
                else if (stmt is GlobalStatement)
                    ast = new Global((GlobalStatement)stmt);
                else if (stmt is ClassDefinition)
                    ast = new ClassDef((ClassDefinition)stmt);
                else if (stmt is BreakStatement)
                    ast = new Break();
                else if (stmt is ContinueStatement)
                    ast = new Continue();
                else if (stmt is EmptyStatement)
                    ast = new Pass();
                else
                    throw new ArgumentTypeException("Unexpected statement type: " + stmt.GetType());

                ast.GetSourceLocation(stmt);
                return ast;
            }