예제 #1
0
        /// <summary>
        /// Sets the codebase of the application manifest reference in the given deployment manifest.
        /// </summary>
        /// <param name="deploymentManifest">DeploymentManifest object</param>
        /// <param name="appCodeBase">Codebase</param>
        private static void SetApplicationCodeBase(DeployManifest deploymentManifest, string appCodeBase)
        {
            if (deploymentManifest == null)
            {
                return;
            }

            AssemblyReferenceCollection collection = deploymentManifest.AssemblyReferences;

            AssemblyReference ar;

            if (collection.Count > 0)
            {
                ar            = collection[0];
                ar.TargetPath = appCodeBase;
            }
            else
            {
                ar = new AssemblyReference(appCodeBase)
                {
                    TargetPath = appCodeBase
                };
                collection.Add(ar);
            }
        }
예제 #2
0
 /// <summary>
 /// Creates an instance of the class
 /// </summary>
 public CodeEditorControl()
 {
     InitializeComponent();
     referencePanel1.ParentEditor = this;
     References = new AssemblyReferenceCollection();
     References.ListChanged += new ListChangedEventHandler(References_ListChanged);
     ErrorPanelSettings = new ErrorPanelOptions(this);
     ReferencePanelSettings = new ReferencePanelOptions(this);
     CompileRequestOptions = new CompileRequestOptions();
     wpfControl1.ParentControl = this;
     Persistance = new CSharpTextEditor.PersistanceCache(this);
     buttonErrorPanelOpenHide_Click(this, new EventArgs());
     if (!DesignMode)
     {
        // PersistencePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CodeEditorControl");               
         Caret_PositionChanged(this, new EventArgs());
         wpfControl1.TextEditor1.KeyUp += new System.Windows.Input.KeyEventHandler(TextEditor1_KeyUp);
         wpfControl1.TextEditor1.TextArea.Caret.PositionChanged += new EventHandler(Caret_PositionChanged);
     }
     // TODO: button focus change if need
 }
예제 #3
0
 private void SaveReferenceCollection(AssemblyReferenceCollection referenceCollection)
 {
     try
     {
         _readerWriterLock.EnterWriteLock();
         var dataFile = GetReferenceDataFile();
         var jsonData = JsonConvert.SerializeObject(referenceCollection, Formatting.Indented);
         Kooboo.IO.IOUtility.SaveStringToFile(dataFile, jsonData);
     }
     finally
     {
         _readerWriterLock.ExitWriteLock();
     }
 }
예제 #4
0
        private AssemblyReferenceCollection RebuildReferenceData()
        {
            try
            {
                AssemblyReferenceCollection list = new AssemblyReferenceCollection();
                _readerWriterLock.EnterWriteLock();

                var binFolder = Path.Combine(_baseDir.CMSBaseDir + "Bin");
                foreach (var item in Directory.EnumerateFiles(binFolder, "*.dll"))
                {
                    var fileName = Path.GetFileName(item);
                    var version = GetAssemblyVersion(item);
                    list.Add(new AssemblyReferenceData(fileName, version, "System") { IsSystemAssembly = true });
                }
                return list;
            }
            finally
            {
                _readerWriterLock.ExitWriteLock();
            }
        }
예제 #5
0
 public static bool Compare(this AssemblyReferenceCollection source, AssemblyReferenceCollection n, Func<AssemblyReference, AssemblyReference, Action<string, string>, bool> checkitem, Action<string, string> errAct)
 {
     return Compare<AssemblyReference>(source,n,checkitem,errAct);
 }
예제 #6
0
 public static bool Compare(this AssemblyReferenceCollection source, AssemblyReferenceCollection n, Func<AssemblyReference, AssemblyReference, bool> checkitem)
 {
     return Compare<AssemblyReference>(source,n,checkitem);
 }
예제 #7
0
 public static bool Compare(this AssemblyReferenceCollection source, AssemblyReferenceCollection n)
 {
     return Compare<AssemblyReference>(source,n);
 }
예제 #8
0
 public static bool Compare(this AssemblyReferenceCollection source, AssemblyReferenceCollection n, Func <AssemblyReference, AssemblyReference, Action <string, string>, bool> checkitem, Action <string, string> errAct)
 {
     return(Compare <AssemblyReference>(source, n, checkitem, errAct));
 }
예제 #9
0
 public static bool Compare(this AssemblyReferenceCollection source, AssemblyReferenceCollection n, Func <AssemblyReference, AssemblyReference, bool> checkitem)
 {
     return(Compare <AssemblyReference>(source, n, checkitem));
 }
예제 #10
0
 public static bool Compare(this AssemblyReferenceCollection source, AssemblyReferenceCollection n)
 {
     return(Compare <AssemblyReference>(source, n));
 }
        public virtual IAssemblyReferenceCollection TransformAssemblyReferenceCollection(IAssemblyReferenceCollection value)
        {
            IAssemblyReference[] array = new IAssemblyReference[value.Count];
            for (int i = 0; i < value.Count; i++)
            {
                array[i] = this.TransformAssemblyReference(value[i]);
            }

            IAssemblyReferenceCollection target = new AssemblyReferenceCollection();
            target.AddRange(array);
            return target;
        }