コード例 #1
0
        // ファイルをコピー
        public void CopyFile()
        {
            string notificationFileName;
            string srcFilePath;

            if (Archiver.CanReadFile)
            {
                srcFilePath          = FilePath;
                notificationFileName = Path.GetFileName(FilePath);
            }
            else
            {
                // 書庫内ファイルの場合
                if (TempFilePath == null)
                {
                    WriteToTempFolder();
                }

                srcFilePath          = TempFilePath;
                notificationFileName = TempDirName + "\\" + Path.GetFileName(TempFilePath);
            }

            // コピー
            System.Collections.Specialized.StringCollection files = new System.Collections.Specialized.StringCollection();
            files.Add(srcFilePath);
            Clipboard.SetFileDropList(files);

            // 通知
            MainWindow.Current.NotificationBlock.Show("ファイルをコピー: " + notificationFileName,
                                                      NotificationPriority.Normal, NotificationTime.Normal, NotificationType.None);
        }
コード例 #2
0
ファイル: WorkDetails.xaml.cs プロジェクト: Egaros/CryPixiv
        void CopyImageToClipboard()
        {
            var src = DownloadedImages.Find(x => x.Page == currentPage).ImageData as BitmapImage;

            string filename = $"{LoadedWork.Id.Value}_p{currentPage}.png";
            string path     = Path.Combine(Path.GetTempPath(), filename);

            CreatedTemporaryFiles.Enqueue(path);

            //write the image to a temporary location (todo: purge it later)
            using (var fileStream = new FileStream(path, FileMode.Create))
            {
                BitmapEncoder encoder = new PngBitmapEncoder();
                encoder.Frames.Add(BitmapFrame.Create(src));
                encoder.Save(fileStream);
            }

            //group image(s)
            var imgCollection = new System.Collections.Specialized.StringCollection();

            imgCollection.Add(path);

            //set up our clipboard data
            DataObject data = new DataObject();

            data.SetFileDropList(imgCollection);
            data.SetData("Bitmap", src);          // transparency is not preserved. STILL NEEDS A FIX
            data.SetData("Preferred DropEffect", DragDropEffects.Move);

            //push it all to the clipboard
            Clipboard.Clear();
            Clipboard.SetDataObject(data, true);
        }
コード例 #3
0
ファイル: ContextN.cs プロジェクト: zonnonproject/compiler
        public static void init( )
        {
            // if ( allNamespaces != null ) return;
            allNamespaces = new NamespaceList();

            nsCached = new Dictionary <string, TypeNodeList>();

            // Scan all assemblies referenced in parameters
            // and take all namespaces from them.
            // Put all these namespaces into the common list.
            System.Collections.Specialized.StringCollection assemblies = CONTEXT.options.ReferencedAssemblies;
            foreach (string assName in assemblies)
            {
                AssemblyNode assembly = AssemblyNode.GetAssembly(assName, true, false, true);
                if (assembly == null && !CONTEXT.AnalysisOnly)
                {
                    ERROR.UnresolvedReference(assName);
                    continue;
                }
                NamespaceList nss = assembly.GetNamespaceList();
                for (int i = 0, n = nss.Length; i < n; i++)
                {
                    allNamespaces.Add(nss[i]);
                }
            }
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: titusxp/buzzle
        private static void LoadDatabase()
        {
            //Connect to the server
            var connectionString = "Data Source=localhost\\sqlexpress;Initial Catalog=master;Integrated Security=SSPI";
            var con = new SqlConnection(connectionString);
            ServerConnection serverConnection = new ServerConnection(con);
            Server sqlServer = new Server(serverConnection);

            System.IO.FileInfo mdf = new System.IO.FileInfo(@"Buzzle.mdf");
            System.IO.FileInfo ldf = new System.IO.FileInfo(@"Buzzle_log.LDF");

            var dbPath = sqlServer.MasterDBPath;
            var databasePath = dbPath + @"\Buzzle.mdf";
            var databaseLogPath = dbPath + @"\Buzzle_log.LDF";

            File.Copy(mdf.FullName, databasePath, true);
            File.Copy(ldf.FullName, databaseLogPath, true);

            var databasename = mdf.Name.ToLower().Replace(@".mdf", @"");

            System.Collections.Specialized.StringCollection databasefiles = new System.Collections.Specialized.StringCollection();
            databasefiles.Add(databasePath);
            databasefiles.Add(databaseLogPath);

            sqlServer.AttachDatabase(databasename, databasefiles);
        }
コード例 #5
0
        public TestDirProcMain()
        {
            InitializeComponent();
            _EventLog = new Logging();
            _EventLog.logFileName = "EventLog";
            _EventLog.WriteToLog("EventLog has been created.");

            _validExtList =  Properties.Settings.Default.ValidFileExt.Split(',').ToList<string>();
            System.Collections.Specialized.StringCollection sc = new System.Collections.Specialized.StringCollection();
            sc = Properties.Settings.Default.ScanDirectories;
            if (sc.Count > 0)
            {
                _scanDirs = new string[sc.Count];
                sc.CopyTo(_scanDirs, 0);
            }
            else
            {
                _scanDirs = new string[1];
                _scanDirs[0] = Properties.Settings.Default.ScanDirectory;
            }
            
            tbRootDir.Text = initTestDirectory(_scanDirs[0], "Scan");
            tbOuputDir.Text = initTestDirectory(Properties.Settings.Default.OutputDirectory,"Output");
            tbFailedDir.Text = initTestDirectory(Properties.Settings.Default.FailedDirectory,"Failed");;
            tbProcessedDir.Text = initTestDirectory(Properties.Settings.Default.ProcessedDirectory, "Processed"); ;
            tbFileName.Text = Properties.Settings.Default.TestFileName;
           
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: Whylex/ikit-mita-materials
        static void Main(string[] args)
        {
            var t11 = new System.Object();  //полное имя класса состоит из пространства имен и имени класса
            var t12 = new Object();         //можно использовать только имя класс, т.к. пространство имен System объявлено в using

            var t21 = new System.Text.StringBuilder();//полное имя класса состоит из пространства имен и имени класса
            var t22 = new StringBuilder();            //можно использовать только имя класс, т.к. пространство имен System объявлено в using

            var t31 = new System.Collections.Specialized.StringCollection();//полное имя класса состоит из пространства имен и имени класса
            //var t32 = new StringCollection();            //нельзя обратиться к классу по краткому имени, т.к. компилятор не сможет его найти в подключенных простанствах имен


            //создаем кота
            Cat firstCat = new Cat("Catterpiller", DateTime.Now);
            firstCat.FavouriteToy = new Toy { Name = "Toy1", Color="Red" };

            Cat secondCat = firstCat;//две переменне указывают на обного и того же кота.

            //метод Clone создает нового кота с теми же параметрами.
            object clonedObj = firstCat.Clone();
            //метод Clone возвращает объект типа Object - самого базового типа всех классов в .NET
            //чтобы поместить объект в переменную типа Cat, нужно выполнить приведение типа
            //в переменной clonedObj лежит объект типа Cat (резулитат метода Clone), поэтому ошибки нет.
            Cat thirdCat = (Cat)clonedObj;
            //если попытаться привести объект (в котором кошка) к типу Dog, то во время выполнения упадет исключение
            //Dog dog = (Dog)clonedObj;

            //если изменяем поле в secondCat, то оно меняется и в firstCat (т.к. это один и тот же объект),
            //но неменяется в thirdCat, т.к. это уже другой объект
            secondCat.FavouriteToy = new Toy() { Name = "Toy2" };

            Console.ReadLine();

        }
コード例 #7
0
        private void DropFileOutsideApplication(TreeNode node)
        {
            if (node is ArchiveFileWrapper)
            {
                Runtime.EnableDragDrop = false;

                string fullPath = Write2TempAndGetFullPath(((ArchiveFileWrapper)node).ArchiveFileInfo);

                DataObject dragObj = new DataObject();
                dragObj.SetFileDropList(new System.Collections.Specialized.StringCollection()
                {
                    fullPath
                });
                treeViewCustom1.DoDragDrop(dragObj, DragDropEffects.Copy);

                Runtime.EnableDragDrop = true;
            }
            else if (node is ArchiveFolderNodeWrapper || node is ArchiveRootNodeWrapper)
            {
                Runtime.EnableDragDrop = false;

                string[] fullPaths = Write2TempAndGetFullPath(node);

                DataObject dragObj    = new DataObject();
                var        collection = new System.Collections.Specialized.StringCollection();
                collection.AddRange(fullPaths);
                dragObj.SetFileDropList(collection);
                treeViewCustom1.DoDragDrop(dragObj, DragDropEffects.Copy);

                Runtime.EnableDragDrop = true;
            }
        }
コード例 #8
0
		public System.Collections.Specialized.StringCollection Extract()
		{
			String strPattern = "([A-Za-z0-9](([_\\.\\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\\.\\-]?[a-zA-Z0-9]+)*)\\.([A-Za-z]{2,}))";
			System.Collections.Specialized.StringCollection collAddresses = new System.Collections.Specialized.StringCollection();
			NodeFilter filter = new RegexFilter(strPattern, true);
			NodeList nodes = m_obParser.Parse(filter);
			if (null != nodes &&
				0 != nodes.Size())
			{
				RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Multiline;
				Regex obRegex = new Regex(strPattern, options);
				for(Int32 i = 0; i < nodes.Size(); i++)
				{
					INode obNode = nodes.ElementAt(i);
					String strText = obNode.GetText();

					Match m = obRegex.Match(strText);
					while(m.Success)
					{
						collAddresses.Add(m.Groups[0].Value);
						// Advance to the next match.
						m = m.NextMatch();
					}
				}
			}

			return collAddresses;
		}
コード例 #9
0
ファイル: Result.cs プロジェクト: Profit0004/mono
		internal Result(System.Collections.IDictionary items)
			: base(items)
		{
			AdapterTypeMap = new System.Collections.Generic.Dictionary<Type, Type>();
			Track = new System.Collections.Specialized.StringCollection();
			MarkupTextWriter = typeof (System.Web.UI.HtmlTextWriter);
		}
コード例 #10
0
		public CreateLimitationForm(string strXPathRoot, string strName, XPathNodeIterator xpIterator, bool bAttribute,
			System.Collections.Specialized.StringCollection astrPreviousConstraints)
		{
			InitializeComponent();

			m_astrPreviousConstraints = astrPreviousConstraints;
			this.textBoxXPath.Text = strXPathRoot;
			this.textBoxName.Text = strName;

			while ((xpIterator != null) && xpIterator.MoveNext())
			{
				string strValue = xpIterator.Current.Value;
				if (!m_strIteratorValues.Contains(strValue))
					m_strIteratorValues.Add(strValue);
			}

			if (bAttribute)
				radioButtonSpecificValue.Checked = true;
			else
				radioButtonPresenceOnly.Checked = true;

			// only enabled on subsequent executions
			radioButtonPreviousConstraint.Enabled = (m_astrPreviousConstraints.Count > 0);

			helpProvider.SetHelpString(checkedListBox, Properties.Resources.checkedListBoxHelp);
			helpProvider.SetHelpString(flowLayoutPanelConstraintType, Properties.Resources.flowLayoutPanelConstraintTypeHelp);
		}
コード例 #11
0
        protected void btnAddListValidation_Click(object sender, EventArgs e)
        {
            // ExStart:AddListValidation
            // Accessing the cells collection of the worksheet that is currently active
            GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];

            // Access "B1" cell and add some text
            GridCell cell = sheet.Cells[0, 1];
            cell.PutValue("Select Course:");

            // Accessing "C1" cell
            cell = sheet.Cells[0, 2];

            // Creating List validation for the "C1" cell
            var validation = cell.CreateValidation(GridValidationType.List, true);

            // Adding values to List validation
            var values = new System.Collections.Specialized.StringCollection();
            values.Add("Fortran");
            values.Add("Pascal");
            values.Add("C++");
            values.Add("Visual Basic");
            values.Add("Java");
            values.Add("C#");
            validation.ValueList = values;
            // ExEnd:AddListValidation 
        }
コード例 #12
0
ファイル: ImageCollection.cs プロジェクト: sillsdev/WorldPad
		public ImageCollection(bool isLarge)
		{
			m_images = new ImageList();
			if(isLarge)
				m_images.ImageSize = new System.Drawing.Size(32,32);
			m_labels = new System.Collections.Specialized.StringCollection();
		}
コード例 #13
0
        /// <summary>
        /// Найти преобразование
        /// </summary>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <returns></returns>
        static private bool FoundTransform(string from, string to)
        {
            bool emptyStack;

            lock (_lockConst)
            {
                emptyStack = _stack == null;
                if (emptyStack)
                {
                    _stack = new System.Collections.Specialized.StringCollection();
                }
            }

            bool res = false;

            if (_canConvertTo.ContainsKey(from))
            {
                System.Collections.Specialized.StringCollection sl = (System.Collections.Specialized.StringCollection)_canConvertTo[from];
                if (sl.Contains(to))
                {
                    res = true;
                }
                else
                {
                    for (int i = 0; i < sl.Count; i++)
                    {
                        string k = sl[i];
                        if (!_stack.Contains(k))
                        {
                            lock (_lockConst)
                            {
                                if (!_stack.Contains(k))
                                {
                                    _stack.Add(k);
                                    res = FoundTransform(k, to);
                                    _stack.RemoveAt(_stack.Count - 1);
                                    if (res)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            // else
            //    res = false;
            lock (_lockConst)
            {
                if (emptyStack)
                {
                    _stack = null;
                }
            }

            return(res);
        }
コード例 #14
0
 public HsOutput(System.Type ty, System.Reflection.MemberInfo[] mems)
 {
     m_type    = ty;
     m_members = mems;
     m_names   = new System.Collections.Specialized.StringCollection();
     m_imports = new System.Collections.Specialized.StringCollection();
     m_modname = "Dotnet." + m_type.FullName;
 }
コード例 #15
0
ファイル: HTML.cs プロジェクト: osherbakov/APCSDK
 /// <summary>
 /// Creates new HTML-formatted document with specified title and content on white background.
 /// </summary>
 /// <param name="DocumentTitle">Title for the document.</param>
 /// <param name="Header">The top part of the document contents.</param>
 /// <param name="Footer">The bottom part of the document content.</param>
 public HTMLDocument(string DocumentTitle, string Header, string Footer)
 {
     this.Title       = DocumentTitle;
     this.BodyBgColor = "#ffffff";
     this.BodyHeader  = Header;
     this.BodyFooter  = Footer;
     this.Paragraphs  = new System.Collections.Specialized.StringCollection();
 }
コード例 #16
0
        /// <summary>Static constructor used to initialize static member variables.</summary>
        static Program()
        {
            sProjectNamespaceName = string.Empty;

            sSupportedProjectExtensions = new System.Collections.Specialized.StringCollection();
            sSupportedProjectExtensions.Add(".csproj");
            sSupportedProjectExtensions.Add(".vbproj");
        }
コード例 #17
0
ファイル: AppSetting.cs プロジェクト: lixunrui/WeatherApp
        internal static List <String> GetFavourCityList()
        {
            System.Collections.Specialized.StringCollection cities = Properties.app.Default.FavourCityList;

            List <String> newCities = cities.Cast <String>().ToList();

            return(newCities);
        }
コード例 #18
0
 public Form1()
 {
     InitializeComponent();
     folderCol = new System.Collections.Specialized.StringCollection();
     CreateHeadersAndFillListView();
     PaintListView(@"d:\");
     folderCol.Add(@"d:\");
 }
コード例 #19
0
        private void CommandCopyCut_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            System.Collections.Specialized.StringCollection sc = new System.Collections.Specialized.StringCollection();
            sc.Add(System.IO.Path.Combine(Navigation.CurrentPath, Navigation.SelectedItem));
            Clipboard.SetFileDropList(sc);

            isCopy = e.Command == ApplicationCommands.Copy;
        }
コード例 #20
0
 public CompilerResults ProcessCompilation(string programText)
 {
     CodeDomProvider codeDomProvider = CodeDomProvider.CreateProvider("CSharp");
     System.CodeDom.Compiler.CompilerParameters parameters = new CompilerParameters();
     parameters.GenerateExecutable = false;
     System.Collections.Specialized.StringCollection assemblies = new System.Collections.Specialized.StringCollection();
     return codeDomProvider.CompileAssemblyFromSource(parameters, programText);
 }
コード例 #21
0
ファイル: PathHelper.cs プロジェクト: kinumellowlife/Milky
 /// <summary>
 /// ファイルパスをクリップボードにコピーする
 /// </summary>
 /// <param name="paths">コピーするファイルパス</param>
 static public void CopyFilesToClipboard(params string[] paths)
 {
     //コピーするファイルのパスをStringCollectionに追加する
     System.Collections.Specialized.StringCollection files = new System.Collections.Specialized.StringCollection();
     files.AddRange(paths);
     //クリップボードにコピーする
     Clipboard.SetFileDropList(files);
 }
コード例 #22
0
ファイル: HTML.cs プロジェクト: osherbakov/APCSDK
 /// <summary>
 /// Creates new unnamed blank HTML-formatted document with white background color.
 /// </summary>
 public HTMLDocument()
 {
     this.Title       = "Unnamed";
     this.BodyBgColor = "#ffffff";
     this.BodyHeader  = String.Empty;
     this.BodyFooter  = String.Empty;
     this.Paragraphs  = new System.Collections.Specialized.StringCollection();
 }
コード例 #23
0
ファイル: BloombergData.cs プロジェクト: colinnaylor/CN
 /// <summary>
 /// Initializes a new instance of the <see cref="BloombergData"/> class.
 /// Retrieves Bloomberg data via the API
 /// </summary>
 /// <param name="limitMsgs">The limit messages to search for.</param>
 /// <param name="emailTo">The email address for notification purposes - usually for the developers.</param>
 /// <param name="statusSystemName">Name of the system.</param>
 public BloombergData(System.Collections.Specialized.StringCollection limitMsgs, string emailTo, string statusSystemName, string arrayDelimiter)
 {
     UpdateStatus("BloombergData constructor");
     this.limits           = limitMsgs;
     this.emailErrorsTo    = emailTo;
     this.statusSystemName = statusSystemName;
     this.arrayDelimiter   = arrayDelimiter;
 }
コード例 #24
0
 private string GetString(System.Collections.Specialized.StringCollection inputString)
 {
     if (inputString != null && inputString.Count != 0 && !string.IsNullOrEmpty(inputString[0]))
     {
         return(inputString[0]);
     }
     return(string.Empty);
 }
コード例 #25
0
 private void EnsureExistence()
 {
     if (Keys == null || Values == null)
     {
         Keys   = new System.Collections.Specialized.StringCollection();
         Values = new System.Collections.Specialized.StringCollection();
     }
 }
コード例 #26
0
 public formListView()
 {
     InitializeComponent();
     carpetacol = new System.Collections.Specialized.StringCollection();
     CrearCabecerayLlenarListView();
     DibujarListView(@"C:\");
     carpetacol.Add(@"C:\");
 }
コード例 #27
0
 public HsOutput(System.Type ty,System.Reflection.MemberInfo[] mems)
 {
     m_type = ty;
       m_members = mems;
       m_names   = new System.Collections.Specialized.StringCollection();
       m_imports = new System.Collections.Specialized.StringCollection();
       m_modname = "Dotnet." + m_type.FullName;
 }
コード例 #28
0
ファイル: MainView.cs プロジェクト: linshuhe/pngoo
 private void pasteMenuItem_Click(object sender, EventArgs e)
 {
     System.Collections.Specialized.StringCollection files = Clipboard.GetFileDropList();
     foreach (string file in files)
     {
         addFileToBatch(file);
     }
 }
コード例 #29
0
 private void EnsureExistence()
 {
     if (Keys == null || Values == null)
     {
         Keys = new System.Collections.Specialized.StringCollection();
         Values = new System.Collections.Specialized.StringCollection();
     }
 }
コード例 #30
0
ファイル: Core.cs プロジェクト: RaptorFactor/devmaximus
        public Core(UI.EventManager pEventManager)
        {
            EventManager = pEventManager;
            NameQueryResponseInfoList = new Dictionary<WoWGuid, NameQueryResponseInfo>();
            ChatList = new System.Collections.Specialized.StringCollection();
            ObjList = new Dictionary<WoWGuid, ObjectBase>();
 
        }
コード例 #31
0
 public override void SetFileDropList(System.Collections.Specialized.StringCollection filePaths)
 {
     if (FData != null)
     {
         FData.SetFileDropList(filePaths);
     }
     base.SetFileDropList(filePaths);
 }
コード例 #32
0
ファイル: IniUtil.cs プロジェクト: icprog/DeTai_DD
        /// <summary>
        /// 读取指定节的所有键
        /// </summary>
        /// <param name="path"></param>
        /// <param name="section"></param>
        /// <param name="list"></param>
        public static void ReadSections(string path, string section, System.Collections.Specialized.StringCollection keys)
        {
            Byte[] buffer = new Byte[16384];
            long   bufLen = GetPrivateProfileString(section, null, null, buffer, buffer.GetUpperBound(0), path);

            //对Section进行解析
            GetStringsFromBuffer(buffer, bufLen, keys);
        }
コード例 #33
0
ファイル: MainForm.cs プロジェクト: kmstats/xt2005tools2010
 private void getGS()
 {
     System.Collections.Specialized.StringCollection list = com.echo.XT2005.Properties.Settings.Default.gsTitleList;
     foreach (string item in list)
     {
         tvRepair.Nodes.Add(item);
     }
 }
コード例 #34
0
        private static object GetIncomeBeforTaxByTax(double tax, double baseLine, System.Collections.Specialized.StringCollection rateClassInfoTable)
        {
            var rateClassInfos = GetRateClassInfos(rateClassInfoTable);
            var matchItem      = rateClassInfos.Select(s => new { rateClassInfo = s, MaxTax = GetMaxTax(s, rateClassInfos) })
                                 .FirstOrDefault(s => Convert.ToDecimal(tax) <= s.MaxTax);

            return((Convert.ToDecimal(tax) + matchItem.rateClassInfo.Deduction) / matchItem.rateClassInfo.Rate + Convert.ToDecimal(baseLine));
        }
コード例 #35
0
        private async void Page_Loaded(object senderx, RoutedEventArgs ee)
        {
            System.Collections.Specialized.StringCollection x = (System.Collections.Specialized.StringCollection)Properties.Settings.Default["bookmarks"];
            if (x.Count != 0)
            {
                foreach (var i in x)
                {
                    try
                    {
                        var     json    = System.IO.File.ReadAllText(i + "\\" + new DirectoryInfo(i).Name + ".json");
                        dynamic decoded = JsonConvert.DeserializeObject(json);
                        var     card    = new MaterialDesignThemes.Wpf.Card();
                        card.Height = 90;
                        card.Width  = 200;
                        Label lab = new Label();
                        lab.Content    = decoded.instanceName;
                        lab.FontWeight = FontWeights.ExtraBold;
                        Button play = new Button();
                        play.Content    = "Play";
                        play.Foreground = new SolidColorBrush(Colors.White);
                        play.Click     += new RoutedEventHandler((sender, e) => play_click(this, e, i));
                        bookmarksContainer.Children.Add(card);
                        StackPanel panel = new StackPanel();
                        play.Margin             = new Thickness(10, 20, 10, 0);
                        lab.HorizontalAlignment = HorizontalAlignment.Center;
                        panel.Children.Add(lab);
                        panel.Children.Add(play);
                        card.Content = panel;
                    }
                    catch (Exception ex)
                    {
                        x.Remove(i);
                        Label lab = new Label();
                        lab.FontSize = 15;
                        lab.Content  = "An error occurred. We fixed it. Reload this page";
                        bookmarksContainer.Children.Add(lab);
                        break;
                    }
                }
            }
            else
            {
                Label lab = new Label();
                lab.FontSize = 15;
                lab.Content  = "No bookmarks. Go to installed modpacks and bookmark some modpacks there";
                bookmarksContainer.Children.Add(lab);
            }
            transition.SelectedIndex = 1;
            if (Properties.Settings.Default["justUpdated"].ToString() == "true")
            {
                await Task.Delay(400);

                await MaterialDesignThemes.Wpf.DialogHost.Show(new Dialogs.Changelog(), "RootDialog");

                Properties.Settings.Default["justUpdated"] = "false";
                Properties.Settings.Default.Save();
            }
        }
コード例 #36
0
ファイル: 不給按PrintScrn.cs プロジェクト: Fun33/code
        private void copy()
        {
            if (GetAsyncKeyState(Keys.C) != 0 && GetAsyncKeyState(Keys.ControlKey) != 0)    //' GetAsyncKeyState 取得鍵盤狀態
            {
                //MessageBox.Show("被我抓到了");
                if (Clipboard.ContainsText(TextDataFormat.Text))
                {
                    string str = Clipboard.GetText();
                    if (getProcessNameFromFocusedWindow() == "LINE")
                    {
                        Clipboard.Clear();//' 若按了 Print Screen 鍵, 則清空剪貼簿
                        savetxt(str);
                    }
                    log("copy-text");
                }
                else if (Clipboard.ContainsText(TextDataFormat.CommaSeparatedValue))
                {
                    log("copy-TextDataFormat.CommaSeparatedValue");
                    //Clipboard.Clear();
                }
                else if (Clipboard.ContainsText(TextDataFormat.Html))
                {
                    log("copy-Html");
                    //Clipboard.Clear();
                }
                else if (Clipboard.ContainsText(TextDataFormat.Rtf))
                {
                    log("copy-Rtf");
                    //Clipboard.Clear();
                }
                else if (Clipboard.ContainsText(TextDataFormat.UnicodeText))
                {
                    log("copy-UnicodeText");
                    //Clipboard.Clear();
                }
                else if (Clipboard.ContainsAudio())
                {
                    log("copy--ContainsAudio");
                }

                else if (Clipboard.ContainsFileDropList())
                {
                    System.Collections.Specialized.StringCollection colls = Clipboard.GetFileDropList();
                    string files = getFiles(colls);
                    log("copy--" + files);
                }
                else if (Clipboard.ContainsImage())
                {
                    log("copy--ContainsImage");
                }
                else
                {
                    //Clipboard.Clear();
                    log("copy--沒東西");
                }
                //Clipboard.Clear();
            }
        }
コード例 #37
0
 public ImageCollection(bool isLarge)
 {
     m_images = new ImageList();
     if (isLarge)
     {
         m_images.ImageSize = new System.Drawing.Size(32, 32);
     }
     m_labels = new System.Collections.Specialized.StringCollection();
 }
コード例 #38
0
ファイル: ServiceMain.cs プロジェクト: Amphora2015/DemoTest
        public ServiceMain()
        {
            InitializeComponent();
            _logFile = new Logging();
            _logFile.logFileName = "EventLog";
            _logFile.WriteToLog("EventLog has been created.");

            string minuteDisplay;
            int timerIntervalMinutes = Properties.Settings.Default.TimerIntervalMinutes;
            minuteDisplay = timerIntervalMinutes == 1 ? " minute." : " minutes.";

            _timerIntervalMilliseconds = 1000 * 60 * timerIntervalMinutes;
            _logFile.WriteToLog("Timer interval set to " + timerIntervalMinutes.ToString() + minuteDisplay);

            System.Collections.Specialized.StringCollection sc = new System.Collections.Specialized.StringCollection();
            sc = Properties.Settings.Default.ScanDirectories;
            string[] scanDir = new string[sc.Count];

            //Copies all rows from string collection
            sc.CopyTo(scanDir, 0);

            string dirDisplay;
            dirDisplay = sc.Count == 1 ? "directory" : "directories";
            _logFile.WriteToLog("The following source " + dirDisplay + " will be scanned:");
            foreach (string dirName in scanDir)
            {
                _logFile.WriteToLog("--> " + dirName);
            }

            //jvc
            string failedDir = Properties.Settings.Default.FailedDirectory;
            _logFile.WriteToLog("FailedDirectory=" + failedDir);

            string outputDir = Properties.Settings.Default.OutputDirectory;
            string processedDir = Properties.Settings.Default.ProcessedDirectory;
            string validFileExt = Properties.Settings.Default.ValidFileExt;
            bool isDebugLogEnabled = Properties.Settings.Default.DebugLogEnabled;

            //_logFile.WriteToLog("OutputDirectory=" + outputDir);
            _logFile.WriteToLog("ProcessedDirectory=" + processedDir);
            _logFile.WriteToLog("ValidFileExt=" + validFileExt);
            _logFile.WriteToLog("DebugLogEnabled=" + isDebugLogEnabled);

            _logFile.WriteToLog("Creating DirectoryPoller...");
            _dirProcessor = new DirectoryProcessor(scanDir, validFileExt, outputDir, processedDir, failedDir, _logFile);
            _dirProcessor._isDebugLogEnabled = isDebugLogEnabled;
            _dirProcessor._EventLog = _logFile;
            _logFile.WriteToLog("DirectoryPoller was successfully created.");

            this.timerMain.Interval = _timerIntervalMilliseconds;
            //this.timerMain.Elapsed += new System.Timers.ElapsedEventHandler(timerMain_Elapsed);

            // If the timer is declared in a long-running method, use
            // KeepAlive to prevent garbage collection from occurring
            // before the method ends.
            GC.KeepAlive(timerMain);
        }
コード例 #39
0
        static void cpo_BeforeExecutingQueries(Operation currentOperation, ref System.Collections.Specialized.StringCollection currentValues, params object[] args)
        {
            System.Windows.Forms.MessageBox.Show(currentOperation.ToString());

            foreach (string s in currentValues)
            {
                System.Windows.Forms.MessageBox.Show(s);
            }
        }
コード例 #40
0
 private void CopyAsFile(System.Drawing.Imaging.ImageFormat format,
     String FileExtension)
 {
     String temp = saveAsTempFile(format, FileExtension);
     System.Collections.Specialized.StringCollection files = new
         System.Collections.Specialized.StringCollection();
     files.Add(temp);
     Clipboard.SetFileDropList(files);
 }
コード例 #41
0
        public void SetValues(string path, IEnumerable <string> values)
        {
            path = path.Replace(":", "_");
            var stringCollection = new System.Collections.Specialized.StringCollection();

            stringCollection.AddRange(values.ToArray());
            Settings.Default[path] = stringCollection;
            Settings.Default.Save();
        }
コード例 #42
0
ファイル: IOFunctions.cs プロジェクト: lucyy-mc/Explode
 public static void CopyEntries(FormMain form, ListView.SelectedListViewItemCollection items)
 {
     System.Collections.Specialized.StringCollection paths = new System.Collections.Specialized.StringCollection();
     foreach (ListViewItem k in items)
     {
         paths.Add(form.CurrentDirectory + k.Text);
     }
     Clipboard.SetFileDropList(paths);
 }
コード例 #43
0
ファイル: Copy-paste.cs プロジェクト: Monkeybin11/PicView
        /// <summary>
        /// Add file to clipboard
        /// </summary>
        internal static void Copyfile(string path)
        {
            var paths = new System.Collections.Specialized.StringCollection {
                path
            };

            Clipboard.SetFileDropList(paths);
            ShowTooltipMessage(Application.Current.Resources["FileCopy"]);
        }
コード例 #44
0
 public void CSharpStringCollectionNotCompiles()
 {
     Stream stream = GetCSharpBadSample();
     using (StreamReader sr = new StreamReader(stream))
     {
         System.Collections.Specialized.StringCollection references = new System.Collections.Specialized.StringCollection();
         references.Add("System.dll");
         CompilerAssert.NotCompiles(CompilerAssert.CSharpCompiler, references, sr.ReadToEnd());
     }
 }
コード例 #45
0
ファイル: IniUtil.cs プロジェクト: jxdong1013/archivems
 /// <summary>
 /// 读取指定节下的所有键值对
 /// </summary>
 /// <param name="path"></param>
 /// <param name="section"></param>
 /// <param name="values"></param>
 public static void ReadSections(string path, string section, System.Collections.Specialized.NameValueCollection values)
 {
     System.Collections.Specialized.StringCollection keys = new System.Collections.Specialized.StringCollection();
     ReadSections(path, section, keys);
     values.Clear();
     foreach (string key in keys)
     {
         values.Add(key, ReadIniValue(path, section, key));
     }
 }
コード例 #46
0
ファイル: frmBlacklist.cs プロジェクト: Shyvanita/idle_master
 public void SaveBlacklist()
 {
     System.Collections.Specialized.StringCollection blacklist = new System.Collections.Specialized.StringCollection();
     foreach (String appid in lstBlacklist.Items)
     {
         blacklist.Add(appid);
     }
     Properties.Settings.Default.blacklist = blacklist;
     Properties.Settings.Default.Save();
 }
コード例 #47
0
ファイル: NgChecker.cs プロジェクト: nico-lab/niconama-ocv
		/// <summary>
		/// フィルターを初期化する
		/// </summary>
		private void ClearFilter()
		{
			_normalFilterPattern = new StringBuilder();
			_unityFilterPattern = new StringBuilder();
			_normalFilter = null;
			_unifyFilter = null;
			_idCollections = new System.Collections.Specialized.StringCollection();
			_commandCollections = new System.Collections.Specialized.StringCollection();
			_clients.Clear();
		}
コード例 #48
0
ファイル: Form1.cs プロジェクト: niuniuliu/CSharp
    public Form1()
    {
      InitializeComponent();

      // Init ListView and folder collection
      folderCol = new System.Collections.Specialized.StringCollection();
      CreateHeadersAndFillListView();
      PaintListView(@"C:\");
      folderCol.Add(@"C:\");

    }
コード例 #49
0
ファイル: Form15.cs プロジェクト: 777ondro/sw-en
        public Form15()
        {
            InitializeComponent();

            // Init ListView and folder collection
            folderCol = new System.Collections.Specialized.StringCollection();
            CreateHeadersAndFillListView();
            PaintListView(@"C:\");
            folderCol.Add(@"C:\");

            this.lwFilesAndFolders.ItemActivate += new System.EventHandler(this.lwFilesAndFolders_ItemActivate);
        }
コード例 #50
0
ファイル: SettingsPanel.cs プロジェクト: RH-Code/GAPP
 public void Apply()
 {
     System.Collections.Specialized.StringCollection sc = new System.Collections.Specialized.StringCollection();
     foreach (ListViewItem lvi in listView1.Items)
     {
         if (lvi.Checked)
         {
             sc.Add(lvi.Tag as string);
         }
     }
     Properties.Settings.Default.Startup = sc;
     Properties.Settings.Default.Save();
 }
コード例 #51
0
ファイル: search.cs プロジェクト: itktc/projectktc-v2
        public static string BuildMultiColumnFilter(string filterExpression, DataColumnCollection coloumns)
        {
            System.Collections.Specialized.StringCollection coloumNames = new System.Collections.Specialized.StringCollection();

                foreach (DataColumn col in coloumns)
                {

                    coloumNames.Add(col.ColumnName);

                }

                return BuildMultiColumnFilter(filterExpression, coloumNames);
        }
コード例 #52
0
        private void btnDownload_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(txtLinks.Text))
            {
                var strCol = new System.Collections.Specialized.StringCollection();
                strCol.AddRange(txtLinks.Text.Split('\r'));
                var videoList = VKontakteApiWrapper.Instance.VideoGetByIds(Utils.StringUtils.GetUserAndObjectIDFromUrl(strCol));
                this.Close();

                DownloadVideo wind = new DownloadVideo(videoList);
                wind.Owner = App.Current.MainWindow;
                wind.Show();
            }
        }
コード例 #53
0
ファイル: LimitTest3.cs プロジェクト: uvbs/Holodeck
        public override void executeTest( )
        {
            Holodeck.HolodeckProcess.Start ();

            Holodeck.HolodeckPane.File_NewProject ();
            Holodeck.NewProjectPane1.Reset ();
            Holodeck.NewProjectPane1.SetProjectLocation ("C:\\LimitTest.hdp");
            Holodeck.NewProjectPane1.Next ();
            Holodeck.NewProjectPane2.Reset ();

            string applicationToLaunchPath = System.Environment.SystemDirectory + "\\..\\notepad.exe";

            Holodeck.NewProjectPane2.SetApplicationName (applicationToLaunchPath);
            Holodeck.NewProjectPane2.Next ();
            Holodeck.NewProjectPane3.Reset ();
            Holodeck.NewProjectPane3.SetPauseApplication (true);
            Holodeck.NewProjectPane3.Finish ();

            Holodeck.HolodeckPane.SelectLimitsPane ();

            Holodeck.HolodeckPane.Application_Resume ();
            Holodeck.LimitsPane.SetDiskUnits (Holodeck.LimitsPane.Unit.Byte);
            Holodeck.LimitsPane.SetDiskLimit(5); // Set Disk Limits to 5 bytes

            System.Collections.Specialized.StringCollection keyList = new System.Collections.Specialized.StringCollection ();
            keyList.Add ("1234567");
            keyList.Add ("%f");
            keyList.Add ("s");
            keyList.Add ("c:\\1.txt");
            keyList.Add ("{ENTER}");
            System.Threading.Thread.Sleep (1000);

            Holodeck.HolodeckProcess.SendKeysToApp ("Untitled - Notepad", keyList);
            /*
            try
            {
                keyList.Clear ();
                keyList.Add ("{ENTER}");
                Holodeck.HolodeckProcess.SendKeysToApp ("Notepad", keyList);

            }
            catch (Holodeck.HolodeckExceptions.CannotFindApplication e) // We couldn't find error dialog -> Holodeck didn't set the limits properly
            {
                // TODO: quit the application properly
                // TODO: exit Holodeck
                throw e;
            }*/
        }
コード例 #54
0
 public static ClientAPISettings settings()
 {
     var clientApiSettings = new ClientAPISettings();
             //clientApiSettings.HTTPS_ADDRESS_FOR_FILE_TRANSFER = "localhost";
             var checksumPillars = new System.Collections.Specialized.StringCollection { "checksum2" };
             var pillars = new System.Collections.Specialized.StringCollection();
             //pillars.Add("sbtape2");
             //pillars.Add("reference2");
             pillars.Add("jonas-testpillar");
             pillars.Add("kims-testpillar");
             //pillars.Add("kbpillar2");
             clientApiSettings.CHECKSUMPILLAR_IDS = pillars;
             clientApiSettings.CLIENT_ID = "Jonas-client";
             clientApiSettings.CLIENT_QUEUE = @"queue://jonas_test_client";
             //b.CLIENT_TOPIC_QUEUE = "topic://sa_test_client";
             clientApiSettings.COLLECTION_DESTINATION = "topic://integrationtest1";
             clientApiSettings.COLLECTION_ID = "integrationtest1";
             //b.COLLECTION_SETTINGS_XSD_FILE_PATH = @"C:\BitMagStuff\xsdFiles\bitrepository-repository-settings-10\xsd\RepositorySettings.xsd";
             //b.COMMON_QUEUE = "";
             clientApiSettings.DEFAULT_CHECKSUM_TYPE = "MD5";
             clientApiSettings.IDENTIFICATION_TIMEOUT = 7000;
             clientApiSettings.MAX_EXECUTING_ITEMS = 10;
             clientApiSettings.MAX_NUMBER_OF_REQUEST_RETRIES = 3;
             clientApiSettings.MESSAGE_BUS_CONFIGURATION_NAME = "Integration Test Broker Network A";
             clientApiSettings.MESSAGE_XSD_FILE_PATH = @"D:\bitrepository-message-xml-24\xsd\BitRepositoryMessages.xsd";
             clientApiSettings.PILLAR_IDS = pillars;
             const int port = 443;
             //clientApiSettings.ACTIVEMQ_BROKER = @"ssl://*****:*****@"ssl://217.198.211.150:61616?transport.clientcertfilename=D:/Downloads/Apache/apache-activemq-5.5.1/conf/client.cer&transport.acceptInvalidBrokerCert=true";
             //clientApiSettings.ACTIVEMQ_BROKER = @"tcp://*****:*****@"[a-zA-Z_\.\-0-9]+";
             clientApiSettings.XML_NAMESPACE = "http://bitrepository.org/BitRepositoryMessages.xsd";
             clientApiSettings.XSD_MINIMUM_VERSION = "24";
             clientApiSettings.XSD_VERSION = "24";
             clientApiSettings.OPERATION_TIMEOUT = 120000; // 2 min.
             clientApiSettings.PRIVATE_CERTIFICATE_THUMBPRINT = "B60843F8A3BFBD2944EAF9043D9C2443B936A981";
             clientApiSettings.PUBLIC_CERTIFICATE_THUMBPRINT = "B60843F8A3BFBD2944EAF9043D9C2443B936A981";
             clientApiSettings.USER_CERTIFICATES_STORE = "My";
             clientApiSettings.WEBDAV_HTTP_PORT = port;
             clientApiSettings.WEBDAV_BASEFOLDERNAME = "dav";
             clientApiSettings.WEBDAV_URI_SCHEME = "HTTPS";
             clientApiSettings.WEBDAV_IP_ADDRESS = "217.198.211.150";
             clientApiSettings.WEBDAV_CLIENT_CERTIFICATE_THUMBPRINT = "147cafe2c7d0b07d3a61653977a87ff7fe91f5c6";
             return clientApiSettings;
 }
コード例 #55
0
ファイル: settings.cs プロジェクト: julian202/LukMachine
        private void button2_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.LowPumpSetting = textBox1.Text;
              Properties.Settings.Default.MediumPumpSetting = textBox2.Text;
              Properties.Settings.Default.HighPumpSetting = textBox3.Text;

              System.Collections.Specialized.StringCollection pressures = new System.Collections.Specialized.StringCollection();
              System.Collections.Specialized.StringCollection fluids = new System.Collections.Specialized.StringCollection();

              //look at each item and see if there is something there to save
              foreach (DataGridViewRow dRow in dataGridView2.Rows)
              {
            try
            {
              if (dRow.Cells[0].Value.ToString() != "" && dRow.Cells[1].Value.ToString() != "")
            pressures.Add(dRow.Cells[0].Value.ToString() + ":" + dRow.Cells[1].Value.ToString());
            }
            catch (NullReferenceException ex)
            {
              //show error and return
              //MessageBox.Show("Invalid entry for Pressure Unit on line " + (dRow.Index + 1).ToString() + "!", COMMS.Instance.appName, MessageBoxButtons.OK, MessageBoxIcon.Error);
              //return;
            }
              }
              //make sure we save any good values user has entered here too...
              foreach (DataGridViewRow dRow in dataGridView3.Rows)
              {
            try
            {
              if (dRow.Cells[0].Value.ToString() != "" && dRow.Cells[1].Value.ToString() != "")
            fluids.Add(dRow.Cells[0].Value.ToString() + ":" + dRow.Cells[1].Value.ToString());
            }
            catch (NullReferenceException ex)
            {
              //show error and return
              //MessageBox.Show("Invalid entry for Fluid/viscosity on line " + (dRow.Index + 1).ToString() + "!", COMMS.Instance.appName, MessageBoxButtons.OK, MessageBoxIcon.Error);
              //return;
            }
              }

              Properties.Settings.Default.pressureUnits = pressures;
              Properties.Settings.Default.fluids = fluids;
              Properties.Settings.Default.COMM = comboBox1.Text;
              Properties.Settings.Default.Save();
              Close();
        }
コード例 #56
0
        public void AddToFileHistory(string fileName)
        {
            // ※そもそもこんな↓心配する必要アルの?
            // nullになりうるのは開発時だけじゃない?
            // ※考えられるのは,NullReferenceException飛ばして再試行とか.
            if (FileHistory == null)
            {
                // これどうする?
                FileHistory = new System.Collections.Specialized.StringCollection();
            }

            FileHistory.Remove(fileName);
            FileHistory.Insert(0, fileName);

            byte max = FileHistoryCount;
            while (FileHistory.Count > max)
            {
                FileHistory.RemoveAt(max);
            }
        }
コード例 #57
0
 private void SaveModules()
 {
     System.Collections.Specialized.StringCollection modsettings = new System.Collections.Specialized.StringCollection();
     foreach (ListViewItem lvw in lvwModules.Items)
     {
         String modstr = "";
         foreach (ListViewItem.ListViewSubItem subitm in lvw.SubItems)
         {
             modstr += subitm.Text + "|";
         }
         if(modstr.Trim() != "")
         {
             modstr = modstr.Substring(0, modstr.Length - 1);
             modsettings.Add(modstr);
         }                
     }
     Properties.Settings.Default["Modules"] = modsettings;
     Properties.Settings.Default.Save();
     Properties.Settings.Default.Reload();
 }
コード例 #58
0
        void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (!IsMouseCaptured)
            {
                dragStart = e.GetPosition(this);
                ShellObjectCollection collection = new ShellObjectCollection();
                System.Collections.IList list =
                    (DropDataList.SelectedItems.Count > 0) ?
                        DropDataList.SelectedItems : DropDataList.Items;

                foreach (ShellObject shellObject in list)
                {
                    collection.Add(shellObject);
                }

                if (collection.Count > 0)
                {
                    // This builds a DataObject from a "Shell IDList Array" formatted memory stream.
                    // This allows drag/clipboard operations with non-file based ShellObjects (i.e., 
                    // control panel, libraries, search query results)
                    dataObject = new DataObject(
                        "Shell IDList Array",
                        collection.BuildShellIDList());

                    // Also build a file drop list
                    System.Collections.Specialized.StringCollection paths = new System.Collections.Specialized.StringCollection();
                    foreach (ShellObject shellObject in collection)
                    {
                        if (shellObject.IsFileSystemObject)
                        {
                            paths.Add(shellObject.ParsingName);
                        }
                    }
                    if (paths.Count > 0)
                        dataObject.SetFileDropList(paths);
                }
            }
        }
コード例 #59
0
        public bool AddPassword(string ipw)
        {
            if (string.IsNullOrEmpty(ipw))
                return false;

            if (Settings.Default.RarPasswords == null)
            {
                var res = new System.Collections.Specialized.StringCollection();
                res.Add(ipw);
                Settings.Default.RarPasswords = res;
                return true;
            }
            else
            {
                if (!Settings.Default.RarPasswords.Contains(ipw))
                {
                    Settings.Default.RarPasswords.Add(ipw);
                    return true;
                }
            }

            return false;
        }
        protected void btnAddDropDownListValidation_Click(object sender, EventArgs e)
        {
            // ExStart:AddDropDownListValidation
            // Accessing the cells collection of the worksheet that is currently active
            GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];

            // Access "B1" cell and add some text
            GridCell cell = sheet.Cells[0, 1];
            cell.PutValue("Select Degree:");

            // Accessing "C1" cell
            cell = sheet.Cells[0, 2];

            // Creating DropDownList validation for the "C1" cell
            var validation = cell.CreateValidation(GridValidationType.DropDownList, true);
                        
            // Adding values to DropDownList validation
            var values = new System.Collections.Specialized.StringCollection();
            values.Add("Bachelor");
            values.Add("Master");
            values.Add("Doctor");
            validation.ValueList = values;
            // ExEnd:AddDropDownListValidation
        }