Example #1
0
        public void LoadTemplateInFront(Template template)
        {
            __frontElements.Clear();

            foreach (TemplateElement singleElement in template.Elements)
            {
                TemplateElement newTemplateElement = singleElement.CloneElement();
                DrawingContent content = newTemplateElement.CreateDrawingContent();

                __frontElements.Add(new CardRelation(){ Element = newTemplateElement, Content = content });
            }
        }
Example #2
0
 public void SetCardFrontTemplate(Template template)
 {
     this.CardFrontTemplateName = template.Name;
 }
Example #3
0
 public void SetCardBackTemplate(Template template)
 {
     this.CardBackTemplateName = template.Name;
 }
Example #4
0
 public static int Compare(Template templateA, Template templateB)
 {
     return string.Compare(templateA.Name, templateB.Name);
 }
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            UITableViewCell cell = tableView.CellAt(indexPath);

            if (__lastSelectedCell != null)
                __lastSelectedCell.Accessory = UITableViewCellAccessory.None;

            cell.Accessory = UITableViewCellAccessory.Checkmark;
            __lastSelectedCell = cell;

            List<Template> sectionTemplates = __templatesByType[__sections[indexPath.Section]];
            this.CurrentSelectedTemplate = sectionTemplates[indexPath.Row];

            var handler = this.RowHasBeenSelected;

            if (handler != null)
                handler(this, new EventArgs());
        }
Example #6
0
        private void TableSource_RowHasBeenSelected(object sender, EventArgs e)
        {
            if (string.Equals(this.SelectedTemplate.Name, __tableSource.CurrentSelectedTemplate.Name))
                return;

            this.SelectedTemplate = __tableSource.CurrentSelectedTemplate;
            var handler = this.SelectionChanged;

            if (handler != null)
                handler(this, new EventArgs());
        }
Example #7
0
 public TemplateDialog(Template currentTemplate)
 {
     this.EdgesForExtendedLayout = UIRectEdge.None;
     this.SelectedTemplate = currentTemplate;
     this.Title = "Template Selection";
 }
Example #8
0
        public static void LoadTemplates()
        {
            DirectoryInfo defaultTemplates = new DirectoryInfo(ApplicationEnviroment.DEFAULT_TEMPLATES_DIRECTORY);

            foreach (FileInfo singleTemplate in defaultTemplates.GetFiles("*.xml"))
            {
                Template newDefaultTemplate = new Template();
                newDefaultTemplate.IsDefault = true;
                newDefaultTemplate.Location = singleTemplate.FullName;

                if (string.Equals(singleTemplate.Name, DEFAULT_FRONT_TEMPLATE))
                    DefaultFrontTemplate = newDefaultTemplate;

                if (string.Equals(singleTemplate.Name, DEFAULT_BACK_TEMPLATE))
                    DefaultBackTemplate = newDefaultTemplate;

                __templates.Add(newDefaultTemplate);
            }

            DirectoryInfo customTemplates = new DirectoryInfo(ApplicationEnviroment.CUSTOM_TEMPLATES_DIRECTORY);

            foreach (FileInfo singleTemplate in customTemplates.GetFiles("*.xml"))
            {
                Template newCustomTemplate = new Template();
                newCustomTemplate.IsDefault = false;
                newCustomTemplate.Location = singleTemplate.FullName;

                __templates.Add(newCustomTemplate);
            }
        }
Example #9
0
 public static void SaveTemplate(Template template)
 {
     throw new NotImplementedException("Check that the template is already in the list");
 }