Esempio n. 1
0
 public CancelButton(RuntimeApplicationProperties doc)
 {
     m_doc    = doc;
     Text     = Resources.Strings.RuntimeApplication_CancelButton_Text;
     IsCancel = true;
     Padding  = new Thickness(15, 3, 15, 3);
     Margin   = new Thickness(5);
 }
Esempio n. 2
0
 public ApplyButton(RuntimeApplicationProperties doc)
 {
     m_doc           = doc;
     Text            = Resources.Strings.RuntimeApplication_ApplyButton_Text;
     Padding         = new Thickness(15, 3, 15, 3);
     Margin          = new Thickness(5);
     EnableCondition = doc.Valid;
 }
Esempio n. 3
0
        /// <summary>
        /// Assumes the memento is the RuntimeId (FieldGuid)
        /// </summary>
        /// <param name="memento"></param>
        /// <returns></returns>
        public override IDocument CreateDocument(string memento)
        {
            if (memento == null)
            {
                // They want to create a new runtime application (not saved yet)
                var rtp = new RuntimeApplicationProperties();
                rtp.Title = Resources.Strings.RuntimeApplication_NewTitle;
                rtp.m_editRuntimeApplication = NodeRuntimeApplication.BuildWith(
                    new FieldIdentifier(Resources.Strings.RuntimeApplication_Code_Default), // Code
                    new FieldGuid(firstRuntimeId()),                                        // TypeId
                    new FieldGuid(),                                                        // RuntimeId
                    new FieldString(),                                                      // Address
                    new FieldBase64(),                                                      // Configuration
                    new FieldBool(false));                                                  // ExecuteOnStartup
                return(rtp);
            }

            if (!m_docs.ContainsKey(memento))
            {
                RuntimeApplicationItem item = null;
                foreach (var solutionItem in rootSolutionItem.Items)
                {
                    RuntimeApplicationItem itemTest = solutionItem as RuntimeApplicationItem;
                    if (itemTest != null)
                    {
                        if (itemTest.RuntimeApplication.RuntimeId.ToString() == memento)
                        {
                            item = itemTest;
                            break;
                        }
                    }
                }

                if (item != null)
                {
                    RuntimeApplicationProperties rtp = new RuntimeApplicationProperties(item);
                    m_docs.Add(rtp.Memento, rtp);
                }
                else
                {
                    return(null);
                }
            }
            return(m_docs[memento]);
        }
 public OKButton(RuntimeApplicationProperties doc)
 {
     m_doc = doc;
     Text = Resources.Strings.RuntimeApplication_OkButton_Text;
     IsDefault = true;
     Padding = new Thickness(15,3,15,3);
     Margin = new Thickness(5);
     EnableCondition = doc.Valid;
 }
 public CancelButton(RuntimeApplicationProperties doc)
 {
     m_doc = doc;
     Text = Resources.Strings.RuntimeApplication_CancelButton_Text;
     IsCancel = true;
     Padding = new Thickness(15,3,15,3);
     Margin = new Thickness(5);
 }
        /// <summary>
        /// Assumes the memento is the RuntimeId (FieldGuid)
        /// </summary>
        /// <param name="memento"></param>
        /// <returns></returns>
        public override IDocument CreateDocument(string memento)
        {
            if (memento == null)
            {
                // They want to create a new runtime application (not saved yet)
                var rtp = new RuntimeApplicationProperties();
                rtp.Title = Resources.Strings.RuntimeApplication_NewTitle;
                rtp.m_editRuntimeApplication = NodeRuntimeApplication.BuildWith(
                    new FieldIdentifier(Resources.Strings.RuntimeApplication_Code_Default),    // Code
                    new FieldGuid(firstRuntimeId()),// TypeId
                    new FieldGuid(),            // RuntimeId
                    new FieldString(),          // Address
                    new FieldBase64(),          // Configuration
                    new FieldBool(false));      // ExecuteOnStartup
                return rtp;
            }

            if (!m_docs.ContainsKey(memento))
            {
                RuntimeApplicationItem item = null;
                foreach (var solutionItem in rootSolutionItem.Items)
                {
                    RuntimeApplicationItem itemTest = solutionItem as RuntimeApplicationItem;
                    if (itemTest != null)
                    {
                        if (itemTest.RuntimeApplication.RuntimeId.ToString() == memento)
                        {
                            item = itemTest;
                            break;
                        }
                    }
                }

                if (item != null)
                {
                    RuntimeApplicationProperties rtp = new RuntimeApplicationProperties(item);
                    m_docs.Add(rtp.Memento, rtp);
                }
                else
                {
                    return null;
                }
            }
            return m_docs[memento];
        }